| 362 | } |
| 363 | |
| 364 | unsigned CALLBACK GameMain(void *) |
| 365 | { |
| 366 | TENLog("Starting GameMain()...", LogLevel::Info); |
| 367 | |
| 368 | TimeInit(); |
| 369 | |
| 370 | // Proceed with intro content only if game isn't started from the editor. |
| 371 | if (CurrentLevel == NO_VALUE) |
| 372 | { |
| 373 | // Do fixed-time title image. |
| 374 | if (!g_GameFlow->IntroImagePath.empty()) |
| 375 | g_Renderer.RenderTitleImage(); |
| 376 | |
| 377 | // Play intro video. |
| 378 | if (!g_GameFlow->IntroVideoPath.empty()) |
| 379 | { |
| 380 | g_VideoPlayer.Play(g_GameFlow->GetGameDir() + g_GameFlow->IntroVideoPath); |
| 381 | while (DoTheGame && g_VideoPlayer.Update()); |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | // Execute Lua gameflow and play game. |
| 386 | g_GameFlow->DoFlow(); |
| 387 | |
| 388 | // Exit game. |
| 389 | DeInitialize(); |
| 390 | DoTheGame = false; |
| 391 | |
| 392 | // Finish thread. |
| 393 | PostMessage(WindowsHandle, WM_CLOSE, NULL, NULL); |
| 394 | return true; |
| 395 | } |
| 396 | |
| 397 | GameStatus DoLevel(int levelIndex, bool loadGame) |
| 398 | { |
nothing calls this directly
no test coverage detected