mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 08:23:15 +00:00
SCI: save/restore intensity of sysPalette
fixes bug #3072868 should be save for backporting svn-id: r52875
This commit is contained in:
parent
fd3cc727c9
commit
a8df677c04
@ -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();
|
||||
|
||||
if (s.isLoading() && _palVaryResourceId != -1) {
|
||||
_palVarySignal = 0;
|
||||
palVaryInstallTimer();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace Sci {
|
||||
struct EngineState;
|
||||
|
||||
enum {
|
||||
CURRENT_SAVEGAME_VERSION = 24,
|
||||
CURRENT_SAVEGAME_VERSION = 25,
|
||||
MINIMUM_SAVEGAME_VERSION = 14
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user