1
1
#include < StdInc.h>
2
+ #include " ../game_sa/CAnimBlendSequenceSA.h"
2
3
3
4
CIFPAnimations::CIFPAnimations ( void )
4
5
{
@@ -13,30 +14,28 @@ CIFPAnimations::~CIFPAnimations ( void )
13
14
14
15
void CIFPAnimations::DeleteAnimations ( void )
15
16
{
16
- hCMemoryMgr_Free OLD_CMemoryMgr_Free = (hCMemoryMgr_Free)0x0072F430 ;
17
- auto OLD_CAnimBlendHierarchy_RemoveFromUncompressedCache = (hCAnimBlendHierarchy_RemoveFromUncompressedCache)0x004D42A0 ;
18
-
17
+ CAnimManager * pAnimManager = g_pGame->GetAnimManager ( );
19
18
for ( size_t i = 0 ; i < vecAnimations.size (); i++ )
20
19
{
21
20
IFP_Animation * ifpAnimation = &vecAnimations[i];
22
21
23
- OLD_CAnimBlendHierarchy_RemoveFromUncompressedCache ( ( int ) &ifpAnimation->Hierarchy );
24
-
22
+ pAnimManager-> RemoveFromUncompressedCache ( &ifpAnimation->Hierarchy );
23
+
25
24
for (unsigned short SequenceIndex = 0 ; SequenceIndex < ifpAnimation->Hierarchy .usNumSequences ; SequenceIndex++)
26
25
{
27
- _CAnimBlendSequence * pSequence = (_CAnimBlendSequence *)((BYTE*)ifpAnimation->Hierarchy .pSequences + (sizeof (_CAnimBlendSequence ) * SequenceIndex));
26
+ auto pSequence = (CAnimBlendSequenceSAInterface *)((BYTE*)ifpAnimation->Hierarchy .pSequences + (sizeof (CAnimBlendSequenceSAInterface ) * SequenceIndex));
28
27
29
- if ( !( (pSequence->m_nFlags >> 3 ) & 1 ) ) // If ( !OneBigChunkForAllSequences )
28
+ if ( !( (pSequence->sFlags >> 3 ) & 1 ) ) // If ( !OneBigChunkForAllSequences )
30
29
{
31
- OLD_CMemoryMgr_Free ( pSequence->m_pFrames ); // *(void **)(pThis + 8)); //pSequence->m_pFrames );
30
+ pAnimManager-> FreeKeyFramesMemory ( pSequence->pKeyFrames ); // *(void **)(pThis + 8)); //pSequence->m_pFrames );
32
31
}
33
32
else
34
33
{
35
34
if ( SequenceIndex == 0 )
36
35
{
37
36
// All frames of all sequences are allocated on one memory block, so free that one
38
37
// and break the loop
39
- OLD_CMemoryMgr_Free ( pSequence->m_pFrames );
38
+ pAnimManager-> FreeKeyFramesMemory ( pSequence->pKeyFrames );
40
39
break ;
41
40
}
42
41
}
0 commit comments