aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/saveload.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/saveload.cpp')
-rw-r--r--engines/scumm/saveload.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 870ec8cdf7..3ab13df032 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -30,7 +30,7 @@
#include "scumm/charset.h"
#include "scumm/imuse_digi/dimuse.h"
#include "scumm/imuse/imuse.h"
-#include "player_towns.h"
+#include "scumm/player_towns.h"
#include "scumm/he/intern_he.h"
#include "scumm/object.h"
#include "scumm/resource.h"
@@ -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,6 +1351,29 @@ void ScummEngine::saveOrLoad(Serializer *s) {
memset(_colorUsedByCycle, 0, sizeof(_colorUsedByCycle));
}
+ // 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);
+
+ // Starting from version 86 we also save the first used color in
+ // the palette beyond the verb palette. For old versions we just
+ // look for it again, which hopefully won't cause any troubles.
+ if (s->getVersion() >= 86) {
+ s->saveLoadArrayOf(&_amigaFirstUsedColor, 1, 2, sleUint16);
+ } else {
+ amigaPaletteFindFirstUsedColor();
+ }
+ } 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
//