diff options
author | erorcun <erayorcunus@gmail.com> | 2020-06-16 22:02:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 22:02:21 +0200 |
commit | d322a8033e07cf286891fdc165c7b77dfe6b762e (patch) | |
tree | 30a5d3a4181030ca731ae38f20df077a22b91e67 /src/animation | |
parent | Update ModelIndices.h (diff) | |
parent | fix crash-VC pickup scaling (diff) | |
download | re3-d322a8033e07cf286891fdc165c7b77dfe6b762e.tar re3-d322a8033e07cf286891fdc165c7b77dfe6b762e.tar.gz re3-d322a8033e07cf286891fdc165c7b77dfe6b762e.tar.bz2 re3-d322a8033e07cf286891fdc165c7b77dfe6b762e.tar.lz re3-d322a8033e07cf286891fdc165c7b77dfe6b762e.tar.xz re3-d322a8033e07cf286891fdc165c7b77dfe6b762e.tar.zst re3-d322a8033e07cf286891fdc165c7b77dfe6b762e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/animation/AnimationId.h | 1 | ||||
-rw-r--r-- | src/animation/CutsceneMgr.cpp | 25 | ||||
-rw-r--r-- | src/animation/CutsceneMgr.h | 3 |
3 files changed, 23 insertions, 6 deletions
diff --git a/src/animation/AnimationId.h b/src/animation/AnimationId.h index 9cf470e0..ddf36b23 100644 --- a/src/animation/AnimationId.h +++ b/src/animation/AnimationId.h @@ -233,6 +233,7 @@ enum AnimationId ANIM_MELEE_ATTACK = ANIM_WEAPON_FIRE, ANIM_MELEE_ATTACK_2ND, ANIM_MELEE_ATTACK_START, + ANIM_MELEE_IDLE_FIGHTMODE, ANIM_THROWABLE_THROW = ANIM_WEAPON_FIRE, ANIM_THROWABLE_THROWU, ANIM_THROWABLE_START_THROW, diff --git a/src/animation/CutsceneMgr.cpp b/src/animation/CutsceneMgr.cpp index 8f2a9892..5cd82f6c 100644 --- a/src/animation/CutsceneMgr.cpp +++ b/src/animation/CutsceneMgr.cpp @@ -123,6 +123,7 @@ char CCutsceneMgr::ms_cutsceneName[CUTSCENENAMESIZE]; CAnimBlendAssocGroup CCutsceneMgr::ms_cutsceneAssociations; CVector CCutsceneMgr::ms_cutsceneOffset; float CCutsceneMgr::ms_cutsceneTimer; +bool CCutsceneMgr::ms_wasCutsceneSkipped; uint32 CCutsceneMgr::ms_cutsceneLoadStatus; RpAtomic * @@ -145,6 +146,7 @@ CCutsceneMgr::Initialise(void) { ms_numCutsceneObjs = 0; ms_loaded = false; + ms_wasCutsceneSkipped = false; ms_running = false; ms_animLoaded = false; ms_cutsceneProcessing = false; @@ -169,9 +171,10 @@ CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName) CPlayerPed *pPlayerPed; ms_cutsceneProcessing = true; + ms_wasCutsceneSkipped = false; if (!strcasecmp(szCutsceneName, "jb")) ms_useLodMultiplier = true; - CTimer::Stop(); + CTimer::Suspend(); ms_pCutsceneDir->numEntries = 0; ms_pCutsceneDir->ReadDirFile("ANIM\\CUTS.DIR"); @@ -225,18 +228,19 @@ CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName) ms_cutsceneOffset = CVector(0.0f, 0.0f, 0.0f); pPlayerPed = FindPlayerPed(); - CTimer::Update(); - pPlayerPed->m_pWanted->ClearQdCrimes(); pPlayerPed->bIsVisible = false; pPlayerPed->m_fCurrentStamina = pPlayerPed->m_fMaxStamina; CPad::GetPad(0)->DisablePlayerControls |= PLAYERCONTROL_DISABLED_80; CWorld::Players[CWorld::PlayerInFocus].MakePlayerSafe(true); + + CTimer::Resume(); } void CCutsceneMgr::FinishCutscene() { + ms_wasCutsceneSkipped = true; CCutsceneMgr::ms_cutsceneTimer = TheCamera.GetCutSceneFinishTime() * 0.001f; TheCamera.FinishCutscene(); @@ -258,11 +262,14 @@ CCutsceneMgr::SetupCutsceneToStart(void) if (CAnimBlendAssociation *pAnimBlendAssoc = RpAnimBlendClumpGetFirstAssociation((RpClump*)ms_pCutsceneObjects[i]->m_rwObject)) { assert(pAnimBlendAssoc->hierarchy->sequences[0].HasTranslation()); ms_pCutsceneObjects[i]->SetPosition(ms_cutsceneOffset + ((KeyFrameTrans*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrame(0))->translation); - CWorld::Add(ms_pCutsceneObjects[i]); pAnimBlendAssoc->SetRun(); } else { ms_pCutsceneObjects[i]->SetPosition(ms_cutsceneOffset); } + CWorld::Add(ms_pCutsceneObjects[i]); + if (RwObjectGetType(ms_pCutsceneObjects[i]->m_rwObject) == rpCLUMP) { + ms_pCutsceneObjects[i]->UpdateRpHAnim(); + } } CTimer::Update(); @@ -289,6 +296,12 @@ CCutsceneMgr::SetCutsceneAnim(const char *animName, CObject *pObject) pAnimBlendClumpData->link.Prepend(&pNewAnim->link); } +void +CCutsceneMgr::SetCutsceneAnimToLoop(const char* animName) +{ + ms_cutsceneAssociations.GetAnimation(animName)->flags |= ASSOC_REPEAT; +} + CCutsceneHead * CCutsceneMgr::AddCutsceneHead(CObject *pObject, int modelId) { @@ -329,6 +342,7 @@ void CCutsceneMgr::DeleteCutsceneData(void) { if (!ms_loaded) return; + CTimer::Suspend(); ms_cutsceneProcessing = false; ms_useLodMultiplier = false; @@ -359,9 +373,8 @@ CCutsceneMgr::DeleteCutsceneData(void) if (CGeneral::faststricmp(ms_cutsceneName, "bet")) DMAudio.ChangeMusicMode(MUSICMODE_GAME); } - CTimer::Stop(); CGame::DrasticTidyUpMemory(TheCamera.GetScreenFadeStatus() == 2); - CTimer::Update(); + CTimer::Resume(); } void diff --git a/src/animation/CutsceneMgr.h b/src/animation/CutsceneMgr.h index 18eff0e5..97093fb1 100644 --- a/src/animation/CutsceneMgr.h +++ b/src/animation/CutsceneMgr.h @@ -21,6 +21,7 @@ class CCutsceneMgr static CAnimBlendAssocGroup ms_cutsceneAssociations; static CVector ms_cutsceneOffset; static float ms_cutsceneTimer; + static bool ms_wasCutsceneSkipped; static bool ms_cutsceneProcessing; public: static CDirectory *ms_pCutsceneDir; @@ -30,6 +31,7 @@ public: static bool IsRunning(void) { return ms_running; } static bool HasLoaded(void) { return ms_loaded; } static bool IsCutsceneProcessing(void) { return ms_cutsceneProcessing; } + static bool WasCutsceneSkipped(void) { return ms_wasCutsceneSkipped; } static bool UseLodMultiplier(void) { return ms_useLodMultiplier; } static CCutsceneObject* GetCutsceneObject(int id) { return ms_pCutsceneObjects[id]; } static int GetCutsceneTimeInMilleseconds(void) { return 1000.0f * ms_cutsceneTimer; } @@ -43,6 +45,7 @@ public: static void FinishCutscene(void); static void SetupCutsceneToStart(void); static void SetCutsceneAnim(const char *animName, CObject *pObject); + static void SetCutsceneAnimToLoop(const char *animName); static CCutsceneHead *AddCutsceneHead(CObject *pObject, int modelId); static CCutsceneObject *CreateCutsceneObject(int modelId); static void DeleteCutsceneData(void); |