Skip to content

Commit

Permalink
Minor struct field renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyas committed Apr 4, 2024
1 parent 9614860 commit dacd802
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/common/GameValues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void CGameValues::init()
framelimiter = WAITTIME;
sound = true;
music = true;
gamestate = AppState::Splash;
appstate = AppState::Splash;
#ifdef _DEBUG
fullscreen = false;
#else
Expand Down
2 changes: 1 addition & 1 deletion src/common/GameValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class CGameValues : public CGameConfig
bool frameadvance;
bool autokill;

AppState gamestate;
AppState appstate = AppState::Splash;

float screenResizeX;
float screenResizeY;
Expand Down
24 changes: 12 additions & 12 deletions src/smw/GSGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1920,7 +1920,7 @@ void debug_gameplay()
UpdateScoreBoard();

CleanUp();
game_values.gamestate = AppState::Menu;
game_values.appstate = AppState::Menu;

return;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -2263,7 +2263,7 @@ void start_gameplay()
{
CleanUp();
SetGameModeSettingsFromMenu();
game_values.gamestate = AppState::Game;
game_values.appstate = AppState::Game;

//secretBoss();

Expand All @@ -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());
}
Expand Down Expand Up @@ -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;
}
Expand Down
18 changes: 9 additions & 9 deletions src/smw/GSMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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]);
Expand All @@ -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;
Expand All @@ -1445,7 +1445,7 @@ void MenuState::update()

mWorldMenu->miWorld->DisplayTeamControlAnnouncement();

game_values.gamestate = AppState::Menu;
game_values.appstate = AppState::Menu;
}
}

Expand Down Expand Up @@ -1567,7 +1567,7 @@ void MenuState::StartGame()
fScriptRunPreGameOptions = false;
#endif

game_values.gamestate = AppState::StartGame;
game_values.appstate = AppState::StartGame;
//backgroundonly = false;
//fastmap = false;

Expand Down Expand Up @@ -1709,7 +1709,7 @@ void MenuState::Exit()
#ifdef __EMSCRIPTEN__
return;
#endif
game_values.gamestate = AppState::Quit;
game_values.appstate = AppState::Quit;
game_values.WriteConfig();
}

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/smw/GSSplashScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void SplashScreenState::update()

#ifndef _XBOX
case SDL_QUIT: {
game_values.gamestate = AppState::Quit;
game_values.appstate = AppState::Quit;
return;
}
break;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/smw/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit dacd802

Please sign in to comment.