diff options
author | Paul Gilbert | 2018-03-03 22:15:50 -0500 |
---|---|---|
committer | Paul Gilbert | 2018-03-04 22:40:42 -0500 |
commit | 50630efde6d0f42f4d5f371d6818afac64ba86f5 (patch) | |
tree | 034029b8f90e94daaca83e6ff9413b4508c7dc97 /engines/xeen/xeen.cpp | |
parent | 92c49a857161b1650ca197c71668ee189d667e48 (diff) | |
download | scummvm-rg350-50630efde6d0f42f4d5f371d6818afac64ba86f5.tar.gz scummvm-rg350-50630efde6d0f42f4d5f371d6818afac64ba86f5.tar.bz2 scummvm-rg350-50630efde6d0f42f4d5f371d6818afac64ba86f5.zip |
XEEN: Fix loading saves from main menus and launcher
Diffstat (limited to 'engines/xeen/xeen.cpp')
-rw-r--r-- | engines/xeen/xeen.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp index 21db8b270f..6122f4deea 100644 --- a/engines/xeen/xeen.cpp +++ b/engines/xeen/xeen.cpp @@ -62,6 +62,8 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc) _mode = MODE_0; _endingScore = 0; _loadSaveSlot = -1; + _gameWon[0] = _gameWon[1] = false; + _finalScore[0] = _finalScore[1] = 0; g_vm = this; } @@ -111,6 +113,12 @@ bool XeenEngine::initialize() { // Setup mixer syncSoundSettings(); + // Load settings + _gameWon[0] = ConfMan.hasKey("game_won") && ConfMan.getBool("game_won"); + _gameWon[1] = ConfMan.hasKey("game_won2") && ConfMan.getBool("game_won2"); + _finalScore[0] = ConfMan.hasKey("final_score") ? ConfMan.getInt("final_score") : 0; + _finalScore[1] = ConfMan.hasKey("final_score2") ? ConfMan.getInt("final_score2") : 0; + // If requested, load a savegame instead of showing the intro if (ConfMan.hasKey("save_slot")) { int saveSlot = ConfMan.getInt("save_slot"); @@ -294,4 +302,15 @@ void XeenEngine::GUIError(const char *msg, ...) { GUIErrorMessage(buffer); } +void XeenEngine::saveSettings() { + if (_gameWon[0]) + ConfMan.setBool("game_won", true); + if (_gameWon[1]) + ConfMan.setBool("game_won2", true); + + ConfMan.setInt("final_score", _finalScore[0]); + ConfMan.setInt("final_score2", _finalScore[1]); + ConfMan.flushToDisk(); +} + } // End of namespace Xeen |