aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorJohannes Schickel2011-08-26 18:43:28 +0200
committerJohannes Schickel2011-08-26 18:43:28 +0200
commitf77fc07b6b1e0137cf5ef46c8530ec8b696eefe3 (patch)
treef8adb8100e06a664cb502068e6c57be03b7244c1 /engines/scumm
parentffc09f86478a413ab92d49be327f7f84814ab268 (diff)
downloadscummvm-rg350-f77fc07b6b1e0137cf5ef46c8530ec8b696eefe3.tar.gz
scummvm-rg350-f77fc07b6b1e0137cf5ef46c8530ec8b696eefe3.tar.bz2
scummvm-rg350-f77fc07b6b1e0137cf5ef46c8530ec8b696eefe3.zip
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.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/saveload.cpp22
-rw-r--r--engines/scumm/saveload.h2
2 files changed, 17 insertions, 7 deletions
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