From ea34a1449ac244d48df97bc090aaaece8280dd7d Mon Sep 17 00:00:00 2001 From: InspirationByte Date: Sun, 16 Jan 2022 15:41:27 +0300 Subject: [PATCH] - convert 0x107f -> OTSIZE-1 --- src_rebuild/Game/C/cars.c | 5 ++++- src_rebuild/Game/C/motion_c.c | 8 ++++---- src_rebuild/Game/C/sky.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src_rebuild/Game/C/cars.c b/src_rebuild/Game/C/cars.c index a0b14a3a..89b6bb44 100644 --- a/src_rebuild/Game/C/cars.c +++ b/src_rebuild/Game/C/cars.c @@ -46,7 +46,6 @@ MODEL* gDamWheelModelPtr; CAR_DATA* active_car_list[MAX_CARS]; BOUND_BOX bbox[MAX_CARS]; u_char lightsOnDelay[MAX_CARS]; -u_short civ_clut[8][32][6]; short FrontWheelRotation[MAX_CARS]; // offset 0x0 short BackWheelRotation[MAX_CARS]; // offset 0x30 @@ -63,6 +62,10 @@ MODEL* gCarLowModelPtr[MAX_CAR_MODELS]; MODEL* gCarDamModelPtr[MAX_CAR_MODELS]; MODEL* gCarCleanModelPtr[MAX_CAR_MODELS]; +// pedestrian palette at 0 and next are cars +// model_id, texture_number, palette +u_short civ_clut[8][32][6]; + int whichCP = 0; int baseSpecCP = 0; CAR_POLY carPolyBuffer[2001]; diff --git a/src_rebuild/Game/C/motion_c.c b/src_rebuild/Game/C/motion_c.c index 6cb68391..53c3f0ac 100644 --- a/src_rebuild/Game/C/motion_c.c +++ b/src_rebuild/Game/C/motion_c.c @@ -788,7 +788,7 @@ void DrawBodySprite(PEDESTRIAN* pDrawingPed, int boneId, VERTTYPE v1[2], VERTTYP if (bDoingShadow != 0) { - addPrim(current->ot + 0x107f, prims); + addPrim(current->ot + OTSIZE - 1, prims); #ifdef PGXP prims->pgxp_index = 0xffff; @@ -1842,7 +1842,7 @@ void TannerShadow(PEDESTRIAN* pDrawingPed, VECTOR* pPedPos, SVECTOR* pLightPos, dr_env = (DR_ENV*)current->primptr; SetDrawEnv(dr_env, &drEnv); - addPrim(current->ot + 0x107f, dr_env); + addPrim(current->ot + OTSIZE - 1, dr_env); current->primptr += sizeof(DR_ENV); Tangle = ratan2(-pLightPos->vx, pLightPos->vz); @@ -1935,7 +1935,7 @@ void TannerShadow(PEDESTRIAN* pDrawingPed, VECTOR* pPedPos, SVECTOR* pLightPos, // clear to black and draw Tanner sprites newShowTanner(pDrawingPed); - addPrim(current->ot + 0x107f, &tileTannerClear[current->id]); + addPrim(current->ot + OTSIZE - 1, &tileTannerClear[current->id]); // restore vectors camera_position = cp; @@ -1955,7 +1955,7 @@ void TannerShadow(PEDESTRIAN* pDrawingPed, VECTOR* pPedPos, SVECTOR* pLightPos, dr_env = (DR_ENV*)current->primptr; SetDrawEnv(dr_env, &drEnv); - addPrim(current->ot + 0x107f, dr_env); + addPrim(current->ot + OTSIZE - 1, dr_env); current->primptr += sizeof(DR_ENV); } diff --git a/src_rebuild/Game/C/sky.c b/src_rebuild/Game/C/sky.c index 0031ae42..3b248a0e 100644 --- a/src_rebuild/Game/C/sky.c +++ b/src_rebuild/Game/C/sky.c @@ -866,7 +866,7 @@ void PlotSkyPoly(POLYFT4* polys, int skytexnum, unsigned char r, unsigned char g poly->clut = skyclut[skytexnum]; poly->tpage = skytpage[skytexnum]; - addPrim(current->ot + 0x107f, poly); + addPrim(current->ot + OTSIZE - 1, poly); #if defined(USE_PGXP) && defined(USE_EXTENDED_PRIM_POINTERS) poly->pgxp_index = outpoints[src->v0].pgxp_index;