mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-22 02:12:43 +01:00
- tyre tracks edge cases fixed
This commit is contained in:
parent
b839691cd4
commit
e33c979a9a
@ -1482,7 +1482,7 @@ void jump_debris(CAR_DATA* cp)
|
||||
// [D] [T]
|
||||
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;
|
||||
|
||||
char wheels_on_ground;
|
||||
|
@ -1199,6 +1199,17 @@ void StepSim(void)
|
||||
|
||||
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"?
|
||||
if (gInGameCutsceneActive != 0 && gCurrentMissionNumber == 23 && gInGameCutsceneID == 0)
|
||||
stupid_logic[0] = 2;
|
||||
@ -1208,6 +1219,7 @@ void StepSim(void)
|
||||
stupid_logic[1] = player[1].playerCarId;
|
||||
stupid_logic[2] = gThePlayerCar;
|
||||
stupid_logic[3] = player[0].targetCarId; // [A]
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
|
@ -32,20 +32,20 @@ int gShadowTextureNum;
|
||||
UV shadowuv;
|
||||
POLYFT4 shadowpoly;
|
||||
|
||||
VECTOR tyre_new_positions[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS];
|
||||
VECTOR tyre_save_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_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 num_tyre_tracks[MAX_TYRE_TRACK_PLAYERS][MAX_TYRE_TRACK_WHEELS];
|
||||
|
||||
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]
|
||||
void InitTyreTracks(void)
|
||||
{
|
||||
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*)tyre_track_offset[i], sizeof(tyre_track_offset[0]));
|
||||
@ -56,7 +56,7 @@ void InitTyreTracks(void)
|
||||
void ResetTyreTracks(CAR_DATA* cp, int player_id)
|
||||
{
|
||||
// [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);
|
||||
SetTyreTrackOldPositions(player_id);
|
||||
@ -293,9 +293,7 @@ void DrawTyreTracks(void)
|
||||
tt_p = track_buffer[player_id][wheel_loop] + index;
|
||||
|
||||
index++;
|
||||
|
||||
if (index == 64)
|
||||
index = 0;
|
||||
index &= 63;
|
||||
|
||||
if (tt_p->type == 2)
|
||||
continue;
|
||||
|
@ -37,6 +37,7 @@
|
||||
#endif
|
||||
|
||||
// Tyre track visuals
|
||||
#define MAX_TYRE_PLAYERS 4
|
||||
#ifndef PSX
|
||||
#define MAX_TYRE_TRACK_WHEELS 4
|
||||
#define MAX_TYRE_TRACK_PLAYERS 4
|
||||
|
Loading…
Reference in New Issue
Block a user