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
760
760
}
761
761
return NULL ;
762
762
}
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 20
20
21
21
#include " Common.h"
22
22
#include < list>
23
+ #include < map>
23
24
24
25
#define FUNC_CAnimManager_Initialize 0x5bf6b0
25
26
#define FUNC_CAnimManager_Shutdown 0x4d4130
@@ -78,6 +79,8 @@ class CAnimManagerSAInterface
78
79
79
80
class CAnimManagerSA : public CAnimManager
80
81
{
82
+ typedef std::map < RpClump *, CClientPed * > ClumpMap_type;
83
+
81
84
public:
82
85
CAnimManagerSA ( void );
83
86
~CAnimManagerSA ( void );
@@ -146,12 +149,20 @@ class CAnimManagerSA : public CAnimManager
146
149
CAnimBlendAssocGroup * GetAnimBlendAssocGroup ( CAnimBlendAssocGroupSAInterface * pInterface );
147
150
CAnimBlock * GetAnimBlock ( CAnimBlockSAInterface * pInterface );
148
151
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 );
149
158
150
159
private:
151
160
CAnimBlendAssocGroup * m_pAnimAssocGroups [ MAX_ANIM_GROUPS ];
152
161
CAnimBlendHierarchy * m_pAnimations [ MAX_ANIMATIONS ];
153
162
CAnimBlock * m_pAnimBlocks [ MAX_ANIM_BLOCKS ];
154
- std::list < CAnimBlendAssociation * > m_Associations;
163
+ std::list < CAnimBlendAssociation * > m_Associations;
164
+ ClumpMap_type m_mapOfPedClumps;
165
+
155
166
};
156
167
157
168
#endif
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class CAnimBlendAssocGroup;
24
24
class CAnimBlendHierarchy ;
25
25
class CAnimBlock ;
26
26
class CAnimBlendAssociation ;
27
+ class CClientPed ;
27
28
struct RpClump ;
28
29
struct RwStream ;
29
30
struct AnimAssocDefinition ;
@@ -102,6 +103,10 @@ class CAnimManager
102
103
virtual CAnimBlendAssocGroup * GetAnimBlendAssocGroup ( CAnimBlendAssocGroupSAInterface * pInterface ) = 0;
103
104
virtual CAnimBlock * GetAnimBlock ( CAnimBlockSAInterface * pInterface ) = 0;
104
105
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;
105
110
};
106
111
107
112
#endif
You can’t perform that action at this time.
0 commit comments