diff options
author | Martin Kiewitz | 2010-09-24 09:56:50 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-09-24 09:56:50 +0000 |
commit | a8df677c0494eef00de304734dadda1e1ef593c7 (patch) | |
tree | e098aefab5ba4604976e02a92c880b69f0fcfe5a | |
parent | fd3cc727c91da216ccb480fdbf8dc8d59cc39d9d (diff) | |
download | scummvm-rg350-a8df677c0494eef00de304734dadda1e1ef593c7.tar.gz scummvm-rg350-a8df677c0494eef00de304734dadda1e1ef593c7.tar.bz2 scummvm-rg350-a8df677c0494eef00de304734dadda1e1ef593c7.zip |
SCI: save/restore intensity of sysPalette
fixes bug #3072868
should be save for backporting
svn-id: r52875
-rw-r--r-- | engines/sci/engine/savegame.cpp | 42 | ||||
-rw-r--r-- | engines/sci/engine/savegame.h | 2 |
2 files changed, 25 insertions, 19 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 88f5d29920..87e328592f 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -566,26 +566,32 @@ void GfxPalette::palVarySaveLoadPalette(Common::Serializer &s, Palette *palette) } void GfxPalette::saveLoadWithSerializer(Common::Serializer &s) { - if (s.getVersion() < 24) - return; - - if (s.isLoading() && _palVaryResourceId != -1) - palVaryRemoveTimer(); - - s.syncAsSint32LE(_palVaryResourceId); - if (_palVaryResourceId != -1) { - palVarySaveLoadPalette(s, &_palVaryOriginPalette); - palVarySaveLoadPalette(s, &_palVaryTargetPalette); - s.syncAsSint16LE(_palVaryStep); - s.syncAsSint16LE(_palVaryStepStop); - s.syncAsSint16LE(_palVaryDirection); - s.syncAsUint16LE(_palVaryTicks); - s.syncAsSint32LE(_palVaryPaused); + if (s.getVersion() >= 25) { + // We need to save intensity of the _sysPalette at least for kq6 when entering the dark cave (room 390) + // from room 340. scripts will set intensity to 60 for this room and restore them when leaving. + // Sierra SCI is also doing this (although obviously not for SCI0->SCI01 games, still it doesn't hurt + // to save it everywhere). ffs. bug #3072868 + s.syncBytes(_sysPalette.intensity, 256); } + if (s.getVersion() >= 24) { + if (s.isLoading() && _palVaryResourceId != -1) + palVaryRemoveTimer(); + + s.syncAsSint32LE(_palVaryResourceId); + if (_palVaryResourceId != -1) { + palVarySaveLoadPalette(s, &_palVaryOriginPalette); + palVarySaveLoadPalette(s, &_palVaryTargetPalette); + s.syncAsSint16LE(_palVaryStep); + s.syncAsSint16LE(_palVaryStepStop); + s.syncAsSint16LE(_palVaryDirection); + s.syncAsUint16LE(_palVaryTicks); + s.syncAsSint32LE(_palVaryPaused); + } - if (s.isLoading() && _palVaryResourceId != -1) { - _palVarySignal = 0; - palVaryInstallTimer(); + if (s.isLoading() && _palVaryResourceId != -1) { + _palVarySignal = 0; + palVaryInstallTimer(); + } } } diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index fc254ba33d..14eec4aafc 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -36,7 +36,7 @@ namespace Sci { struct EngineState; enum { - CURRENT_SAVEGAME_VERSION = 24, + CURRENT_SAVEGAME_VERSION = 25, MINIMUM_SAVEGAME_VERSION = 14 }; |