Fixed rare case of not being able to start a new game or exit game from main menu

This commit is contained in:
Lwmte 2024-12-27 01:29:22 +01:00
parent 0c4402468b
commit 89183bbb4e
2 changed files with 12 additions and 5 deletions

View file

@ -7,6 +7,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
### Bug fixes ### Bug fixes
* Fixed static meshes with dynamic light mode not accepting room lights. * Fixed static meshes with dynamic light mode not accepting room lights.
* Fixed rare case of not being able to start a new game or exit game from main menu.
* Fixed antialiasing quality not changing after changing it in display settings. * Fixed antialiasing quality not changing after changing it in display settings.
* Fixed endless explosion effect for Puna. * Fixed endless explosion effect for Puna.

View file

@ -643,18 +643,24 @@ GameStatus DoGameLoop(int levelIndex)
status = GamePhase(false); status = GamePhase(false);
g_Synchronizer.Init(); g_Synchronizer.Init();
bool legacy30FpsDoneDraw = false;
bool legacy30FpsDrawDone = false;
bool controlPhaseDone = false;
while (DoTheGame) while (DoTheGame)
{ {
g_Synchronizer.Sync(); g_Synchronizer.Sync();
controlPhaseDone = false;
while (g_Synchronizer.Synced()) while (g_Synchronizer.Synced())
{ {
status = ControlPhase(false); if (!controlPhaseDone)
status = ControlPhase(false);
g_Synchronizer.Step(); g_Synchronizer.Step();
legacy30FpsDoneDraw = false; controlPhaseDone = true;
legacy30FpsDrawDone = false;
} }
if (status != GameStatus::Normal) if (status != GameStatus::Normal)
@ -665,10 +671,10 @@ GameStatus DoGameLoop(int levelIndex)
if (!g_Configuration.EnableHighFramerate) if (!g_Configuration.EnableHighFramerate)
{ {
if (!legacy30FpsDoneDraw) if (!legacy30FpsDrawDone)
{ {
DrawPhase(!levelIndex, 0.0f); DrawPhase(!levelIndex, 0.0f);
legacy30FpsDoneDraw = true; legacy30FpsDrawDone = true;
} }
} }
else else