Only save config if changes are made.

This commit is contained in:
StackZ
2020-03-09 16:25:56 +01:00
parent 1a20cc50f3
commit becb99cdd3
4 changed files with 26 additions and 3 deletions
+6 -1
View File
@@ -51,6 +51,7 @@ sound *bgm = NULL;
bool songIsFound = false;
bool UniStoreAutoboot = false;
int AutobootWhat = 0; // 0 -> MainMenu ; 1 -> Store; 2 -> Script.
bool changesMade = false;
// Include all spritesheet's.
C2D_SpriteSheet sprites;
@@ -193,7 +194,11 @@ Result Init::Exit() {
// Free UniStore spritesheet, just in case.
freeSheet();
Config::save();
// Only save config, if *any* changes are made. (To reduce SD Writes.)
if (changesMade) {
Config::save();
}
Gui::exit();
Gui::unloadSheet(sprites);
gfxExit();