Add GTA_REPLAY

# Conflicts:
#	src/control/Replay.cpp
#	src/control/Replay.h
This commit is contained in:
Sergeanur 2020-12-01 22:08:05 +02:00
parent 8de7072720
commit 24b5406a1d
4 changed files with 28 additions and 15 deletions

View File

@ -619,11 +619,11 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
m_pObject->GetMatrix().UpdateRW(); m_pObject->GetMatrix().UpdateRW();
m_pObject->UpdateRwFrame(); m_pObject->UpdateRwFrame();
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, 0) && waterLevel >= m_pObject->GetPosition().z) if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false) && waterLevel >= m_pObject->GetPosition().z)
m_eType = PICKUP_FLOATINGPACKAGE_FLOATING; m_eType = PICKUP_FLOATINGPACKAGE_FLOATING;
break; break;
case PICKUP_FLOATINGPACKAGE_FLOATING: case PICKUP_FLOATINGPACKAGE_FLOATING:
if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, 0)) if (CWaterLevel::GetWaterLevel(m_pObject->GetPosition().x, m_pObject->GetPosition().y, m_pObject->GetPosition().z + 5.0f, &waterLevel, false))
m_pObject->GetMatrix().GetPosition().z = waterLevel; m_pObject->GetMatrix().GetPosition().z = waterLevel;
m_pObject->GetMatrix().UpdateRW(); m_pObject->GetMatrix().UpdateRW();

View File

@ -1,5 +1,5 @@
#include "common.h" #include "common.h"
#ifdef GTA_REPLAY
#include "AnimBlendAssocGroup.h" #include "AnimBlendAssocGroup.h"
#include "AnimBlendAssociation.h" #include "AnimBlendAssociation.h"
#include "Bike.h" #include "Bike.h"
@ -1887,3 +1887,4 @@ void CReplay::Display()
if (Mode == MODE_PLAYBACK) if (Mode == MODE_PLAYBACK)
CFont::PrintString(SCREEN_SCALE_X(63.5f), SCREEN_SCALE_Y(30.0f), TheText.Get("REPLAY")); CFont::PrintString(SCREEN_SCALE_X(63.5f), SCREEN_SCALE_Y(30.0f), TheText.Get("REPLAY"));
} }
#endif

View File

@ -66,6 +66,12 @@ struct CStoredDetailedAnimationState
void PlayReplayFromHD(void); void PlayReplayFromHD(void);
#ifdef GTA_REPLAY
#define REPLAY_STUB
#else
#define REPLAY_STUB {}
#endif
class CReplay class CReplay
{ {
enum { enum {
@ -362,21 +368,25 @@ private:
#endif #endif
public: public:
static void Init(void); static void Init(void) REPLAY_STUB;
static void DisableReplays(void); static void DisableReplays(void) REPLAY_STUB;
static void EnableReplays(void); static void EnableReplays(void) REPLAY_STUB;
static void Update(void); static void Update(void) REPLAY_STUB;
static void FinishPlayback(void); static void FinishPlayback(void) REPLAY_STUB;
static void EmptyReplayBuffer(void); static void EmptyReplayBuffer(void) REPLAY_STUB;
static void Display(void); static void Display(void) REPLAY_STUB;
static void TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float cam_z, bool load_scene); static void TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float cam_z, bool load_scene) REPLAY_STUB;
static void StreamAllNecessaryCarsAndPeds(void); static void StreamAllNecessaryCarsAndPeds(void) REPLAY_STUB;
static bool ShouldStandardCameraBeProcessed(void); static void RecordParticle(tParticleType type, CVector const& vecPos, CVector const& vecDir, float fSize, RwRGBA const& color) REPLAY_STUB;
#ifndef GTA_REPLAY
static bool ShouldStandardCameraBeProcessed(void) { return true; }
static bool IsPlayingBack() { return false; }
static bool IsPlayingBackFromFile() { return false; }
#else
static bool ShouldStandardCameraBeProcessed(void);
static bool IsPlayingBack() { return Mode == MODE_PLAYBACK; } static bool IsPlayingBack() { return Mode == MODE_PLAYBACK; }
static bool IsPlayingBackFromFile() { return bPlayingBackFromFile; } static bool IsPlayingBackFromFile() { return bPlayingBackFromFile; }
static void RecordParticle(tParticleType type, CVector const& vecPos, CVector const& vecDir, float fSize, RwRGBA const& color);
private: private:
static void RecordThisFrame(void); static void RecordThisFrame(void);
static void StorePedUpdate(CPed *ped, int id); static void StorePedUpdate(CPed *ped, int id);
@ -407,4 +417,5 @@ private:
/* Absolute nonsense, but how could this function end up being outside of class? */ /* Absolute nonsense, but how could this function end up being outside of class? */
friend void PlayReplayFromHD(void); friend void PlayReplayFromHD(void);
#endif
}; };

View File

@ -195,6 +195,7 @@ enum Config {
# define RANDOMSPLASH // use random splash as on PS2 # define RANDOMSPLASH // use random splash as on PS2
# define PS2_MATFX # define PS2_MATFX
# endif # endif
# define GTA_REPLAY
#elif defined GTA_XBOX #elif defined GTA_XBOX
#endif #endif