diff options
author | Thierry Crozat | 2017-11-17 23:13:45 +0000 |
---|---|---|
committer | Thierry Crozat | 2018-01-23 02:15:41 +0000 |
commit | 87ab33a8aa585be4f83a53a2aee60c674872fbb4 (patch) | |
tree | 756bbd649c2404ada47da57b6279bebf8094dd3e /engines/supernova/supernova.cpp | |
parent | 34658bc7d4dcbb041d24d2c35539814613d4307e (diff) | |
download | scummvm-rg350-87ab33a8aa585be4f83a53a2aee60c674872fbb4.tar.gz scummvm-rg350-87ab33a8aa585be4f83a53a2aee60c674872fbb4.tar.bz2 scummvm-rg350-87ab33a8aa585be4f83a53a2aee60c674872fbb4.zip |
SUPERNOVA: Fix several issues with savegames
Diffstat (limited to 'engines/supernova/supernova.cpp')
-rw-r--r-- | engines/supernova/supernova.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index 923b8d6bc5..80a8404599 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -982,7 +982,8 @@ Common::Error SupernovaEngine::loadGameState(int slot) { } bool SupernovaEngine::canSaveGameStateCurrently() { - return _allowSaveGame; + // Do not allow saving when either _allowSaveGame, _animationEnabled or _guiEnabled is false + return _allowSaveGame && _gm->_animationEnabled && _gm->_guiEnabled; } Common::Error SupernovaEngine::saveGameState(int slot, const Common::String &desc) { @@ -1024,6 +1025,13 @@ bool SupernovaEngine::loadGame(int slot) { Graphics::skipThumbnail(*savefile); _gm->deserialize(savefile, saveVersion); + if (saveVersion >= 5) { + _menuBrightness = savefile->readByte(); + _brightness = savefile->readByte(); + } else { + _menuBrightness = _brightness = 255; + } + delete savefile; return true; @@ -1054,6 +1062,9 @@ bool SupernovaEngine::saveGame(int slot, const Common::String &description) { Graphics::saveThumbnail(*savefile); _gm->serialize(savefile); + savefile->writeByte(_menuBrightness); + savefile->writeByte(_brightness); + savefile->finalize(); delete savefile; |