11#include < StdInc.h>
2+ #include " ../game_sa/CAnimBlendSequenceSA.h"
23
34CIFPAnimations::CIFPAnimations ( void )
45{
@@ -13,30 +14,28 @@ CIFPAnimations::~CIFPAnimations ( void )
1314
1415void CIFPAnimations::DeleteAnimations ( void )
1516{
16- hCMemoryMgr_Free OLD_CMemoryMgr_Free = (hCMemoryMgr_Free)0x0072F430 ;
17- auto OLD_CAnimBlendHierarchy_RemoveFromUncompressedCache = (hCAnimBlendHierarchy_RemoveFromUncompressedCache)0x004D42A0 ;
18-
17+ CAnimManager * pAnimManager = g_pGame->GetAnimManager ( );
1918 for ( size_t i = 0 ; i < vecAnimations.size (); i++ )
2019 {
2120 IFP_Animation * ifpAnimation = &vecAnimations[i];
2221
23- OLD_CAnimBlendHierarchy_RemoveFromUncompressedCache ( ( int ) &ifpAnimation->Hierarchy );
24-
22+ pAnimManager-> RemoveFromUncompressedCache ( &ifpAnimation->Hierarchy );
23+
2524 for (unsigned short SequenceIndex = 0 ; SequenceIndex < ifpAnimation->Hierarchy .usNumSequences ; SequenceIndex++)
2625 {
27- _CAnimBlendSequence * pSequence = (_CAnimBlendSequence *)((BYTE*)ifpAnimation->Hierarchy .pSequences + (sizeof (_CAnimBlendSequence ) * SequenceIndex));
26+ auto pSequence = (CAnimBlendSequenceSAInterface *)((BYTE*)ifpAnimation->Hierarchy .pSequences + (sizeof (CAnimBlendSequenceSAInterface ) * SequenceIndex));
2827
29- if ( !( (pSequence->m_nFlags >> 3 ) & 1 ) ) // If ( !OneBigChunkForAllSequences )
28+ if ( !( (pSequence->sFlags >> 3 ) & 1 ) ) // If ( !OneBigChunkForAllSequences )
3029 {
31- OLD_CMemoryMgr_Free ( pSequence->m_pFrames ); // *(void **)(pThis + 8)); //pSequence->m_pFrames );
30+ pAnimManager-> FreeKeyFramesMemory ( pSequence->pKeyFrames ); // *(void **)(pThis + 8)); //pSequence->m_pFrames );
3231 }
3332 else
3433 {
3534 if ( SequenceIndex == 0 )
3635 {
3736 // All frames of all sequences are allocated on one memory block, so free that one
3837 // and break the loop
39- OLD_CMemoryMgr_Free ( pSequence->m_pFrames );
38+ pAnimManager-> FreeKeyFramesMemory ( pSequence->pKeyFrames );
4039 break ;
4140 }
4241 }
0 commit comments