diff --git a/src/common/GameValues.cpp b/src/common/GameValues.cpp index 25cbb48d..a74c578b 100644 --- a/src/common/GameValues.cpp +++ b/src/common/GameValues.cpp @@ -98,7 +98,7 @@ void CGameValues::init() framelimiter = WAITTIME; sound = true; music = true; - gamestate = AppState::Splash; + appstate = AppState::Splash; #ifdef _DEBUG fullscreen = false; #else diff --git a/src/common/GameValues.h b/src/common/GameValues.h index f158d517..750cc1a2 100644 --- a/src/common/GameValues.h +++ b/src/common/GameValues.h @@ -196,7 +196,7 @@ class CGameValues : public CGameConfig bool frameadvance; bool autokill; - AppState gamestate; + AppState appstate = AppState::Splash; float screenResizeX; float screenResizeY; diff --git a/src/smw/GSGameplay.cpp b/src/smw/GSGameplay.cpp index bfa1dc7e..215af29a 100644 --- a/src/smw/GSGameplay.cpp +++ b/src/smw/GSGameplay.cpp @@ -157,7 +157,7 @@ void SDLCALL musicfinished() if (!game_values.music) return; - if (game_values.gamestate == AppState::Game && !game_values.gamemode->gameover) + if (game_values.appstate == AppState::Game && !game_values.gamemode->gameover) return; if (fResumeMusic) @@ -1554,7 +1554,7 @@ bool updateExitPauseDialog(short iCountDownState) // true on exit //If the cancel button is pressed if (game_values.flags.forceexittimer > 0) { if (--game_values.flags.forceexittimer <= 0) { - game_values.gamestate = AppState::EndGame; + game_values.appstate = AppState::EndGame; game_values.screenfade = 8; game_values.screenfadespeed = 8; } @@ -1593,7 +1593,7 @@ bool updateExitPauseDialog(short iCountDownState) // true on exit UpdateScoreBoard(); CleanUp(); - game_values.gamestate = AppState::Menu; + game_values.appstate = AppState::Menu; return true; } else { @@ -1622,7 +1622,7 @@ bool updateExitPauseDialog(short iCountDownState) // true on exit CleanUp(); game_values.flags.exitinggame = false; game_values.flags.exityes = false; - game_values.gamestate = AppState::Menu; + game_values.appstate = AppState::Menu; return true; } else { game_values.flags.exitinggame = false; @@ -1920,7 +1920,7 @@ void debug_gameplay() UpdateScoreBoard(); CleanUp(); - game_values.gamestate = AppState::Menu; + game_values.appstate = AppState::Menu; return; } @@ -1929,7 +1929,7 @@ void debug_gameplay() CleanUp(); game_values.flags.exitinggame = false; game_values.flags.exityes = false; - game_values.gamestate = AppState::Menu; + game_values.appstate = AppState::Menu; return; } @@ -1969,7 +1969,7 @@ void GameplayState::handleInput() #ifndef _XBOX case SDL_QUIT: { CleanUp(); - game_values.gamestate = AppState::Quit; + game_values.appstate = AppState::Quit; return; } break; @@ -1979,7 +1979,7 @@ void GameplayState::handleInput() if (event.key.keysym.mod & (KMOD_LALT | KMOD_RALT)) { if (event.key.keysym.sym == SDLK_F4) { CleanUp(); - game_values.gamestate = AppState::Quit; + game_values.appstate = AppState::Quit; return; } else if (event.key.keysym.sym == SDLK_RETURN) { game_values.fullscreen = !game_values.fullscreen; @@ -2263,7 +2263,7 @@ void start_gameplay() { CleanUp(); SetGameModeSettingsFromMenu(); - game_values.gamestate = AppState::Game; + game_values.appstate = AppState::Game; //secretBoss(); @@ -2277,7 +2277,7 @@ void start_gameplay() void end_gameplay() { CleanUp(); - game_values.gamestate = AppState::Menu; + game_values.appstate = AppState::Menu; game_values.screenfadespeed = -8; GameStateManager::instance().changeStateTo(&MenuState::instance()); } @@ -2435,10 +2435,10 @@ void GameplayState::update() network_broadcast_game_state(); if (game_values.screenfade == 255) { - if (game_values.gamestate == AppState::StartGame) { + if (game_values.appstate == AppState::StartGame) { start_gameplay(); return; - } else if (game_values.gamestate == AppState::EndGame) { + } else if (game_values.appstate == AppState::EndGame) { end_gameplay(); return; } diff --git a/src/smw/GSMenu.cpp b/src/smw/GSMenu.cpp index 82d35630..13d3c129 100644 --- a/src/smw/GSMenu.cpp +++ b/src/smw/GSMenu.cpp @@ -572,7 +572,7 @@ void MenuState::update() #endif bool fGenerateMapThumbs = false; - if (AppState::Menu == game_values.gamestate) { + if (AppState::Menu == game_values.appstate) { MenuCodeEnum code = mCurrentMenu->SendInput(&game_values.playerInput); // Shortcut to game start @@ -830,7 +830,7 @@ void MenuState::update() } else if (MatchType::World == game_values.matchtype) { game_values.screenfadespeed = 8; game_values.screenfade = 8; - game_values.gamestate = AppState::StartWorld; + game_values.appstate = AppState::StartWorld; //Play enter world sound ifsoundonandreadyplay(rm->sfx_enterstage); @@ -1324,7 +1324,7 @@ void MenuState::update() } if (game_values.screenfade == 255) { - if (AppState::StartGame == game_values.gamestate) { + if (AppState::StartGame == game_values.appstate) { if (game_values.matchtype == MatchType::QuickGame) mModeOptionsMenu->SetRandomGameModeSettings(game_values.gamemode->gamemode); else if (game_values.matchtype == MatchType::NetGame) @@ -1418,7 +1418,7 @@ void MenuState::update() } } - game_values.gamestate = AppState::Game; + game_values.appstate = AppState::Game; printf(" GS_GAME\n"); g_map->predrawbackground(rm->spr_background, rm->spr_backmap[0]); @@ -1432,7 +1432,7 @@ void MenuState::update() GameStateManager::instance().changeStateTo(&GameplayState::instance()); return; - } else if (AppState::StartWorld == game_values.gamestate) { //Fade to world match type + } else if (AppState::StartWorld == game_values.appstate) { //Fade to world match type game_values.screenfadespeed = -8; mCurrentMenu = mWorldMenu; @@ -1445,7 +1445,7 @@ void MenuState::update() mWorldMenu->miWorld->DisplayTeamControlAnnouncement(); - game_values.gamestate = AppState::Menu; + game_values.appstate = AppState::Menu; } } @@ -1567,7 +1567,7 @@ void MenuState::StartGame() fScriptRunPreGameOptions = false; #endif - game_values.gamestate = AppState::StartGame; + game_values.appstate = AppState::StartGame; //backgroundonly = false; //fastmap = false; @@ -1709,7 +1709,7 @@ void MenuState::Exit() #ifdef __EMSCRIPTEN__ return; #endif - game_values.gamestate = AppState::Quit; + game_values.appstate = AppState::Quit; game_values.WriteConfig(); } @@ -1780,7 +1780,7 @@ void MenuState::ResetScript() void MenuState::GetNextScriptOperation() { - if (AppState::Menu != game_values.gamestate) + if (AppState::Menu != game_values.appstate) return; //static short slowdowntimer = 0; diff --git a/src/smw/GSSplashScreen.cpp b/src/smw/GSSplashScreen.cpp index e9cacd3a..78e318da 100644 --- a/src/smw/GSSplashScreen.cpp +++ b/src/smw/GSSplashScreen.cpp @@ -151,7 +151,7 @@ void SplashScreenState::update() #ifndef _XBOX case SDL_QUIT: { - game_values.gamestate = AppState::Quit; + game_values.appstate = AppState::Quit; return; } break; @@ -171,7 +171,7 @@ void SplashScreenState::update() #ifndef _XBOX case SDLK_F4: if (loop_event.key.keysym.mod & (KMOD_LALT | KMOD_RALT)) { - game_values.gamestate = AppState::Quit; + game_values.appstate = AppState::Quit; return; } break; @@ -214,7 +214,7 @@ void SplashScreenState::update() eyecandy[2].clean(); game_values.playerInput.ResetKeys(); - game_values.gamestate = AppState::Menu; + game_values.appstate = AppState::Menu; MenuState::instance().init(); GameplayState::instance().init(); diff --git a/src/smw/main.cpp b/src/smw/main.cpp index 7b543a33..9ba1b84a 100644 --- a/src/smw/main.cpp +++ b/src/smw/main.cpp @@ -161,7 +161,7 @@ void gameloop() void gameloop_frame() #else - while (game_values.gamestate != AppState::Quit) + while (game_values.appstate != AppState::Quit) #endif { FPSLimiter::instance().frameStart();