@@ -92,47 +92,41 @@ void CClientIFP::ReadIFPVersion2( bool anp3)
9292 readBuffer < IFPHeaderV2 > ( &HeaderV2 );
9393
9494 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 )
9696 {
97- IFP_Animation & ifpAnimation = m_pVecAnimations->at ( i );
98-
9997 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 );
10199
102100 pAnimationHierarchy->Initialize ( );
103101
104102 Animation AnimationNode;
105103
106104 readCString ((char *)&AnimationNode.Name , sizeof (Animation::Name));
107- ifpAnimation.Name = AnimationNode.Name ;
108105 readBuffer < int32_t >(&AnimationNode.TotalObjects );
109106
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 );
113109
114110 if (anp3)
115111 {
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 );
119114 }
120115
121116 pAnimationHierarchy->SetName ( AnimationNode.Name );
122117 pAnimationHierarchy->SetNumSequences ( AnimationNode.TotalObjects );
123118 pAnimationHierarchy->SetAnimationBlockID ( 0 );
124119 pAnimationHierarchy->SetRunningCompressed ( m_kbAllKeyFramesCompressed );
125120
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 )
128123
129- pAnimationHierarchy->SetSequences ( reinterpret_cast < CAnimBlendSequenceSAInterface * > ( ifpAnimation. pSequencesMemory + 4 ) );
124+ pAnimationHierarchy->SetSequences ( reinterpret_cast < CAnimBlendSequenceSAInterface * > ( it-> pSequencesMemory + 4 ) );
130125
131126 std::map < std::string, CAnimBlendSequenceSAInterface > MapOfSequences;
132127
133128 WORD wUnknownSequences = 0 ;
134129
135- bool bFirstSeq = true ;
136130 for (size_t SequenceIndex = 0 ; SequenceIndex < pAnimationHierarchy->GetNumSequences ( ); SequenceIndex++)
137131 {
138132 Object ObjectNode;
@@ -177,7 +171,7 @@ void CClientIFP::ReadIFPVersion2( bool anp3)
177171
178172 CopySequencesWithDummies ( pAnimManager, pAnimationHierarchy, MapOfSequences );
179173
180- *(DWORD *)ifpAnimation. pSequencesMemory = m_kcIFPSequences + wUnknownSequences;
174+ *(DWORD *)it-> pSequencesMemory = m_kcIFPSequences + wUnknownSequences;
181175
182176 // This order is very important. As we need support for all 32 bones, we must change the total sequences count
183177 pAnimationHierarchy->SetNumSequences ( m_kcIFPSequences + wUnknownSequences );
0 commit comments