summaryrefslogtreecommitdiffstats
path: root/src/control/Replay.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-10-11 11:56:33 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-10-11 11:56:33 +0200
commitc4d48213273aad8d1c076ea44238dd65c75d9961 (patch)
tree896772adf77ae80553b9c31b281e234eca10e62a /src/control/Replay.cpp
parentFix sniper and water creatures bug, mark some files (diff)
downloadre3-c4d48213273aad8d1c076ea44238dd65c75d9961.tar
re3-c4d48213273aad8d1c076ea44238dd65c75d9961.tar.gz
re3-c4d48213273aad8d1c076ea44238dd65c75d9961.tar.bz2
re3-c4d48213273aad8d1c076ea44238dd65c75d9961.tar.lz
re3-c4d48213273aad8d1c076ea44238dd65c75d9961.tar.xz
re3-c4d48213273aad8d1c076ea44238dd65c75d9961.tar.zst
re3-c4d48213273aad8d1c076ea44238dd65c75d9961.zip
Diffstat (limited to '')
-rw-r--r--src/control/Replay.cpp44
1 files changed, 2 insertions, 42 deletions
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index 45f1a143..838967e8 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -52,6 +52,8 @@
#include "Radar.h"
#include "Fluff.h"
+//--MIAMI: file done except TODO
+
uint8 CReplay::Mode;
CAddressInReplayBuffer CReplay::Record;
CAddressInReplayBuffer CReplay::Playback;
@@ -159,7 +161,6 @@ static void(*CBArray[])(CAnimBlendAssociation*, void*) =
&CPed::PedAnimShuffleCB, &CPed::DeleteSunbatheIdleAnimCB, &StartTalkingOnMobileCB, &FinishTalkingOnMobileCB
};
-// --MIAMI: Done
static uint8 FindCBFunctionID(void(*f)(CAnimBlendAssociation*, void*))
{
for (int i = 0; i < sizeof(CBArray) / sizeof(*CBArray); i++){
@@ -170,13 +171,11 @@ static uint8 FindCBFunctionID(void(*f)(CAnimBlendAssociation*, void*))
return 0;
}
-// --MIAMI: Done
static void(*FindCBFunction(uint8 id))(CAnimBlendAssociation*, void*)
{
return CBArray[id];
}
-// --MIAMI: Done
static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flying)
{
if(vehicle->Damage.GetPanelStatus(VEHPANEL_FRONT_LEFT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_LEFT)){
@@ -209,7 +208,6 @@ static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flyi
}
}
-// --MIAMI: Done
void PrintElementsInPtrList(void)
{
for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_GENERIC).first; node; node = node->next) {
@@ -217,7 +215,6 @@ void PrintElementsInPtrList(void)
}
}
-// --MIAMI: Done
void CReplay::Init(void)
{
pBuf0 = nil;
@@ -260,20 +257,17 @@ void CReplay::Init(void)
MarkEverythingAsNew();
}
-// --MIAMI: Done
void CReplay::DisableReplays(void)
{
bReplayEnabled = false;
}
-// --MIAMI: Done
void CReplay::EnableReplays(void)
{
bReplayEnabled = true;
}
void PlayReplayFromHD(void);
-// --MIAMI: Done
void CReplay::Update(void)
{
if (CCutsceneMgr::IsCutsceneProcessing() || CPad::GetPad(0)->ArePlayerControlsDisabled() || CScriptPaths::IsOneActive() || FrontEndMenuManager.GetIsMenuActive()) {
@@ -308,7 +302,6 @@ void CReplay::Update(void)
}
}
-// --MIAMI: Done except TODO
void CReplay::RecordThisFrame(void)
{
uint32 memory_required = sizeof(tGeneralPacket) + sizeof(tClockPacket) + sizeof(tWeatherPacket) + sizeof(tTimerPacket) + sizeof(tMiscPacket);
@@ -412,7 +405,6 @@ void CReplay::RecordThisFrame(void)
Record.m_pBase[Record.m_nOffset] = REPLAYPACKET_END;
}
-// --MIAMI: Done
void CReplay::GoToNextBlock(void)
{
Record.m_pBase[Record.m_nOffset] = REPLAYPACKET_END;
@@ -425,7 +417,6 @@ void CReplay::GoToNextBlock(void)
MarkEverythingAsNew();
}
-// --MIAMI: Done
void CReplay::RecordParticle(tParticleType type, const CVector& vecPos, const CVector& vecDir, float fSize, const RwRGBA& color)
{
if (Record.m_nOffset > REPLAYBUFFERSIZE - 16 - sizeof(tParticlePacket))
@@ -448,7 +439,6 @@ void CReplay::RecordParticle(tParticleType type, const CVector& vecPos, const CV
Record.m_pBase[Record.m_nOffset] = REPLAYPACKET_END;
}
-// --MIAMI: Done
void CReplay::StorePedUpdate(CPed *ped, int id)
{
tPedUpdatePacket* pp = (tPedUpdatePacket*)&Record.m_pBase[Record.m_nOffset];
@@ -468,7 +458,6 @@ void CReplay::StorePedUpdate(CPed *ped, int id)
Record.m_nOffset += sizeof(tPedUpdatePacket);
}
-// --MIAMI: Done
void CReplay::StorePedAnimation(CPed *ped, CStoredAnimationState *state)
{
CAnimBlendAssociation* second;
@@ -514,7 +503,6 @@ void CReplay::StorePedAnimation(CPed *ped, CStoredAnimationState *state)
}
}
-// --MIAMI: Done
void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state)
{
for (int i = 0; i < NUM_MAIN_ANIMS_IN_REPLAY; i++){
@@ -572,7 +560,6 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState
}
}
-// --MIAMI: Done
void CReplay::ProcessPedUpdate(CPed *ped, float interpolation, CAddressInReplayBuffer *buffer)
{
tPedUpdatePacket *pp = (tPedUpdatePacket*)&buffer->m_pBase[buffer->m_nOffset];
@@ -617,14 +604,12 @@ void CReplay::ProcessPedUpdate(CPed *ped, float interpolation, CAddressInReplayB
buffer->m_nOffset += sizeof(tPedUpdatePacket);
}
-// --MIAMI: Done
bool HasAnimGroupLoaded(uint8 group)
{
CAnimBlendAssocGroup* pGroup = &CAnimManager::GetAnimAssocGroups()[group];
return pGroup->animBlock && pGroup->animBlock->isLoaded;
}
-// --MIAMI: Done
void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state)
{
CAnimBlendAssociation* anim1;
@@ -668,7 +653,6 @@ void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state)
}
}
-// --MIAMI: Done
void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state)
{
CAnimBlendAssociation* assoc;
@@ -714,7 +698,6 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt
}
}
-// --MIAMI: Done
void CReplay::PlaybackThisFrame(void)
{
static int FrameSloMo = 0;
@@ -742,7 +725,6 @@ void CReplay::PlaybackThisFrame(void)
// next two functions are only found in mobile version
// most likely they were optimized out for being unused
-// --MIAMI: Done
void CReplay::TriggerPlaybackLastCoupleOfSeconds(uint32 start, uint8 cam_mode, float cam_x, float cam_y, float cam_z, uint32 slomo)
{
if (Mode != MODE_RECORD)
@@ -754,7 +736,6 @@ void CReplay::TriggerPlaybackLastCoupleOfSeconds(uint32 start, uint8 cam_mode, f
Mode = MODE_RECORD;
}
-// --MIAMI: Done
bool CReplay::FastForwardToTime(uint32 start)
{
uint32 timer = 0;
@@ -764,7 +745,6 @@ bool CReplay::FastForwardToTime(uint32 start)
return true;
}
-// --MIAMI: Done
void CReplay::StoreCarUpdate(CVehicle *vehicle, int id)
{
tVehicleUpdatePacket* vp = (tVehicleUpdatePacket*)&Record.m_pBase[Record.m_nOffset];
@@ -805,7 +785,6 @@ void CReplay::StoreCarUpdate(CVehicle *vehicle, int id)
Record.m_nOffset += sizeof(tVehicleUpdatePacket);
}
-// --MIAMI: Done
void CReplay::StoreBikeUpdate(CVehicle* vehicle, int id)
{
CBike* bike = (CBike*)vehicle;
@@ -831,7 +810,6 @@ void CReplay::StoreBikeUpdate(CVehicle* vehicle, int id)
Record.m_nOffset += sizeof(tBikeUpdatePacket);
}
-// --MIAMI: Done
void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressInReplayBuffer *buffer)
{
tVehicleUpdatePacket* vp = (tVehicleUpdatePacket*)&buffer->m_pBase[buffer->m_nOffset];
@@ -905,7 +883,6 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI
((CBoat*)vehicle)->m_fMovingSpeed = vp->skimmer_speed / 50.0f;
}
-// --MIAMI: Done
void CReplay::ProcessBikeUpdate(CVehicle* vehicle, float interpolation, CAddressInReplayBuffer* buffer)
{
CBike* bike = (CBike*)vehicle;
@@ -939,7 +916,6 @@ void CReplay::ProcessBikeUpdate(CVehicle* vehicle, float interpolation, CAddress
CWorld::Add(vehicle);
}
-// --MIAMI: Done
bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, float interpolation, uint32 *pTimer)
{
CBulletTraces::Init();
@@ -1196,7 +1172,6 @@ bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, flo
return false;
}
-// --MIAMI: Done
void CReplay::FinishPlayback(void)
{
if (Mode != MODE_PLAYBACK)
@@ -1219,7 +1194,6 @@ void CReplay::FinishPlayback(void)
DMAudio.SetMusicFadeVol(127);
}
-// --MIAMI: Done
void CReplay::EmptyReplayBuffer(void)
{
if (Mode == MODE_PLAYBACK)
@@ -1235,7 +1209,6 @@ void CReplay::EmptyReplayBuffer(void)
MarkEverythingAsNew();
}
-// --MIAMI: Done
void CReplay::ProcessReplayCamera(void)
{
switch (CameraMode) {
@@ -1282,7 +1255,6 @@ void CReplay::ProcessReplayCamera(void)
extern CWeaponEffects gCrossHair;
-// --MIAMI: Done except TODO
void CReplay::TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float cam_z, bool load_scene)
{
if (Mode != MODE_RECORD)
@@ -1342,7 +1314,6 @@ void CReplay::TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float ca
CDraw::SetFOV(70.0f);
}
-// --MIAMI: Done
void CReplay::StoreStuffInMem(void)
{
#ifdef FIX_BUGS
@@ -1429,7 +1400,6 @@ void CReplay::StoreStuffInMem(void)
CScriptPaths::Save_ForReplay();
}
-// --MIAMI: Done
void CReplay::RestoreStuffFromMem(void)
{
CPools::GetVehiclePool()->CopyBack(pBuf0, pBuf1);
@@ -1654,7 +1624,6 @@ void CReplay::RestoreStuffFromMem(void)
DMAudio.ChangeMusicMode(MUSICMODE_GAME);
}
-// --MIAMI: Done
void CReplay::EmptyPedsAndVehiclePools(void)
{
int i = CPools::GetVehiclePool()->GetSize();
@@ -1675,7 +1644,6 @@ void CReplay::EmptyPedsAndVehiclePools(void)
}
}
-// --MIAMI: Done
void CReplay::EmptyAllPools(void)
{
EmptyPedsAndVehiclePools();
@@ -1697,7 +1665,6 @@ void CReplay::EmptyAllPools(void)
}
}
-// --MIAMI: Done
void CReplay::MarkEverythingAsNew(void)
{
int i = CPools::GetVehiclePool()->GetSize();
@@ -1747,7 +1714,6 @@ void CReplay::SaveReplayToHD(void)
CFileMgr::SetDir("");
}
-// --MIAMI: Done
void PlayReplayFromHD(void)
{
CFileMgr::SetDirMyDocuments();
@@ -1780,7 +1746,6 @@ void PlayReplayFromHD(void)
CReplay::StreamAllNecessaryCarsAndPeds();
}
-// --MIAMI: Done
void CReplay::StreamAllNecessaryCarsAndPeds(void)
{
for (int slot = 0; slot < NUM_REPLAYBUFFERS; slot++) {
@@ -1805,7 +1770,6 @@ void CReplay::StreamAllNecessaryCarsAndPeds(void)
CStreaming::LoadAllRequestedModels(false);
}
-// --MIAMI: Done
void CReplay::FindFirstFocusCoordinate(CVector *coord)
{
*coord = CVector(0.0f, 0.0f, 0.0f);
@@ -1821,7 +1785,6 @@ void CReplay::FindFirstFocusCoordinate(CVector *coord)
}
}
-// --MIAMI: Done
bool CReplay::ShouldStandardCameraBeProcessed(void)
{
if (Mode != MODE_PLAYBACK)
@@ -1831,7 +1794,6 @@ bool CReplay::ShouldStandardCameraBeProcessed(void)
return FindPlayerVehicle() != nil;
}
-// --MIAMI: Done
void CReplay::ProcessLookAroundCam(void)
{
if (!bAllowLookAroundCam)
@@ -1888,7 +1850,6 @@ void CReplay::ProcessLookAroundCam(void)
RwFrameUpdateObjects(RwCameraGetFrame(TheCamera.m_pRwCamera));
}
-// --MIAMI: Done
size_t CReplay::FindSizeOfPacket(uint8 type)
{
switch (type) {
@@ -1910,7 +1871,6 @@ size_t CReplay::FindSizeOfPacket(uint8 type)
return 0;
}
-// --MIAMI: Done (function didn't change since III and we already had it modified)
void CReplay::Display()
{
static int TimeCount = 0;