- tyre tracks edge cases fixed

This commit is contained in:
InspirationByte 2022-01-29 20:30:00 +03:00
parent b839691cd4
commit e33c979a9a
4 changed files with 35 additions and 24 deletions

View File

@ -1482,7 +1482,7 @@ void jump_debris(CAR_DATA* cp)
// [D] [T] // [D] [T]
void CheckCarEffects(CAR_DATA* cp, int player_id) void CheckCarEffects(CAR_DATA* cp, int player_id)
{ {
static char last_track_state[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS] = { -1 }; static char last_track_state[MAX_TYRE_PLAYERS][MAX_TYRE_TRACK_WHEELS] = { -1 };
int skidsound, cnt; int skidsound, cnt;
char wheels_on_ground; char wheels_on_ground;

View File

@ -1199,6 +1199,17 @@ void StepSim(void)
static int stupid_logic[4]; static int stupid_logic[4];
#if MAX_TYRE_TRACK_PLAYERS > 2
if (gInGameCutsceneActive != 0)
{
for (i = 0; i < 4; i++)
{
stupid_logic[i] = player[i + NumPlayers].playerCarId;
}
}
else
#endif
{
// "Car Bomb"? // "Car Bomb"?
if (gInGameCutsceneActive != 0 && gCurrentMissionNumber == 23 && gInGameCutsceneID == 0) if (gInGameCutsceneActive != 0 && gCurrentMissionNumber == 23 && gInGameCutsceneID == 0)
stupid_logic[0] = 2; stupid_logic[0] = 2;
@ -1208,6 +1219,7 @@ void StepSim(void)
stupid_logic[1] = player[1].playerCarId; stupid_logic[1] = player[1].playerCarId;
stupid_logic[2] = gThePlayerCar; stupid_logic[2] = gThePlayerCar;
stupid_logic[3] = player[0].targetCarId; // [A] stupid_logic[3] = player[0].targetCarId; // [A]
}
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {

View File

@ -32,20 +32,20 @@ int gShadowTextureNum;
UV shadowuv; UV shadowuv;
POLYFT4 shadowpoly; POLYFT4 shadowpoly;
VECTOR tyre_new_positions[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS]; VECTOR tyre_new_positions[MAX_TYRE_PLAYERS][MAX_TYRE_TRACK_WHEELS];
VECTOR tyre_save_positions[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS]; VECTOR tyre_save_positions[MAX_TYRE_PLAYERS][MAX_TYRE_TRACK_WHEELS];
int smoke_count[MAX_TYRE_PLAYERS][MAX_TYRE_TRACK_WHEELS];
int tyre_track_offset[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS]; int tyre_track_offset[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS];
int num_tyre_tracks[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS]; int num_tyre_tracks[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS];
TYRE_TRACK track_buffer[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS][64]; TYRE_TRACK track_buffer[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS][64];
int smoke_count[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS];
// [D] [T] // [D] [T]
void InitTyreTracks(void) void InitTyreTracks(void)
{ {
int i; int i;
for (i = 0; i < 4; i++) for (i = 0; i < MAX_TYRE_TRACK_PLAYERS; i++)
{ {
ClearMem((char*)num_tyre_tracks[i], sizeof(num_tyre_tracks[0])); ClearMem((char*)num_tyre_tracks[i], sizeof(num_tyre_tracks[0]));
ClearMem((char*)tyre_track_offset[i], sizeof(tyre_track_offset[0])); ClearMem((char*)tyre_track_offset[i], sizeof(tyre_track_offset[0]));
@ -56,7 +56,7 @@ void InitTyreTracks(void)
void ResetTyreTracks(CAR_DATA* cp, int player_id) void ResetTyreTracks(CAR_DATA* cp, int player_id)
{ {
// [A] reset tyre tracks // [A] reset tyre tracks
if (player_id >= 0 && player_id < 2 && cp->controlType != CONTROL_TYPE_NONE) if (player_id >= 0 && player_id < MAX_TYRE_TRACK_PLAYERS && cp->controlType != CONTROL_TYPE_NONE)
{ {
GetTyreTrackPositions(cp, player_id); GetTyreTrackPositions(cp, player_id);
SetTyreTrackOldPositions(player_id); SetTyreTrackOldPositions(player_id);
@ -293,9 +293,7 @@ void DrawTyreTracks(void)
tt_p = track_buffer[player_id][wheel_loop] + index; tt_p = track_buffer[player_id][wheel_loop] + index;
index++; index++;
index &= 63;
if (index == 64)
index = 0;
if (tt_p->type == 2) if (tt_p->type == 2)
continue; continue;

View File

@ -37,6 +37,7 @@
#endif #endif
// Tyre track visuals // Tyre track visuals
#define MAX_TYRE_PLAYERS 4
#ifndef PSX #ifndef PSX
#define MAX_TYRE_TRACK_WHEELS 4 #define MAX_TYRE_TRACK_WHEELS 4
#define MAX_TYRE_TRACK_PLAYERS 4 #define MAX_TYRE_TRACK_PLAYERS 4