Re3/src/control/Record.h

69 lines
1.5 KiB
C
Raw Normal View History

2019-05-29 14:02:58 -04:00
#pragma once
2020-04-10 04:03:38 -04:00
class CAutomobile;
2020-02-16 15:08:54 -05:00
class CVehicle;
2020-04-10 04:03:38 -04:00
class CControllerState;
2020-02-16 15:08:54 -05:00
2019-06-28 06:34:02 -04:00
enum {
RECORDSTATE_0,
RECORDSTATE_1,
RECORDSTATE_2,
};
2019-09-11 20:43:18 -04:00
class CRecordDataForChase
2019-05-29 14:02:58 -04:00
{
2020-04-10 04:03:38 -04:00
enum {
NUM_CHASE_CARS = 20
};
2019-05-29 14:02:58 -04:00
public:
2019-09-11 20:43:18 -04:00
static uint8 &Status;
2020-04-10 04:03:38 -04:00
static int &PositionChanges;
static uint8 &CurrentCar;
static CAutomobile*(&pChaseCars)[NUM_CHASE_CARS];
static uint32 &AnimStartTime;
2019-09-11 20:43:18 -04:00
2019-10-18 18:23:40 -04:00
static void SaveOrRetrieveDataForThisFrame(void);
2019-09-11 20:43:18 -04:00
static void ProcessControlCars(void);
static void SaveOrRetrieveCarPositions(void);
2020-01-03 11:48:13 -05:00
static void StartChaseScene(float);
static void CleanUpChaseScene();
2020-02-16 15:08:54 -05:00
static void RemoveCarFromChase(int32);
static CVehicle* TurnChaseCarIntoScriptCar(int32);
2020-03-22 10:23:40 -04:00
static void Init(void);
2019-05-29 18:47:33 -04:00
};
2020-04-10 04:03:38 -04:00
struct tGameBuffer
{
float m_fTimeStep;
uint32 m_nTimeInMilliseconds;
uint8 m_nSizeOfPads[2];
uint16 m_nChecksum;
uint8 m_ControllerBuffer[116];
};
2019-09-11 20:43:18 -04:00
class CRecordDataForGame
2019-05-29 18:47:33 -04:00
{
2020-04-10 04:03:38 -04:00
enum {
STATE_NONE = 0,
STATE_RECORD = 1,
STATE_PLAYBACK = 2,
};
static uint16& RecordingState;
static uint8* &pDataBuffer;
static uint8* &pDataBufferPointer;
static int &FId;
static tGameBuffer &pDataBufferForFrame;
2019-05-29 18:47:33 -04:00
public:
2020-04-10 04:03:38 -04:00
static bool IsRecording() { return RecordingState == STATE_RECORD; }
static bool IsPlayingBack() { return RecordingState == STATE_PLAYBACK; }
2019-10-18 18:23:40 -04:00
static void SaveOrRetrieveDataForThisFrame(void);
2020-03-22 10:23:40 -04:00
static void Init(void);
2020-04-10 04:03:38 -04:00
private:
static uint16 CalcGameChecksum(void);
static uint8* PackCurrentPadValues(uint8*, CControllerState*, CControllerState*);
static uint8* UnPackCurrentPadValues(uint8*, uint8, CControllerState*);
2019-05-29 18:47:33 -04:00
};