MCPcopy Create free account
hub / github.com/carbonengine/trinity / FindGrannyAnimationByName

Method FindGrannyAnimationByName

trinity/Tr2GrannyAnimation.cpp:211–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209
210#if WITH_GRANNY
211granny_animation* Tr2GrannyAnimation::FindGrannyAnimationByName( const char* name ) const
212{
213 const granny_file_info* fi = GetFileInfo();
214 if( !fi )
215 {
216 return nullptr;
217 }
218
219 int animIx = AnimNameToIndex( fi, name );
220
221 if( animIx != fi->AnimationCount )
222 {
223 return fi->Animations[animIx];
224 }
225
226 for( auto it = m_secondaryGrannyRes.begin(); it != m_secondaryGrannyRes.end(); ++it )
227 {
228 if( !it->second )
229 {
230 continue;
231 }
232 fi = GetSecondaryFileInfo( it->first, it->second );
233 if( !fi )
234 {
235 continue;
236 }
237
238 animIx = AnimNameToIndex( fi, name );
239
240 if( animIx != fi->AnimationCount )
241 {
242 return fi->Animations[animIx];
243 }
244 }
245
246 return nullptr;
247}
248#endif
249
250float Tr2GrannyAnimation::FindAnimationDurationByName( const char* name ) const

Callers 1

PlayAnimationMethod · 0.80

Calls 4

AnimNameToIndexFunction · 0.85
GetSecondaryFileInfoFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected