summaryrefslogtreecommitdiffstats
path: root/src/control/Record.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-10 10:03:38 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-04-10 10:03:38 +0200
commit917fa80c18e83172040870d1a1cf613b51cf628c (patch)
tree8ccea8ca56da8062790571cced8d3609b367b6cb /src/control/Record.h
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-917fa80c18e83172040870d1a1cf613b51cf628c.tar
re3-917fa80c18e83172040870d1a1cf613b51cf628c.tar.gz
re3-917fa80c18e83172040870d1a1cf613b51cf628c.tar.bz2
re3-917fa80c18e83172040870d1a1cf613b51cf628c.tar.lz
re3-917fa80c18e83172040870d1a1cf613b51cf628c.tar.xz
re3-917fa80c18e83172040870d1a1cf613b51cf628c.tar.zst
re3-917fa80c18e83172040870d1a1cf613b51cf628c.zip
Diffstat (limited to 'src/control/Record.h')
-rw-r--r--src/control/Record.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/control/Record.h b/src/control/Record.h
index e52a623e..3cb09318 100644
--- a/src/control/Record.h
+++ b/src/control/Record.h
@@ -1,6 +1,8 @@
#pragma once
+class CAutomobile;
class CVehicle;
+class CControllerState;
enum {
RECORDSTATE_0,
@@ -10,8 +12,15 @@ enum {
class CRecordDataForChase
{
+ enum {
+ NUM_CHASE_CARS = 20
+ };
public:
static uint8 &Status;
+ static int &PositionChanges;
+ static uint8 &CurrentCar;
+ static CAutomobile*(&pChaseCars)[NUM_CHASE_CARS];
+ static uint32 &AnimStartTime;
static void SaveOrRetrieveDataForThisFrame(void);
static void ProcessControlCars(void);
@@ -23,12 +32,37 @@ public:
static void Init(void);
};
+struct tGameBuffer
+{
+ float m_fTimeStep;
+ uint32 m_nTimeInMilliseconds;
+ uint8 m_nSizeOfPads[2];
+ uint16 m_nChecksum;
+ uint8 m_ControllerBuffer[116];
+};
class CRecordDataForGame
{
+ 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;
+
public:
- static uint16 &RecordingState;
+ static bool IsRecording() { return RecordingState == STATE_RECORD; }
+ static bool IsPlayingBack() { return RecordingState == STATE_PLAYBACK; }
static void SaveOrRetrieveDataForThisFrame(void);
static void Init(void);
+
+private:
+ static uint16 CalcGameChecksum(void);
+ static uint8* PackCurrentPadValues(uint8*, CControllerState*, CControllerState*);
+ static uint8* UnPackCurrentPadValues(uint8*, uint8, CControllerState*);
};