From f77fc07b6b1e0137cf5ef46c8530ec8b696eefe3 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 26 Aug 2011 18:43:28 +0200 Subject: SCUMM: Save Indy4 Amiga specific palettes like the original did. For older saves I added a warning and a fallback which tries to setup everything correctly. This might cause some issues, but should hopefully be just fine. --- engines/scumm/saveload.cpp | 22 ++++++++++++++++------ engines/scumm/saveload.h | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 27fa7bc27b..e0eba99cce 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1322,6 +1322,9 @@ void ScummEngine::saveOrLoad(Serializer *s) { if (_shadowPaletteSize) { s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte); // _roomPalette didn't show up until V21 save games + // Note that we also save the room palette for Indy4 Amiga, since it + // is used as palette map there too, but we do so slightly a bit + // further down to group it with the other special palettes needed. if (s->getVersion() >= VER(21) && _game.version < 5) s->saveLoadArrayOf(_roomPalette, sizeof(_roomPalette), 1, sleByte); } @@ -1348,12 +1351,19 @@ void ScummEngine::saveOrLoad(Serializer *s) { memset(_colorUsedByCycle, 0, sizeof(_colorUsedByCycle)); } - // We need to restore the internal state of the Amiga palette for Indy4 - // Amiga. - // TODO: We should rather store the state in the savefile and only do this - // for old savegames. - if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) - setAmigaPaletteFromPtr(_currentPalette); + // Indy4 Amiga specific palette tables were not saved before V85 + if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) { + if (s->getVersion() >= 85) { + s->saveLoadArrayOf(_roomPalette, 256, 1, sleByte); + s->saveLoadArrayOf(_verbPalette, 256, 1, sleByte); + s->saveLoadArrayOf(_amigaPalette, 3 * 64, 1, sleByte); + } else { + warning("Save with old Indiana Jones 4 Amiga palette handling detected"); + // We need to restore the internal state of the Amiga palette for Indy4 + // Amiga. This might lead to graphics glitches! + setAmigaPaletteFromPtr(_currentPalette); + } + } // // Save/load more global object state diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index 776f40e12b..792a31d067 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -47,7 +47,7 @@ namespace Scumm { * only saves/loads those which are valid for the version of the savegame * which is being loaded/saved currently. */ -#define CURRENT_VER 84 +#define CURRENT_VER 85 /** * An auxillary macro, used to specify savegame versions. We use this instead -- cgit v1.2.3