- fix light trails bugs

This commit is contained in:
Ilya Shurumov 2022-07-12 23:16:01 +06:00
parent 38f53aca68
commit b7a0bb4b71
2 changed files with 6 additions and 2 deletions

View File

@ -401,6 +401,8 @@ DAMAGED_LAMP damaged_lamp[MAX_DAMAGED_LAMPS];
MATRIX debris_mat;
MATRIX leaf_mat;
#define LAMP_STREAK_ID(x,y) (((x) & 0xffff) | (((y) & 0xffff) << 16))
// [D] [T]
void PlacePoolForCar(CAR_DATA *cp, CVECTOR *col, int front, int in_car)
{
@ -1367,7 +1369,7 @@ void AddSmallStreetLight(CELL_OBJECT *cop, int x, int y, int z, int type)
v3 = v1;
LightIndex = find_lamp_streak(cop->pos.vx + cop->pos.vz + x); // [A] was pointer.
LightIndex = find_lamp_streak(LAMP_STREAK_ID(cop->pos.vx + x, cop->pos.vz)); // [A] was pointer.
if (LightIndex > -1)
col.cd = 0x60;
@ -1771,7 +1773,7 @@ void AddTrafficLight(CELL_OBJECT *cop, int x, int y, int z, int flag, int yang)
a.g = (a.g * tempfade) >> 10;
LightSortCorrect = -140;
LightIndex = find_lamp_streak(cop->pos.vx + cop->pos.vz + x + y); // [A] was pointer.
LightIndex = find_lamp_streak(LAMP_STREAK_ID(cop->pos.vx + x, cop->pos.vz + y)); // [A] was pointer.
if (LightIndex < 0)
a.cd = 0;

View File

@ -585,7 +585,9 @@ int main(int argc, char** argv)
// configure host game
ini_sget(config, "game", "drawDistance", "%d", &gDrawDistance);
#ifdef DYNAMIC_LIGHTING
ini_sget(config, "game", "dynamicLights", "%d", &gEnableDlights);
#endif
ini_sget(config, "game", "disableChicagoBridges", "%d", &gDisableChicagoBridges);
ini_sget(config, "game", "fieldOfView", "%d", &newScrZ);
ini_sget(config, "game", "freeCamera", "%d", &enableFreecamera);