From 9982f1f21bca3bb51ac7d31cede606beef5c0f67 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 18 Dec 2020 23:46:51 +0100 Subject: anim compression --- src/animation/CutsceneMgr.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/animation/CutsceneMgr.cpp') diff --git a/src/animation/CutsceneMgr.cpp b/src/animation/CutsceneMgr.cpp index 64951a87..b312236b 100644 --- a/src/animation/CutsceneMgr.cpp +++ b/src/animation/CutsceneMgr.cpp @@ -291,12 +291,15 @@ CCutsceneMgr::SetupCutsceneToStart(void) if (ms_pCutsceneObjects[i]->m_pAttachTo != nil) { pAnimBlendAssoc->flags &= (~ASSOC_HAS_TRANSLATION); } else { - KeyFrameTrans* keyFrames; - if (pAnimBlendAssoc->hierarchy->IsCompressed()) - keyFrames = ((KeyFrameTrans*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrameCompressed(0)); - else - keyFrames = ((KeyFrameTrans*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrame(0)); - ms_pCutsceneObjects[i]->SetPosition(ms_cutsceneOffset + keyFrames->translation); + if (pAnimBlendAssoc->hierarchy->IsCompressed()){ + KeyFrameTransCompressed *keyFrames = ((KeyFrameTransCompressed*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrameCompressed(0)); + CVector trans; + keyFrames->GetTranslation(&trans); + ms_pCutsceneObjects[i]->SetPosition(ms_cutsceneOffset + trans); + }else{ + KeyFrameTrans *keyFrames = ((KeyFrameTrans*)pAnimBlendAssoc->hierarchy->sequences[0].GetKeyFrame(0)); + ms_pCutsceneObjects[i]->SetPosition(ms_cutsceneOffset + keyFrames->translation); + } } pAnimBlendAssoc->SetRun(); } else { @@ -331,7 +334,7 @@ CCutsceneMgr::SetCutsceneAnim(const char *animName, CObject *pObject) } if (pNewAnim->hierarchy->IsCompressed()) - pNewAnim->hierarchy->compressed2 = true; + pNewAnim->hierarchy->keepCompressed = true; CStreaming::ImGonnaUseStreamingMemory(); pNewAnim = ms_cutsceneAssociations.CopyAnimation(animName); @@ -344,8 +347,8 @@ CCutsceneMgr::SetCutsceneAnim(const char *animName, CObject *pObject) pAnimBlendClumpData = *RPANIMBLENDCLUMPDATA(pObject->m_rwObject); pAnimBlendClumpData->link.Prepend(&pNewAnim->link); - if (pNewAnim->hierarchy->compressed2) - pAnimBlendClumpData->frames->flag |= AnimBlendFrameData::UNK_COMPRESSED; + if (pNewAnim->hierarchy->keepCompressed) + pAnimBlendClumpData->frames->flag |= AnimBlendFrameData::COMPRESSED; } void -- cgit v1.2.3