- misc changes

This commit is contained in:
InspirationByte 2022-02-03 23:57:39 +03:00
parent 277d391add
commit d4cdb48ddf
4 changed files with 23 additions and 16 deletions

View File

@ -40,13 +40,8 @@ void DrawDebugOverlays()
gte_SetRotMatrix(&inv_camera_matrix); gte_SetRotMatrix(&inv_camera_matrix);
SVECTOR a, b; SVECTOR a, b;
a.vx = ld.posA.vx - camera_position.vx; VecSubtract(&a, &ld.posA, &camera_position);
a.vy = ld.posA.vy - camera_position.vy; VecSubtract(&b, &ld.posB, &camera_position);
a.vz = ld.posA.vz - camera_position.vz;
b.vx = ld.posB.vx - camera_position.vx;
b.vy = ld.posB.vy - camera_position.vy;
b.vz = ld.posB.vz - camera_position.vz;
gte_ldv3(&a, &b, &b); gte_ldv3(&a, &b, &b);

View File

@ -2172,8 +2172,8 @@ int PingInCivCar(int minPingInDist)
} }
else else
{ {
i = 0;
while (i < numLanes) for (i = 0; i < numLanes; i++)
{ {
// collect the lanes. // collect the lanes.
allowedToPark = ROAD_IS_PARKING_ALLOWED_AT(&roadInfo, i); allowedToPark = ROAD_IS_PARKING_ALLOWED_AT(&roadInfo, i);
@ -2186,8 +2186,6 @@ int PingInCivCar(int minPingInDist)
// pick only non-parkable driveable lanes if parked cars not requested // pick only non-parkable driveable lanes if parked cars not requested
if (tryPingInParkedCars && allowedToPark || ROAD_IS_AI_LANE(&roadInfo, i) && !allowedToPark) if (tryPingInParkedCars && allowedToPark || ROAD_IS_AI_LANE(&roadInfo, i) && !allowedToPark)
possibleLanes[numPossibleLanes++] = i; possibleLanes[numPossibleLanes++] = i;
i++;
} }
if (numPossibleLanes == 0) if (numPossibleLanes == 0)

View File

@ -2059,7 +2059,7 @@ void IdentifyZone(envsound* ep, envsoundinfo* E, int pl)
int tmp[4]; int tmp[4];
float _g[4]; float _g[4];
__bitfield64 zones; bitfield64 zones;
int snd; int snd;
// [A] does it really needed? we don't have that much sounds to be played // [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)
if (dist < vol) if (dist < vol)
{ {
if (i < 32) if (i < 32)
zones.l |= 1 << (i & 0x1f); zones.l |= 1 << (i & 31);
else else
zones.h |= 1 << (i & 0x1f); zones.h |= 1 << (i & 31);
tmp[j] = i; tmp[j] = i;
@ -2137,9 +2137,9 @@ void IdentifyZone(envsound* ep, envsoundinfo* E, int pl)
else else
{ {
if (i < 32) if (i < 32)
zones.l |= 1 << (i & 0x1f); zones.l |= 1 << (i & 31);
else else
zones.h |= 1 << (i & 0x1f); zones.h |= 1 << (i & 31);
tmp[j] = i; tmp[j] = i;
j++; j++;

View File

@ -47,6 +47,20 @@ extern short rcossin_tbl[8192];
#define RemapVal( val, A, B, C, D) \ #define RemapVal( val, A, B, C, D) \
(C + (D - C) * (val - A) / (B - A)) (C + (D - C) * (val - A) / (B - A))
#define VecCopy(_v, _xyz) \
{ \
(_v)->vx = (_xyz)->vx; \
(_v)->vy = (_xyz)->vy; \
(_v)->vz = (_xyz)->vz; \
}
#define VecNegate(_v) \
{ \
(_v)->vx = -(_v)->vx; \
(_v)->vy = -(_v)->vy; \
(_v)->vz = -(_v)->vz; \
}
#define SetVec(_v, _x, _y, _z) \ #define SetVec(_v, _x, _y, _z) \
{ \ { \
(_v)->vx = _x; \ (_v)->vx = _x; \