- UpdateRoadPosition refactoring progress

- removed MAX_TRAFFIC_CARS as redundant
This commit is contained in:
Ilya Shurumov 2021-01-14 19:44:28 +06:00
parent 982c07bb3c
commit 4eecd43554
5 changed files with 913 additions and 38 deletions

View File

@ -1776,7 +1776,7 @@ int CreateCivCarWotDrivesABitThenStops(int direction, LONGVECTOR4* startPos, LON
carCnt++; carCnt++;
slot++; slot++;
} while (carCnt < &car_data[MAX_TRAFFIC_CARS]); } while (carCnt < &car_data[MAX_CARS]);
if (pNewCar == NULL) if (pNewCar == NULL)
return -1; return -1;
@ -1869,7 +1869,7 @@ int CreateStationaryCivCar(int direction, long orientX, long orientZ, LONGVECTOR
carCnt++; carCnt++;
slot++; slot++;
} while (carCnt < &car_data[MAX_TRAFFIC_CARS]); } while (carCnt < &car_data[MAX_CARS]);
} }
if (newCar) if (newCar)
@ -2086,7 +2086,7 @@ int PingInCivCar(int minPingInDist)
carCnt++; carCnt++;
slot++; slot++;
} while (carCnt < &car_data[MAX_TRAFFIC_CARS]); } while (carCnt < &car_data[MAX_CARS]);
if (newCar == NULL) if (newCar == NULL)
{ {

File diff suppressed because it is too large Load Diff

View File

@ -473,6 +473,12 @@ void DisplayMoon(DVECTOR* pos, CVECTOR* col, int flip)
} }
extern VECTOR dummy; extern VECTOR dummy;
RECT16 sun_source = {
1008,
456,
16,
10
};
// [D] [T] // [D] [T]
void DrawLensFlare(void) void DrawLensFlare(void)
@ -507,12 +513,7 @@ void DrawLensFlare(void)
RECT16 source; RECT16 source;
CVECTOR col; CVECTOR col;
source = { source = sun_source;
1008,
456,
16,
10
};
if (gWeather - 1U <= 1 || gTimeOfDay == 0 || gTimeOfDay == 2) if (gWeather - 1U <= 1 || gTimeOfDay == 0 || gTimeOfDay == 2)
return; return;
@ -675,11 +676,16 @@ void DrawLensFlare(void)
source.x = sun_pers_conv_position.vx; source.x = sun_pers_conv_position.vx;
source.y = sun_pers_conv_position.vy + last->disp.disp.y; source.y = sun_pers_conv_position.vy + last->disp.disp.y;
#if 1//def PSX
sample_sun = (DR_MOVE*)current->primptr; sample_sun = (DR_MOVE*)current->primptr;
SetDrawMove(sample_sun, &source, 1008, 456); SetDrawMove(sample_sun, &source, 1008, 456);
addPrim(current->ot + 0x20, sample_sun); addPrim(current->ot + 0x20, sample_sun);
current->primptr += sizeof(DR_MOVE); current->primptr += sizeof(DR_MOVE);
#else
// to avoid delays and uploads to GPU we're simply going to directly request from screen VRAM area
sun_source = source;
#endif
} }
else else
{ {

View File

@ -11,7 +11,6 @@
#define MAX_PEDESTRIANS 28 #define MAX_PEDESTRIANS 28
#define MAX_SEATED_PEDS 20 #define MAX_SEATED_PEDS 20
#define MAX_PLACED_PEDS 15 #define MAX_PLACED_PEDS 15
#define MAX_TRAFFIC_CARS 19
#define MAX_EXPLOSION_OBJECTS 5 #define MAX_EXPLOSION_OBJECTS 5
#define MAX_THROWN_BOMBS 5 #define MAX_THROWN_BOMBS 5
#define MAX_MOTION_CAPTURE 24 #define MAX_MOTION_CAPTURE 24

View File

@ -310,8 +310,8 @@ void GameDebugKeys(int nKey, bool down)
else if (nKey == SDL_SCANCODE_2) else if (nKey == SDL_SCANCODE_2)
{ {
gShowCollisionDebug++; gShowCollisionDebug++;
if (gShowCollisionDebug > 3) gShowCollisionDebug %= 5;
gShowCollisionDebug = 0;
printf("Collision debug: %d\n", gShowCollisionDebug); printf("Collision debug: %d\n", gShowCollisionDebug);
} }
else if (nKey == SDL_SCANCODE_3) else if (nKey == SDL_SCANCODE_3)