File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -760,3 +760,26 @@ CAnimBlendHierarchy * CAnimManagerSA::GetAnimBlendHierarchy ( CAnimBlendHierarch
760760 }
761761 return NULL ;
762762}
763+
764+ void CAnimManagerSA::InsertPedClumpToMap ( RpClump * pClump, CClientPed * pClientPed )
765+ {
766+ if ( m_mapOfPedClumps.count ( pClump ) == 0 )
767+ {
768+ m_mapOfPedClumps [ pClump ] = pClientPed;
769+ }
770+ }
771+
772+ void CAnimManagerSA::RemovePedClumpFromMap ( RpClump * pClump )
773+ {
774+ m_mapOfPedClumps.erase ( pClump );
775+ }
776+
777+ CClientPed * CAnimManagerSA::GetClientPedFromClumpMap ( RpClump * pClump )
778+ {
779+ ClumpMap_type::iterator it = m_mapOfPedClumps.find ( pClump );
780+ if ( it != m_mapOfPedClumps.end ( ) )
781+ {
782+ return it->second ;
783+ }
784+ return nullptr ;
785+ }
Original file line number Diff line number Diff line change 2020
2121#include " Common.h"
2222#include < list>
23+ #include < map>
2324
2425#define FUNC_CAnimManager_Initialize 0x5bf6b0
2526#define FUNC_CAnimManager_Shutdown 0x4d4130
@@ -78,6 +79,8 @@ class CAnimManagerSAInterface
7879
7980class CAnimManagerSA : public CAnimManager
8081{
82+ typedef std::map < RpClump *, CClientPed * > ClumpMap_type;
83+
8184public:
8285 CAnimManagerSA ( void );
8386 ~CAnimManagerSA ( void );
@@ -146,12 +149,20 @@ class CAnimManagerSA : public CAnimManager
146149 CAnimBlendAssocGroup * GetAnimBlendAssocGroup ( CAnimBlendAssocGroupSAInterface * pInterface );
147150 CAnimBlock * GetAnimBlock ( CAnimBlockSAInterface * pInterface );
148151 CAnimBlendHierarchy * GetAnimBlendHierarchy ( CAnimBlendHierarchySAInterface * pInterface );
152+
153+ // This is used in AddAnimationHandler and AddAnimationAndSyncHandler for playing
154+ // custom animations and to help in replacing and restoring animations
155+ void InsertPedClumpToMap ( RpClump * pClump, CClientPed * pClientPed );
156+ void RemovePedClumpFromMap ( RpClump * pClump );
157+ CClientPed * GetClientPedFromClumpMap ( RpClump * pClump );
149158
150159private:
151160 CAnimBlendAssocGroup * m_pAnimAssocGroups [ MAX_ANIM_GROUPS ];
152161 CAnimBlendHierarchy * m_pAnimations [ MAX_ANIMATIONS ];
153162 CAnimBlock * m_pAnimBlocks [ MAX_ANIM_BLOCKS ];
154- std::list < CAnimBlendAssociation * > m_Associations;
163+ std::list < CAnimBlendAssociation * > m_Associations;
164+ ClumpMap_type m_mapOfPedClumps;
165+
155166};
156167
157168#endif
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class CAnimBlendAssocGroup;
2424class CAnimBlendHierarchy ;
2525class CAnimBlock ;
2626class CAnimBlendAssociation ;
27+ class CClientPed ;
2728struct RpClump ;
2829struct RwStream ;
2930struct AnimAssocDefinition ;
@@ -102,6 +103,10 @@ class CAnimManager
102103 virtual CAnimBlendAssocGroup * GetAnimBlendAssocGroup ( CAnimBlendAssocGroupSAInterface * pInterface ) = 0;
103104 virtual CAnimBlock * GetAnimBlock ( CAnimBlockSAInterface * pInterface ) = 0;
104105 virtual CAnimBlendHierarchy * GetAnimBlendHierarchy ( CAnimBlendHierarchySAInterface * pInterface ) = 0;
106+
107+ virtual void InsertPedClumpToMap ( RpClump * pClump, CClientPed * pEntity ) = 0;
108+ virtual void RemovePedClumpFromMap ( RpClump * pClump ) = 0;
109+ virtual CClientPed * GetClientPedFromClumpMap ( RpClump * pClump ) = 0;
105110};
106111
107112#endif
You can’t perform that action at this time.
0 commit comments