@@ -92,47 +92,41 @@ void CClientIFP::ReadIFPVersion2( bool anp3)
92
92
readBuffer < IFPHeaderV2 > ( &HeaderV2 );
93
93
94
94
m_pVecAnimations->resize ( HeaderV2.TotalAnimations );
95
- for (size_t i = 0 ; i < m_pVecAnimations->size (); i++)
95
+ for ( auto it = m_pVecAnimations-> begin (); it != m_pVecAnimations->end (); ++it )
96
96
{
97
- IFP_Animation & ifpAnimation = m_pVecAnimations->at ( i );
98
-
99
97
CAnimManager * pAnimManager = g_pGame->GetAnimManager ( );
100
- std::unique_ptr < CAnimBlendHierarchy > pAnimationHierarchy = pAnimManager->GetCustomAnimBlendHierarchy ( &ifpAnimation. Hierarchy );
98
+ std::unique_ptr < CAnimBlendHierarchy > pAnimationHierarchy = pAnimManager->GetCustomAnimBlendHierarchy ( &it-> Hierarchy );
101
99
102
100
pAnimationHierarchy->Initialize ( );
103
101
104
102
Animation AnimationNode;
105
103
106
104
readCString ((char *)&AnimationNode.Name , sizeof (Animation::Name));
107
- ifpAnimation.Name = AnimationNode.Name ;
108
105
readBuffer < int32_t >(&AnimationNode.TotalObjects );
109
106
110
- // ofs << "Animation Name: " << AnimationNode.Name << " | Index: " << i << std::endl;
111
-
112
- printf (" Animation Name: %s | Index: %d \n " , AnimationNode.Name , i);
107
+ it->Name = AnimationNode.Name ;
108
+ printf (" Animation Name: %s \n " , AnimationNode.Name );
113
109
114
110
if (anp3)
115
111
{
116
- readBuffer < int32_t >(&AnimationNode.FrameSize );
117
- readBuffer < int32_t >(&AnimationNode.isCompressed );
118
- pAnimationHierarchy->SetRunningCompressed ( AnimationNode.isCompressed & 1 );
112
+ readBuffer < int32_t > ( &AnimationNode.FrameSize );
113
+ readBuffer < int32_t > ( &AnimationNode.isCompressed );
119
114
}
120
115
121
116
pAnimationHierarchy->SetName ( AnimationNode.Name );
122
117
pAnimationHierarchy->SetNumSequences ( AnimationNode.TotalObjects );
123
118
pAnimationHierarchy->SetAnimationBlockID ( 0 );
124
119
pAnimationHierarchy->SetRunningCompressed ( m_kbAllKeyFramesCompressed );
125
120
126
- const unsigned short TotalSequences = m_kcIFPSequences + pAnimationHierarchy->GetNumSequences ( );
127
- ifpAnimation. pSequencesMemory = ( char * ) operator new ( 12 * TotalSequences + 4 ); // Allocate memory for sequences ( 12 * seq_count + 4 )
121
+ const WORD TotalSequences = m_kcIFPSequences + pAnimationHierarchy->GetNumSequences ( );
122
+ it-> pSequencesMemory = ( char * ) operator new ( 12 * TotalSequences + 4 ); // Allocate memory for sequences ( 12 * seq_count + 4 )
128
123
129
- pAnimationHierarchy->SetSequences ( reinterpret_cast < CAnimBlendSequenceSAInterface * > ( ifpAnimation. pSequencesMemory + 4 ) );
124
+ pAnimationHierarchy->SetSequences ( reinterpret_cast < CAnimBlendSequenceSAInterface * > ( it-> pSequencesMemory + 4 ) );
130
125
131
126
std::map < std::string, CAnimBlendSequenceSAInterface > MapOfSequences;
132
127
133
128
WORD wUnknownSequences = 0 ;
134
129
135
- bool bFirstSeq = true ;
136
130
for (size_t SequenceIndex = 0 ; SequenceIndex < pAnimationHierarchy->GetNumSequences ( ); SequenceIndex++)
137
131
{
138
132
Object ObjectNode;
@@ -177,7 +171,7 @@ void CClientIFP::ReadIFPVersion2( bool anp3)
177
171
178
172
CopySequencesWithDummies ( pAnimManager, pAnimationHierarchy, MapOfSequences );
179
173
180
- *(DWORD *)ifpAnimation. pSequencesMemory = m_kcIFPSequences + wUnknownSequences;
174
+ *(DWORD *)it-> pSequencesMemory = m_kcIFPSequences + wUnknownSequences;
181
175
182
176
// This order is very important. As we need support for all 32 bones, we must change the total sequences count
183
177
pAnimationHierarchy->SetNumSequences ( m_kcIFPSequences + wUnknownSequences );
0 commit comments