Skip to content

Commit d5e33c4

Browse files
committed
Added functions for CAnimBlendSequence and SA
1 parent cc5b9ed commit d5e33c4

File tree

2 files changed

+70
-5
lines changed

2 files changed

+70
-5
lines changed

Client/game_sa/CAnimBlendSequenceSA.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,50 @@
1111
*****************************************************************************/
1212

1313
#include "StdInc.h"
14+
15+
void CAnimBlendSequenceSA::Initialize ( void )
16+
{
17+
m_pInterface->m_boneId = -1;
18+
m_pInterface->sFlags = 0;
19+
m_pInterface->sNumKeyFrames = 0;
20+
m_pInterface->pKeyFrames = 0;
21+
}
22+
23+
void CAnimBlendSequenceSA::SetName ( const char * szName )
24+
{
25+
DWORD dwThis = ( DWORD ) m_pInterface;
26+
DWORD dwFunc = FUNC_CAnimBlendSequence_SetName;
27+
_asm
28+
{
29+
push szName
30+
mov ecx, dwThis
31+
call dwFunc
32+
}
33+
}
34+
35+
void CAnimBlendSequenceSA::SetBoneTag ( int32_t i32BoneID )
36+
{
37+
DWORD dwThis = ( DWORD ) m_pInterface;
38+
DWORD dwFunc = FUNC_CAnimBlendSequence_SetBoneTag;
39+
_asm
40+
{
41+
push i32BoneID
42+
mov ecx, dwThis
43+
call dwFunc
44+
}
45+
}
46+
47+
void CAnimBlendSequenceSA::SetKeyFrames ( size_t cKeyFrames, bool bRoot, bool bCompressed, void * pKeyFrames )
48+
{
49+
DWORD dwThis = ( DWORD ) m_pInterface;
50+
DWORD dwFunc = FUNC_CAnimBlendSequence_SetKeyFrames;
51+
_asm
52+
{
53+
push pKeyFrames
54+
push bCompressed
55+
push bRoot
56+
push cKeyFrames
57+
mov ecx, dwThis
58+
call dwFunc
59+
}
60+
}

Client/game_sa/CAnimBlendSequenceSA.h

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,37 @@
1515

1616
#include <game/CAnimBlendSequence.h>
1717

18+
#define FUNC_CAnimBlendSequence_SetName 0x4D0C50
19+
#define FUNC_CAnimBlendSequence_SetBoneTag 0x4D0C70
20+
#define FUNC_CAnimBlendSequence_SetKeyFrames 0x4D0CD0
21+
1822
class CAnimBlendSequenceSAInterface
1923
{
2024
public:
21-
unsigned int iHashKey; // Get/SetBoneTag accesses the first? 2 bytes here
22-
short sFlags; // 4 // or16=bHasBoneTag
23-
short sNumKeyFrames; // 6
24-
class CAnimBlendKeyFrame * pKeyFrames; // ?
25+
union
26+
{
27+
uint16_t m_boneId; // m_boneId is set if ( sFlags & 0x10u ) is true
28+
uint32_t m_hash; // otherwise m_hash is set
29+
};
30+
unsigned short sFlags;
31+
unsigned short sNumKeyFrames;
32+
void * pKeyFrames;
2533
};
2634

2735
class CAnimBlendSequenceSA : public CAnimBlendSequence
2836
{
2937
public:
30-
CAnimBlendSequenceSA ( CAnimBlendSequenceSAInterface * pInterface ) { m_pInterface = pInterface; }
38+
CAnimBlendSequenceSA ( CAnimBlendSequenceSAInterface * pInterface ) { m_pInterface = pInterface; }
39+
~CAnimBlendSequenceSA ( void ) { }
40+
void Initialize ( void );
41+
void SetName ( const char * szName );
42+
void SetBoneTag ( int32_t i32BoneID );
43+
void SetKeyFrames ( size_t cKeyFrames, bool bRoot, bool bCompressed, void * pKeyFrames );
44+
uint32_t GetHash ( void ) { return m_pInterface->m_hash; }
45+
uint16_t GetBoneTag ( void ) { return m_pInterface->m_boneId; }
46+
void * GetKeyFrames ( void ) { return m_pInterface->pKeyFrames; }
47+
unsigned short GetKeyFramesCount ( void ) { return m_pInterface->sNumKeyFrames; }
48+
CAnimBlendSequenceSAInterface * GetInterface ( void ) { return m_pInterface; }
3149

3250
protected:
3351
CAnimBlendSequenceSAInterface * m_pInterface;

0 commit comments

Comments
 (0)