Skip to content

Commit d4cdb48

Browse files
committed
- misc changes
1 parent 277d391 commit d4cdb48

4 files changed

Lines changed: 23 additions & 16 deletions

File tree

src_rebuild/DebugOverlay.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,8 @@ void DrawDebugOverlays()
4040
gte_SetRotMatrix(&inv_camera_matrix);
4141

4242
SVECTOR a, b;
43-
a.vx = ld.posA.vx - camera_position.vx;
44-
a.vy = ld.posA.vy - camera_position.vy;
45-
a.vz = ld.posA.vz - camera_position.vz;
46-
47-
b.vx = ld.posB.vx - camera_position.vx;
48-
b.vy = ld.posB.vy - camera_position.vy;
49-
b.vz = ld.posB.vz - camera_position.vz;
43+
VecSubtract(&a, &ld.posA, &camera_position);
44+
VecSubtract(&b, &ld.posB, &camera_position);
5045

5146
gte_ldv3(&a, &b, &b);
5247

src_rebuild/Game/C/civ_ai.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,8 +2172,8 @@ int PingInCivCar(int minPingInDist)
21722172
}
21732173
else
21742174
{
2175-
i = 0;
2176-
while (i < numLanes)
2175+
2176+
for (i = 0; i < numLanes; i++)
21772177
{
21782178
// collect the lanes.
21792179
allowedToPark = ROAD_IS_PARKING_ALLOWED_AT(&roadInfo, i);
@@ -2186,8 +2186,6 @@ int PingInCivCar(int minPingInDist)
21862186
// pick only non-parkable driveable lanes if parked cars not requested
21872187
if (tryPingInParkedCars && allowedToPark || ROAD_IS_AI_LANE(&roadInfo, i) && !allowedToPark)
21882188
possibleLanes[numPossibleLanes++] = i;
2189-
2190-
i++;
21912189
}
21922190

21932191
if (numPossibleLanes == 0)

src_rebuild/Game/C/gamesnd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ void IdentifyZone(envsound* ep, envsoundinfo* E, int pl)
20592059

20602060
int tmp[4];
20612061
float _g[4];
2062-
__bitfield64 zones;
2062+
bitfield64 zones;
20632063
int snd;
20642064

20652065
// [A] does it really needed? we don't have that much sounds to be played
@@ -2123,9 +2123,9 @@ void IdentifyZone(envsound* ep, envsoundinfo* E, int pl)
21232123
if (dist < vol)
21242124
{
21252125
if (i < 32)
2126-
zones.l |= 1 << (i & 0x1f);
2126+
zones.l |= 1 << (i & 31);
21272127
else
2128-
zones.h |= 1 << (i & 0x1f);
2128+
zones.h |= 1 << (i & 31);
21292129

21302130
tmp[j] = i;
21312131

@@ -2137,9 +2137,9 @@ void IdentifyZone(envsound* ep, envsoundinfo* E, int pl)
21372137
else
21382138
{
21392139
if (i < 32)
2140-
zones.l |= 1 << (i & 0x1f);
2140+
zones.l |= 1 << (i & 31);
21412141
else
2142-
zones.h |= 1 << (i & 0x1f);
2142+
zones.h |= 1 << (i & 31);
21432143

21442144
tmp[j] = i;
21452145
j++;

src_rebuild/Game/dr2math.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ extern short rcossin_tbl[8192];
4747
#define RemapVal( val, A, B, C, D) \
4848
(C + (D - C) * (val - A) / (B - A))
4949

50+
#define VecCopy(_v, _xyz) \
51+
{ \
52+
(_v)->vx = (_xyz)->vx; \
53+
(_v)->vy = (_xyz)->vy; \
54+
(_v)->vz = (_xyz)->vz; \
55+
}
56+
57+
#define VecNegate(_v) \
58+
{ \
59+
(_v)->vx = -(_v)->vx; \
60+
(_v)->vy = -(_v)->vy; \
61+
(_v)->vz = -(_v)->vz; \
62+
}
63+
5064
#define SetVec(_v, _x, _y, _z) \
5165
{ \
5266
(_v)->vx = _x; \

0 commit comments

Comments
 (0)