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

Function GameMain

TombEngine/Game/control/control.cpp:364–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364unsigned 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
397GameStatus DoLevel(int levelIndex, bool loadGame)
398{

Callers

nothing calls this directly

Calls 9

TENLogFunction · 0.85
TimeInitFunction · 0.85
DeInitializeFunction · 0.85
RenderTitleImageMethod · 0.80
GetGameDirMethod · 0.80
DoFlowMethod · 0.80
emptyMethod · 0.45
PlayMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected