Skip to content

Commit 9a6f6ae

Browse files
committed
Merge branch 'test_custom_ifp_animations'
# Conflicts: # Client/game_sa/CAnimBlendAssocGroupSA.cpp # Client/game_sa/CAnimBlendAssocGroupSA.h # Client/game_sa/CAnimBlendHierarchySA.cpp # Client/game_sa/CAnimBlendHierarchySA.h # Client/game_sa/CAnimBlendSequenceSA.h # Client/game_sa/CAnimBlendStaticAssociationSA.cpp # Client/game_sa/CAnimBlendStaticAssociationSA.h # Client/game_sa/CAnimBlockSA.h # Client/game_sa/CAnimManagerSA.cpp # Client/game_sa/CAnimManagerSA.h # Client/mods/deathmatch/logic/CClientGame.cpp # Client/mods/deathmatch/logic/CClientGame.h # Client/mods/deathmatch/logic/CClientPed.cpp # Client/mods/deathmatch/logic/CClientPed.h # Client/mods/deathmatch/logic/CElementDeleter.cpp # Client/mods/deathmatch/logic/CElementDeleter.h # Client/mods/deathmatch/logic/CResource.cpp # Client/mods/deathmatch/logic/CResource.h # Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp # Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h # Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp # Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.h # Client/multiplayer_sa/CMultiplayerSA.cpp # Client/multiplayer_sa/CMultiplayerSA.h # Client/multiplayer_sa/CMultiplayerSA_FixBadAnimId.cpp # Client/sdk/game/CAnimBlendAssocGroup.h # Client/sdk/game/CAnimBlendHierarchy.h # Client/sdk/game/CAnimBlock.h # Client/sdk/game/CAnimManager.h # Client/sdk/game/CGame.h # Client/sdk/multiplayer/CMultiplayer.h
2 parents e29b13a + d7649ba commit 9a6f6ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+17518
-13827
lines changed
Lines changed: 59 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11
/*****************************************************************************
2-
*
3-
* PROJECT: Multi Theft Auto v1.0
4-
* LICENSE: See LICENSE in the top level directory
5-
* FILE: game_sa/CAnimBlendAssocGroupSA.cpp
6-
* PURPOSE: Animation blend association group
7-
*
8-
* Multi Theft Auto is available from http://www.multitheftauto.com/
9-
*
10-
*****************************************************************************/
2+
*
3+
* PROJECT: Multi Theft Auto v1.0
4+
* LICENSE: See LICENSE in the top level directory
5+
* FILE: game_sa/CAnimBlendAssocGroupSA.cpp
6+
* PURPOSE: Animation blend association group
7+
* DEVELOPERS: Jax <>
8+
*
9+
* Multi Theft Auto is available from http://www.multitheftauto.com/
10+
*
11+
*****************************************************************************/
1112

1213
#include "StdInc.h"
1314

14-
CAnimBlendAssocGroupSA::CAnimBlendAssocGroupSA(CAnimBlendAssocGroupSAInterface* pInterface)
15+
CAnimBlendAssocGroupSA::CAnimBlendAssocGroupSA ( CAnimBlendAssocGroupSAInterface * pInterface )
1516
{
1617
m_pInterface = pInterface;
1718
m_pAnimBlock = NULL;
18-
SetupAnimBlock();
19+
SetupAnimBlock ();
1920
}
2021

21-
void CAnimBlendAssocGroupSA::InitEmptyAssociations(RpClump* pClump)
22+
CAnimBlendAssociationSAInterface * CAnimBlendAssocGroupSA::CopyAnimation ( unsigned int AnimID )
2223
{
23-
DWORD dwThis = (DWORD)m_pInterface;
24+
CAnimBlendAssociationSAInterface * pAnimAssociationReturn = nullptr;
25+
26+
DWORD dwThis = ( DWORD ) m_pInterface;
27+
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_CopyAnimation;
28+
_asm
29+
{
30+
mov ecx, dwThis
31+
push AnimID
32+
call dwFunc
33+
mov pAnimAssociationReturn, eax
34+
}
35+
return pAnimAssociationReturn;
36+
}
37+
38+
void CAnimBlendAssocGroupSA::InitEmptyAssociations ( RpClump * pClump )
39+
{
40+
DWORD dwThis = ( DWORD ) m_pInterface;
2441
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_InitEmptyAssociations;
2542
_asm
2643
{
@@ -30,10 +47,10 @@ void CAnimBlendAssocGroupSA::InitEmptyAssociations(RpClump* pClump)
3047
}
3148
}
3249

33-
bool CAnimBlendAssocGroupSA::IsCreated(void)
50+
bool CAnimBlendAssocGroupSA::IsCreated ( void )
3451
{
35-
bool bReturn;
36-
DWORD dwThis = (DWORD)m_pInterface;
52+
bool bReturn;
53+
DWORD dwThis = ( DWORD ) m_pInterface;
3754
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_IsCreated;
3855
_asm
3956
{
@@ -44,10 +61,11 @@ bool CAnimBlendAssocGroupSA::IsCreated(void)
4461
return bReturn;
4562
}
4663

47-
int CAnimBlendAssocGroupSA::GetNumAnimations(void)
64+
65+
int CAnimBlendAssocGroupSA::GetNumAnimations ( void )
4866
{
49-
int iReturn;
50-
DWORD dwThis = (DWORD)m_pInterface;
67+
int iReturn;
68+
DWORD dwThis = ( DWORD ) m_pInterface;
5169
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_GetNumAnimations;
5270
_asm
5371
{
@@ -58,21 +76,23 @@ int CAnimBlendAssocGroupSA::GetNumAnimations(void)
5876
return iReturn;
5977
}
6078

61-
CAnimBlock* CAnimBlendAssocGroupSA::GetAnimBlock(void)
79+
80+
CAnimBlock * CAnimBlendAssocGroupSA::GetAnimBlock ( void )
6281
{
63-
SetupAnimBlock();
82+
SetupAnimBlock ();
6483

6584
return m_pAnimBlock;
6685
}
6786

68-
CAnimBlendStaticAssociation* CAnimBlendAssocGroupSA::GetAnimation(unsigned int ID)
87+
88+
CAnimBlendStaticAssociation * CAnimBlendAssocGroupSA::GetAnimation ( unsigned int ID )
6989
{
7090
// ppAssociations [ ID - this->iIDOffset ] ??
71-
CAnimBlendStaticAssociation* pReturn;
72-
DWORD dwThis = (DWORD)m_pInterface;
73-
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_GetAnimation;
91+
CAnimBlendStaticAssociation * pReturn;
92+
DWORD dwThis = ( DWORD ) m_pInterface;
93+
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_GetAnimation;
7494
_asm
75-
{
95+
{
7696
mov ecx, dwThis
7797
push ID
7898
call dwFunc
@@ -81,18 +101,20 @@ CAnimBlendStaticAssociation* CAnimBlendAssocGroupSA::GetAnimation(unsigned int I
81101
return pReturn;
82102
}
83103

84-
bool CAnimBlendAssocGroupSA::IsLoaded(void)
104+
105+
bool CAnimBlendAssocGroupSA::IsLoaded ( void )
85106
{
86-
if (m_pInterface->pAnimBlock)
107+
if ( m_pInterface->pAnimBlock )
87108
{
88109
return m_pInterface->pAnimBlock->bLoaded;
89110
}
90111
return false;
91112
}
92113

93-
void CAnimBlendAssocGroupSA::CreateAssociations(const char* szBlockName)
114+
115+
void CAnimBlendAssocGroupSA::CreateAssociations ( const char * szBlockName )
94116
{
95-
DWORD dwThis = (DWORD)m_pInterface;
117+
DWORD dwThis = ( DWORD ) m_pInterface;
96118
DWORD dwFunc = FUNC_CAnimBlendAssocGroup_CreateAssociations;
97119
_asm
98120
{
@@ -102,19 +124,19 @@ void CAnimBlendAssocGroupSA::CreateAssociations(const char* szBlockName)
102124
}
103125
}
104126

105-
void CAnimBlendAssocGroupSA::SetupAnimBlock(void)
127+
128+
void CAnimBlendAssocGroupSA::SetupAnimBlock ( void )
106129
{
107130
// Make sure our AnimBlock matches up with our interface's
108-
CAnimBlockSAInterface* pCurrent = (m_pAnimBlock) ? m_pAnimBlock->m_pInterface : NULL;
109-
CAnimBlockSAInterface* pActual = m_pInterface->pAnimBlock;
110-
if (pCurrent != pActual)
131+
CAnimBlockSAInterface * pCurrent = ( m_pAnimBlock ) ? m_pAnimBlock->m_pInterface : NULL;
132+
CAnimBlockSAInterface * pActual = m_pInterface->pAnimBlock;
133+
if ( pCurrent != pActual )
111134
{
112-
if (m_pAnimBlock)
135+
if ( m_pAnimBlock )
113136
{
114137
delete m_pAnimBlock;
115138
m_pAnimBlock = NULL;
116139
}
117-
if (pActual)
118-
m_pAnimBlock = new CAnimBlockSA(pActual);
140+
if ( pActual ) m_pAnimBlock = new CAnimBlockSA ( pActual );
119141
}
120142
}
Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/*****************************************************************************
2-
*
3-
* PROJECT: Multi Theft Auto v1.0
4-
* LICENSE: See LICENSE in the top level directory
5-
* FILE: game_sa/CAnimBlendAssocGroupSA.h
6-
* PURPOSE: Header file for animation blend association group class
7-
*
8-
* Multi Theft Auto is available from http://www.multitheftauto.com/
9-
*
10-
*****************************************************************************/
2+
*
3+
* PROJECT: Multi Theft Auto v1.0
4+
* LICENSE: See LICENSE in the top level directory
5+
* FILE: game_sa/CAnimBlendAssocGroupSA.h
6+
* PURPOSE: Header file for animation blend association group class
7+
* DEVELOPERS: Jax <>
8+
*
9+
* Multi Theft Auto is available from http://www.multitheftauto.com/
10+
*
11+
*****************************************************************************/
1112

1213
#ifndef __CAnimBlendAssocGroupSA_H
1314
#define __CAnimBlendAssocGroupSA_H
@@ -17,6 +18,7 @@
1718
#include "Common.h"
1819

1920
#define FUNC_CAnimBlendAssocGroup_InitEmptyAssociations 0x4cdfb0
21+
#define FUNC_CAnimBlendAssocGroup_CopyAnimation 0x4ce130
2022
#define FUNC_CAnimBlendAssocGroup_IsCreated 0x4d37a0
2123
#define FUNC_CAnimBlendAssocGroup_GetNumAnimations 0x45b050
2224
#define FUNC_CAnimBlendAssocGroup_GetAnimBlock 0x45b060
@@ -37,28 +39,29 @@ class CAnimBlendAssocGroupSAInterface
3739
AssocGroupId groupID;
3840
};
3941

42+
4043
class CAnimBlendAssocGroupSA : public CAnimBlendAssocGroup
4144
{
4245
friend class CAnimManagerSA;
43-
4446
public:
45-
CAnimBlendAssocGroupSA(CAnimBlendAssocGroupSAInterface* pInterface);
47+
CAnimBlendAssocGroupSA ( CAnimBlendAssocGroupSAInterface * pInterface );
4648

47-
void InitEmptyAssociations(RpClump* pClump);
48-
bool IsCreated(void);
49-
int GetNumAnimations(void);
50-
CAnimBlock* GetAnimBlock(void);
51-
CAnimBlendStaticAssociation* GetAnimation(unsigned int ID);
52-
void CreateAssociations(const char* szBlockName);
49+
CAnimBlendAssociationSAInterface * CopyAnimation ( unsigned int AnimID );
50+
void InitEmptyAssociations ( RpClump * pClump );
51+
bool IsCreated ( void );
52+
int GetNumAnimations ( void );
53+
CAnimBlock * GetAnimBlock ( void );
54+
CAnimBlendStaticAssociation * GetAnimation ( unsigned int ID );
55+
void CreateAssociations ( const char * szBlockName );
5356

54-
bool IsLoaded(void);
55-
void SetIDOffset(int iOffset) { m_pInterface->iIDOffset = iOffset; }
57+
bool IsLoaded ( void );
58+
void SetIDOffset ( int iOffset ) { m_pInterface->iIDOffset = iOffset; }
5659

5760
protected:
58-
void SetupAnimBlock(void);
61+
void SetupAnimBlock ( void );
5962

60-
CAnimBlendAssocGroupSAInterface* m_pInterface;
61-
CAnimBlockSA* m_pAnimBlock;
63+
CAnimBlendAssocGroupSAInterface * m_pInterface;
64+
CAnimBlockSA * m_pAnimBlock;
6265
};
6366

6467
#endif
Lines changed: 86 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,92 @@
11
/*****************************************************************************
2-
*
3-
* PROJECT: Multi Theft Auto v1.0
4-
* LICENSE: See LICENSE in the top level directory
5-
* FILE: game_sa/CAnimBlendHierarchySA.cpp
6-
* PURPOSE: Animation blend hierarchy
7-
*
8-
* Multi Theft Auto is available from http://www.multitheftauto.com/
9-
*
10-
*****************************************************************************/
2+
*
3+
* PROJECT: Multi Theft Auto v1.0
4+
* LICENSE: See LICENSE in the top level directory
5+
* FILE: game_sa/CAnimBlendHierarchySA.cpp
6+
* PURPOSE: Animation blend hierarchy
7+
* DEVELOPERS: Jax <>
8+
*
9+
* Multi Theft Auto is available from http://www.multitheftauto.com/
10+
*
11+
*****************************************************************************/
1112

1213
#include "StdInc.h"
1314

14-
int CAnimBlendHierarchySAInterface::GetIndex(void)
15+
// Careful, GetIndex will not work for custom animations
16+
int CAnimBlendHierarchySAInterface::GetIndex ( void )
1517
{
16-
return (((DWORD)this - ARRAY_CAnimManager_Animations) / 24);
18+
return ( ( ( DWORD ) this - ARRAY_CAnimManager_Animations ) / 24 );
19+
}
20+
21+
void CAnimBlendHierarchySA::Initialize ( void )
22+
{
23+
m_pInterface->pSequences = 0;
24+
m_pInterface->usNumSequences = 0;
25+
m_pInterface->bRunningCompressed = 0;
26+
m_pInterface->pad = 0;
27+
m_pInterface->iAnimBlockID = -1;
28+
m_pInterface->fTotalTime = 0;
29+
m_pInterface->pLinkPtr = 0;
30+
}
31+
32+
void CAnimBlendHierarchySA::SetName ( const char * szName )
33+
{
34+
DWORD dwThis = ( DWORD ) m_pInterface;
35+
DWORD dwFunc = FUNC_CAnimBlendHierarchy_SetName;
36+
_asm
37+
{
38+
push szName
39+
mov ecx, dwThis
40+
call dwFunc
41+
}
42+
}
43+
44+
void CAnimBlendHierarchySA::RemoveAnimSequences ( void )
45+
{
46+
DWORD dwThis = ( DWORD ) m_pInterface;
47+
DWORD dwFunc = FUNC_CAnimBlendHierarchy_RemoveAnimSequences;
48+
_asm
49+
{
50+
mov ecx, dwThis
51+
call dwFunc
52+
}
53+
}
54+
55+
void CAnimBlendHierarchySA::RemoveFromUncompressedCache ( void )
56+
{
57+
DWORD dwThis = ( DWORD ) m_pInterface;
58+
DWORD dwFunc = FUNC_CAnimBlendHierarchy_RemoveFromUncompressedCache;
59+
_asm
60+
{
61+
mov ecx, dwThis
62+
call dwFunc
63+
}
64+
}
65+
66+
void CAnimBlendHierarchySA::RemoveQuaternionFlips ( void )
67+
{
68+
DWORD dwThis = ( DWORD ) m_pInterface;
69+
DWORD dwFunc = FUNC_CAnimBlendHierarchy_RemoveQuaternionFlips;
70+
_asm
71+
{
72+
mov ecx, dwThis
73+
call dwFunc
74+
}
75+
}
76+
77+
void CAnimBlendHierarchySA::CalculateTotalTime ( void )
78+
{
79+
DWORD dwThis = ( DWORD ) m_pInterface;
80+
DWORD dwFunc = FUNC_CAnimBlendHierarchy_CalculateTotalTime;
81+
_asm
82+
{
83+
mov ecx, dwThis
84+
call dwFunc
85+
}
86+
}
87+
88+
CAnimBlendSequenceSAInterface * CAnimBlendHierarchySA::GetSequence ( DWORD dwIndex )
89+
{
90+
BYTE * pSequences = reinterpret_cast < BYTE * > ( m_pInterface->pSequences );
91+
return reinterpret_cast < CAnimBlendSequenceSAInterface * > ( pSequences + ( sizeof ( CAnimBlendSequenceSAInterface ) * dwIndex ) );
1792
}

0 commit comments

Comments
 (0)