mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-25 03:42:34 +01:00
- complete player and replay streams arrays refactoring
This commit is contained in:
parent
d257a42b22
commit
64a024991e
@ -1305,19 +1305,15 @@ void StepGame(void)
|
|||||||
if ((padd & 0x2000U) && (padd & 0x8000U))
|
if ((padd & 0x2000U) && (padd & 0x8000U))
|
||||||
padd &= ~0xA000;
|
padd &= ~0xA000;
|
||||||
|
|
||||||
i = NumPlayers;
|
|
||||||
controller_bits = padd;
|
controller_bits = padd;
|
||||||
|
|
||||||
pl = player;
|
for (i = 0; i < NumPlayers; i++)
|
||||||
while (i >= 0)
|
|
||||||
{
|
{
|
||||||
|
pl = &player[i];
|
||||||
if (pl->horn.time == 0 || pl->horn.on == 0)
|
if (pl->horn.time == 0 || pl->horn.on == 0)
|
||||||
pl->horn.time = 0;
|
pl->horn.time = 0;
|
||||||
else
|
else
|
||||||
pl->horn.time--;
|
pl->horn.time--;
|
||||||
|
|
||||||
i--;
|
|
||||||
pl++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ModifyCamera();
|
ModifyCamera();
|
||||||
|
@ -991,11 +991,13 @@ void DrawMultiplayerMap(void)
|
|||||||
|
|
||||||
DrawMultiplayerTargets();
|
DrawMultiplayerTargets();
|
||||||
|
|
||||||
pl = player;
|
|
||||||
r = 255;
|
r = 255;
|
||||||
g = 0;
|
g = 0;
|
||||||
|
|
||||||
for (i = 0; i < NumPlayers; i++) {
|
for (i = 0; i < NumPlayers; i++)
|
||||||
|
{
|
||||||
|
pl = &player[i];
|
||||||
|
|
||||||
target.vx = pl->pos[0];
|
target.vx = pl->pos[0];
|
||||||
target.vz = pl->pos[2];
|
target.vz = pl->pos[2];
|
||||||
|
|
||||||
@ -1008,8 +1010,6 @@ void DrawMultiplayerMap(void)
|
|||||||
|
|
||||||
DrawPlayerDot(&target, -pl->dir, r, g, 0, 0x8);
|
DrawPlayerDot(&target, -pl->dir, r, g, 0, 0x8);
|
||||||
|
|
||||||
pl++;
|
|
||||||
|
|
||||||
r++;
|
r++;
|
||||||
g--;
|
g--;
|
||||||
}
|
}
|
||||||
|
@ -246,17 +246,18 @@ void ChangePedPlayerToCar(int playerID, CAR_DATA *newCar)
|
|||||||
// [D] [T]
|
// [D] [T]
|
||||||
void UpdatePlayers(void)
|
void UpdatePlayers(void)
|
||||||
{
|
{
|
||||||
int carId;
|
int i, carId;
|
||||||
PEDESTRIAN *ped;
|
PEDESTRIAN* ped;
|
||||||
PLAYER *locPlayer;
|
PLAYER* locPlayer;
|
||||||
CAR_DATA* cp;
|
CAR_DATA* cp;
|
||||||
|
|
||||||
if(CopsAllowed == 0)
|
if (CopsAllowed == 0)
|
||||||
pedestrianFelony = 0;
|
pedestrianFelony = 0;
|
||||||
|
|
||||||
locPlayer = player;
|
for (i = 0; i < MAX_PLAYERS; i++)
|
||||||
|
{
|
||||||
|
locPlayer = &player[i];
|
||||||
|
|
||||||
do {
|
|
||||||
if (gInGameCutsceneActive == 0)
|
if (gInGameCutsceneActive == 0)
|
||||||
locPlayer->playerType = (locPlayer->pPed != NULL) ? 2 : 1;
|
locPlayer->playerType = (locPlayer->pPed != NULL) ? 2 : 1;
|
||||||
|
|
||||||
@ -264,31 +265,29 @@ void UpdatePlayers(void)
|
|||||||
{
|
{
|
||||||
carId = locPlayer->playerCarId;
|
carId = locPlayer->playerCarId;
|
||||||
|
|
||||||
if(locPlayer->worldCentreCarId >= 0)
|
if (locPlayer->worldCentreCarId >= 0)
|
||||||
locPlayer->spoolXZ = (VECTOR *)car_data[locPlayer->worldCentreCarId].hd.where.t;
|
locPlayer->spoolXZ = (VECTOR*)car_data[locPlayer->worldCentreCarId].hd.where.t;
|
||||||
|
|
||||||
if (carId >= 0)
|
if (carId >= 0)
|
||||||
{
|
{
|
||||||
cp = &car_data[carId];
|
cp = &car_data[carId];
|
||||||
|
|
||||||
locPlayer->pos[0] = cp->hd.where.t[0];
|
locPlayer->pos[0] = cp->hd.where.t[0];
|
||||||
locPlayer->pos[1] = cp->hd.where.t[1];
|
locPlayer->pos[1] = cp->hd.where.t[1];
|
||||||
locPlayer->pos[2] = cp->hd.where.t[2];
|
locPlayer->pos[2] = cp->hd.where.t[2];
|
||||||
locPlayer->dir = cp->hd.direction;
|
locPlayer->dir = cp->hd.direction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (locPlayer->playerType == 2)
|
else if (locPlayer->playerType == 2)
|
||||||
{
|
{
|
||||||
ped = locPlayer->pPed;
|
ped = locPlayer->pPed;
|
||||||
|
|
||||||
locPlayer->pos[0] = ped->position.vx;
|
locPlayer->pos[0] = ped->position.vx;
|
||||||
locPlayer->pos[1] = -ped->position.vy;
|
locPlayer->pos[1] = -ped->position.vy;
|
||||||
locPlayer->pos[2] = ped->position.vz;
|
locPlayer->pos[2] = ped->position.vz;
|
||||||
locPlayer->dir = ped->dir.vy + -0x800;
|
locPlayer->dir = ped->dir.vy - 2048;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
locPlayer++;
|
|
||||||
} while (locPlayer <= &player[7]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// [D] [T]
|
// [D] [T]
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#ifndef PLAYERS_H
|
#ifndef PLAYERS_H
|
||||||
#define PLAYERS_H
|
#define PLAYERS_H
|
||||||
|
|
||||||
#define MAX_PLAYERS 8
|
|
||||||
|
|
||||||
extern PLAYER player[MAX_PLAYERS];
|
extern PLAYER player[MAX_PLAYERS];
|
||||||
|
|
||||||
extern void InitPlayer(PLAYER *locPlayer, CAR_DATA *cp, char carCtrlType, int direction, LONGVECTOR4* startPos, int externModel, int palette, char *padid); // 0x000739D8
|
extern void InitPlayer(PLAYER *locPlayer, CAR_DATA *cp, char carCtrlType, int direction, LONGVECTOR4* startPos, int externModel, int palette, char *padid); // 0x000739D8
|
||||||
|
@ -21,7 +21,7 @@ int gOutOfTape = 0;
|
|||||||
|
|
||||||
REPLAY_PARAMETER_BLOCK *ReplayParameterPtr = NULL;
|
REPLAY_PARAMETER_BLOCK *ReplayParameterPtr = NULL;
|
||||||
|
|
||||||
REPLAY_STREAM ReplayStreams[8];
|
REPLAY_STREAM ReplayStreams[MAX_REPLAY_STREAMS];
|
||||||
int NumReplayStreams = 1;
|
int NumReplayStreams = 1;
|
||||||
|
|
||||||
char *ReplayStart;
|
char *ReplayStart;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
extern int gOutOfTape;
|
extern int gOutOfTape;
|
||||||
extern REPLAY_PARAMETER_BLOCK *ReplayParameterPtr;
|
extern REPLAY_PARAMETER_BLOCK *ReplayParameterPtr;
|
||||||
|
|
||||||
extern REPLAY_STREAM ReplayStreams[8];
|
extern REPLAY_STREAM ReplayStreams[MAX_REPLAY_STREAMS];
|
||||||
extern int NumReplayStreams;
|
extern int NumReplayStreams;
|
||||||
|
|
||||||
extern char *ReplayStart;
|
extern char *ReplayStart;
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
// DRIVER 2 game engine limits
|
// DRIVER 2 game engine limits
|
||||||
// please populate this file only with engine limits during refactoring
|
// please populate this file only with engine limits during refactoring
|
||||||
|
|
||||||
|
#define MAX_PLAYERS 8 // used for replay streams mostly
|
||||||
|
|
||||||
#define MAX_MODEL_SLOTS 1536 // DO NOT CHANGE. No effect in upping it - limited by cell types
|
#define MAX_MODEL_SLOTS 1536 // DO NOT CHANGE. No effect in upping it - limited by cell types
|
||||||
#define MAX_CARS 20
|
#define MAX_CARS 20
|
||||||
|
|
||||||
@ -37,6 +39,7 @@
|
|||||||
|
|
||||||
// replay definitions.
|
// replay definitions.
|
||||||
// DO NOT EDIT, breaks compatibility!
|
// DO NOT EDIT, breaks compatibility!
|
||||||
|
#define MAX_REPLAY_STREAMS MAX_PLAYERS
|
||||||
#define MAX_REPLAY_CAMERAS 60
|
#define MAX_REPLAY_CAMERAS 60
|
||||||
#define MAX_REPLAY_WAYPOINTS 150
|
#define MAX_REPLAY_WAYPOINTS 150
|
||||||
#define MAX_REPLAY_PINGS 400
|
#define MAX_REPLAY_PINGS 400
|
||||||
|
Loading…
Reference in New Issue
Block a user