MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / DoLevel

Function DoLevel

TombEngine/Game/control/control.cpp:397–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397GameStatus DoLevel(int levelIndex, bool loadGame)
398{
399 bool isTitle = !levelIndex;
400
401 TENLog(isTitle ? "DoTitle" : "DoLevel", LogLevel::Info);
402
403 // Load level. Fall back to title if unsuccessful.
404 if (!LoadLevelFile(levelIndex))
405 return (isTitle ? GameStatus::ExitGame : GameStatus::ExitToTitle);
406
407 // Initialize items, effects, lots, and cameras.
408 HairEffect.Initialize();
409 InitializeFXArray();
410 InitializeCamera();
411 InitializeSpotCamSequences(isTitle);
412 InitializeItemBoxData();
413 InitializeSpecialEffects();
414
415 // Initialize scripting.
416 InitializeScripting(levelIndex, loadGame);
417 InitializeNodeScripts();
418
419 // Initialize menu and inventory state.
420 g_Gui.Initialize();
421
422 // Initialize game variables and optionally load game.
423 InitializeOrLoadGame(loadGame);
424
425 // DoGameLoop() returns only when level has ended.
426 return DoGameLoop(levelIndex);
427}
428
429void UpdateShatters()
430{

Callers 1

DoFlowMethod · 0.85

Calls 12

TENLogFunction · 0.85
LoadLevelFileFunction · 0.85
InitializeFXArrayFunction · 0.85
InitializeCameraFunction · 0.85
InitializeItemBoxDataFunction · 0.85
InitializeSpecialEffectsFunction · 0.85
InitializeScriptingFunction · 0.85
InitializeNodeScriptsFunction · 0.85
InitializeOrLoadGameFunction · 0.85
DoGameLoopFunction · 0.85
InitializeMethod · 0.45

Tested by

no test coverage detected