| 395 | } |
| 396 | |
| 397 | GameStatus 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 | |
| 429 | void UpdateShatters() |
| 430 | { |
no test coverage detected