Game state switching now uses commands

This commit is contained in:
Antoine Pilote
2024-04-28 01:09:55 -04:00
parent a39c86d9ae
commit 2e19fabdef
4 changed files with 38 additions and 5 deletions

View File

@@ -83,7 +83,7 @@ namespace Nuake
s_LastFrameTime = (float)glfwGetTime();; // Reset timestep timer.
// Dont trigger init if already in player mode.
if (s_GameState == GameState::Playing)
if (GetGameState() == GameState::Playing)
{
Logger::Log("Cannot enter play mode if is already in play mode.", "engine", WARNING);
return;
@@ -91,7 +91,7 @@ namespace Nuake
if (GetCurrentScene()->OnInit())
{
s_GameState = GameState::Playing;
SetGameState(GameState::Playing);
}
else
{