summaryrefslogtreecommitdiffstats
path: root/src/control/Replay.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-03-15 16:47:21 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-03-15 16:47:21 +0100
commit152d8c2f40e2f2df68ecc7f91304bd1edc8949ec (patch)
treedd66353353727318535835d92c83bfc7f29e4dc3 /src/control/Replay.h
parentmore utils (diff)
downloadre3-152d8c2f40e2f2df68ecc7f91304bd1edc8949ec.tar
re3-152d8c2f40e2f2df68ecc7f91304bd1edc8949ec.tar.gz
re3-152d8c2f40e2f2df68ecc7f91304bd1edc8949ec.tar.bz2
re3-152d8c2f40e2f2df68ecc7f91304bd1edc8949ec.tar.lz
re3-152d8c2f40e2f2df68ecc7f91304bd1edc8949ec.tar.xz
re3-152d8c2f40e2f2df68ecc7f91304bd1edc8949ec.tar.zst
re3-152d8c2f40e2f2df68ecc7f91304bd1edc8949ec.zip
Diffstat (limited to 'src/control/Replay.h')
-rw-r--r--src/control/Replay.h52
1 files changed, 38 insertions, 14 deletions
diff --git a/src/control/Replay.h b/src/control/Replay.h
index 6b11da75..cc652a11 100644
--- a/src/control/Replay.h
+++ b/src/control/Replay.h
@@ -10,6 +10,12 @@
#include "World.h"
#include "common.h"
+#ifdef FIX_BUGS
+#ifndef DONT_FIX_REPLAY_BUGS
+#define FIX_REPLAY_BUGS
+#endif
+#endif
+
struct CAddressInReplayBuffer
{
uint32 m_nOffset;
@@ -32,20 +38,31 @@ struct CStoredAnimationState
uint8 partBlendAmount;
};
+enum {
+ NUM_MAIN_ANIMS_IN_REPLAY = 3,
+ NUM_PARTIAL_ANIMS_IN_REPLAY = 6
+};
+
struct CStoredDetailedAnimationState
{
- uint8 aAnimId[3];
- uint8 aCurTime[3];
- uint8 aSpeed[3];
- uint8 aBlendAmount[3];
- uint8 aFunctionCallbackID[3];
- uint16 aFlags[3];
- uint8 aAnimId2[6];
- uint8 aCurTime2[6];
- uint8 aSpeed2[6];
- uint8 aBlendAmount2[6];
- uint8 aFunctionCallbackID2[6];
- uint16 aFlags2[6];
+ uint8 aAnimId[NUM_MAIN_ANIMS_IN_REPLAY];
+ uint8 aCurTime[NUM_MAIN_ANIMS_IN_REPLAY];
+ uint8 aSpeed[NUM_MAIN_ANIMS_IN_REPLAY];
+ uint8 aBlendAmount[NUM_MAIN_ANIMS_IN_REPLAY];
+#ifdef FIX_REPLAY_BUGS
+ int8 aBlendDelta[NUM_MAIN_ANIMS_IN_REPLAY];
+#endif
+ uint8 aFunctionCallbackID[NUM_MAIN_ANIMS_IN_REPLAY];
+ uint16 aFlags[NUM_MAIN_ANIMS_IN_REPLAY];
+ uint8 aAnimId2[NUM_PARTIAL_ANIMS_IN_REPLAY];
+ uint8 aCurTime2[NUM_PARTIAL_ANIMS_IN_REPLAY];
+ uint8 aSpeed2[NUM_PARTIAL_ANIMS_IN_REPLAY];
+ uint8 aBlendAmount2[NUM_PARTIAL_ANIMS_IN_REPLAY];
+#ifdef FIX_REPLAY_BUGS
+ int8 aBlendDelta2[NUM_PARTIAL_ANIMS_IN_REPLAY];
+#endif
+ uint8 aFunctionCallbackID2[NUM_PARTIAL_ANIMS_IN_REPLAY];
+ uint16 aFlags2[NUM_PARTIAL_ANIMS_IN_REPLAY];
};
void PlayReplayFromHD(void);
@@ -82,6 +99,11 @@ class CReplay
REPLAYBUFFER_RECORD = 2
};
+ enum {
+ NUM_REPLAYBUFFERS = 8,
+ REPLAYBUFFERSIZE = 100000
+ };
+
struct tGeneralPacket
{
@@ -209,8 +231,8 @@ private:
static CStoredDetailedAnimationState *&pPedAnims;
static uint8 *&pPickups;
static uint8 *&pReferences;
- static uint8 (&BufferStatus)[8];
- static uint8 (&Buffers)[8][100000];
+ static uint8 (&BufferStatus)[NUM_REPLAYBUFFERS];
+ static uint8 (&Buffers)[NUM_REPLAYBUFFERS][REPLAYBUFFERSIZE];
static bool &bPlayingBackFromFile;
static bool &bReplayEnabled;
static uint32 &SlowMotion;
@@ -274,6 +296,8 @@ private:
static void RetrievePedAnimation(CPed *ped, CStoredAnimationState *state);
static void RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state);
static void PlaybackThisFrame(void);
+ static void TriggerPlaybackLastCoupleOfSeconds(uint32, uint8, float, float, float, uint32);
+ static bool FastForwardToTime(uint32);
static void StoreCarUpdate(CVehicle *vehicle, int id);
static void ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressInReplayBuffer *buffer);
static bool PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, float interpolation, uint32 *pTimer);