diff options
author | erorcun <erayorcunus@gmail.com> | 2020-10-12 20:52:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 20:52:59 +0200 |
commit | 1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4 (patch) | |
tree | bb6768eda3c5916ecddd9806e830f992996af69d /src/control/Replay.cpp | |
parent | Streaming and cross-platform fixes (diff) | |
parent | sync with upstream (diff) | |
download | re3-1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4.tar re3-1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4.tar.gz re3-1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4.tar.bz2 re3-1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4.tar.lz re3-1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4.tar.xz re3-1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4.tar.zst re3-1e11c1eac67b969bf9e5fca3d9e2e7087454dcb4.zip |
Diffstat (limited to 'src/control/Replay.cpp')
-rw-r--r-- | src/control/Replay.cpp | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 0aec58bb..310d9686 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -53,6 +53,8 @@ #include "Fluff.h" #include "WaterCreatures.h" +//--MIAMI: file done except TODO + uint8 CReplay::Mode; CAddressInReplayBuffer CReplay::Record; CAddressInReplayBuffer CReplay::Playback; @@ -160,7 +162,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++){ @@ -171,13 +172,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)){ @@ -210,7 +209,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) { @@ -218,7 +216,6 @@ void PrintElementsInPtrList(void) } } -// --MIAMI: Done void CReplay::Init(void) { pBuf0 = nil; @@ -261,20 +258,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()) { @@ -309,7 +303,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); @@ -413,7 +406,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; @@ -426,7 +418,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)) @@ -449,7 +440,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]; @@ -469,7 +459,6 @@ void CReplay::StorePedUpdate(CPed *ped, int id) Record.m_nOffset += sizeof(tPedUpdatePacket); } -// --MIAMI: Done void CReplay::StorePedAnimation(CPed *ped, CStoredAnimationState *state) { CAnimBlendAssociation* second; @@ -515,7 +504,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++){ @@ -573,7 +561,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]; @@ -618,14 +605,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; @@ -669,7 +654,6 @@ void CReplay::RetrievePedAnimation(CPed *ped, CStoredAnimationState *state) } } -// --MIAMI: Done void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState *state) { CAnimBlendAssociation* assoc; @@ -715,7 +699,6 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt } } -// --MIAMI: Done void CReplay::PlaybackThisFrame(void) { static int FrameSloMo = 0; @@ -743,7 +726,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) @@ -755,7 +737,6 @@ void CReplay::TriggerPlaybackLastCoupleOfSeconds(uint32 start, uint8 cam_mode, f Mode = MODE_RECORD; } -// --MIAMI: Done bool CReplay::FastForwardToTime(uint32 start) { uint32 timer = 0; @@ -765,7 +746,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]; @@ -806,7 +786,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; @@ -832,7 +811,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]; @@ -906,7 +884,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; @@ -940,7 +917,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(); @@ -1197,7 +1173,6 @@ bool CReplay::PlayBackThisFrameInterpolation(CAddressInReplayBuffer *buffer, flo return false; } -// --MIAMI: Done void CReplay::FinishPlayback(void) { if (Mode != MODE_PLAYBACK) @@ -1220,7 +1195,6 @@ void CReplay::FinishPlayback(void) DMAudio.SetMusicFadeVol(127); } -// --MIAMI: Done void CReplay::EmptyReplayBuffer(void) { if (Mode == MODE_PLAYBACK) @@ -1236,7 +1210,6 @@ void CReplay::EmptyReplayBuffer(void) MarkEverythingAsNew(); } -// --MIAMI: Done void CReplay::ProcessReplayCamera(void) { switch (CameraMode) { @@ -1283,7 +1256,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) @@ -1343,7 +1315,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 @@ -1430,7 +1401,6 @@ void CReplay::StoreStuffInMem(void) CScriptPaths::Save_ForReplay(); } -// --MIAMI: Done void CReplay::RestoreStuffFromMem(void) { CPools::GetVehiclePool()->CopyBack(pBuf0, pBuf1); @@ -1655,7 +1625,6 @@ void CReplay::RestoreStuffFromMem(void) DMAudio.ChangeMusicMode(MUSICMODE_GAME); } -// --MIAMI: Done void CReplay::EmptyPedsAndVehiclePools(void) { int i = CPools::GetVehiclePool()->GetSize(); @@ -1676,7 +1645,6 @@ void CReplay::EmptyPedsAndVehiclePools(void) } } -// --MIAMI: Done void CReplay::EmptyAllPools(void) { EmptyPedsAndVehiclePools(); @@ -1698,7 +1666,6 @@ void CReplay::EmptyAllPools(void) } } -// --MIAMI: Done void CReplay::MarkEverythingAsNew(void) { int i = CPools::GetVehiclePool()->GetSize(); @@ -1748,7 +1715,6 @@ void CReplay::SaveReplayToHD(void) CFileMgr::SetDir(""); } -// --MIAMI: Done void PlayReplayFromHD(void) { CFileMgr::SetDirMyDocuments(); @@ -1781,7 +1747,6 @@ void PlayReplayFromHD(void) CReplay::StreamAllNecessaryCarsAndPeds(); } -// --MIAMI: Done void CReplay::StreamAllNecessaryCarsAndPeds(void) { for (int slot = 0; slot < NUM_REPLAYBUFFERS; slot++) { @@ -1806,7 +1771,6 @@ void CReplay::StreamAllNecessaryCarsAndPeds(void) CStreaming::LoadAllRequestedModels(false); } -// --MIAMI: Done void CReplay::FindFirstFocusCoordinate(CVector *coord) { *coord = CVector(0.0f, 0.0f, 0.0f); @@ -1822,7 +1786,6 @@ void CReplay::FindFirstFocusCoordinate(CVector *coord) } } -// --MIAMI: Done bool CReplay::ShouldStandardCameraBeProcessed(void) { if (Mode != MODE_PLAYBACK) @@ -1832,7 +1795,6 @@ bool CReplay::ShouldStandardCameraBeProcessed(void) return FindPlayerVehicle() != nil; } -// --MIAMI: Done void CReplay::ProcessLookAroundCam(void) { if (!bAllowLookAroundCam) @@ -1889,7 +1851,6 @@ void CReplay::ProcessLookAroundCam(void) RwFrameUpdateObjects(RwCameraGetFrame(TheCamera.m_pRwCamera)); } -// --MIAMI: Done size_t CReplay::FindSizeOfPacket(uint8 type) { switch (type) { @@ -1911,7 +1872,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; |