MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / loadAnimations

Method loadAnimations

CryAnimation/CryModelLoader.cpp:261–303  ·  view source on GitHub ↗

loads animations for already loaded model

Source from the content-addressed store, hash-verified

259
260// loads animations for already loaded model
261bool CryModelLoader::loadAnimations()
262{
263 AUTO_PROFILE_SECTION(g_dTimeAnimLoadBind);
264
265 // the number of animations loaded
266 unsigned numAnimations = 0;
267
268 {
269 AUTO_PROFILE_SECTION (g_dTimeTest1);
270 if(m_fCalFile)
271 numAnimations = loadAnimationsWithCAL ();
272 else
273 if (m_nCafFindFileHandle != -1)
274 numAnimations = loadAnimationsNoCAL ();
275 }
276
277 {
278 AUTO_PROFILE_SECTION(g_dTimeTest2);
279 if (!numAnimations && !m_pModel->numMorphTargets())
280 {
281 g_GetLog()->LogWarning ("\004CryModelLoader::loadAnimations(%s): couldn't find any animations for the model. Standalone character will be useless.", m_strGeomFileNameNoExt.c_str());
282 //return false;
283 }
284
285 if (!m_bLoadFromCCG)
286 {
287 g_GetLog()->UpdateLoadingScreenPlus ("\003 precomputing");
288 m_pModel->LoadPostInitialize (!m_bBoneInitPosInitialized);
289 g_GetLog()->UpdateLoadingScreenPlus ("\003done.");
290 }
291 }
292
293 if (numAnimations)
294 g_GetLog()->UpdateLoadingScreen(" %d animations loaded (total animations: %d)", numAnimations, m_pControllerManager->NumAnimations());
295
296 // m_pControllerManager->LogUsageStats();
297 //m_pModel->shrinkControllerArrays();
298
299 return m_pModel->m_pDefaultModelState
300 && ((m_pModel->numBoneInfos()
301 && m_pModel->m_pDefaultModelState->getRootBone())
302 || m_pModel->numMorphTargets());
303}
304
305// loads the animations from the array: pre-allocates the necessary controller arrays
306// the 0th animation is the default animation

Callers

nothing calls this directly

Calls 8

g_GetLogFunction · 0.85
numMorphTargetsMethod · 0.80
LoadPostInitializeMethod · 0.80
NumAnimationsMethod · 0.80
LogWarningMethod · 0.45
c_strMethod · 0.45
UpdateLoadingScreenMethod · 0.45

Tested by

no test coverage detected