mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Refactor Game::savestats() to not use a default argument
In order to be able to fix the bug #556, I'm planning on adding ScreenSettings* to the settings.vvv write function. However, that entails adding another argument to Game::savesettings(), which is going to be really messy given the default argument of Game::savestats(). That, combined with the fact that the code comment at the site of the implementation of Game::savestats() being wrong (!!!), leads me to believe that using default function arguments here isn't worth it. Instead, what I've done is made it so callers are explicit about whether or not they're calling savestats(), savesettings(), or both at the same time. If they are calling both at the same time, then they will be using a new function named savestatsandsettings(). In short, these are the interface changes: * bool Game::savestats(bool) has been removed * bool Game::savestatsandsettings() has been added * void Game::savestats_menu() has been renamed to void Game::savestatsandsettings_menu() * All previous callers of bool Game::savestats() are now using bool Game::savestatsandsettings() * The one caller of bool Game::savestats(bool) is now using bool Game::savestats()
This commit is contained in:
@@ -402,7 +402,7 @@ int main(int argc, char *argv[])
|
||||
deltaloop();
|
||||
}
|
||||
|
||||
game.savestats();
|
||||
game.savestatsandsettings();
|
||||
NETWORK_shutdown();
|
||||
SDL_Quit();
|
||||
FILESYSTEM_deinit();
|
||||
@@ -641,7 +641,7 @@ void inline fixedloop()
|
||||
if (game.savemystats)
|
||||
{
|
||||
game.savemystats = false;
|
||||
game.savestats();
|
||||
game.savestatsandsettings();
|
||||
}
|
||||
|
||||
//Mute button
|
||||
|
||||
Reference in New Issue
Block a user