From e35b4f20c1041b13361aa2ebc4e758873bb1cee3 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 7 Aug 2011 14:35:01 +0200 Subject: GRAPHICS: Simplify the interface of Graphics::loadThumbnail(). Now it returns the Surface, so the caller does not need to create one and pass it. --- engines/scumm/saveload.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 3cc710c207..870ec8cdf7 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -686,12 +686,7 @@ Graphics::Surface *ScummEngine::loadThumbnailFromSlot(const char *target, int sl Graphics::Surface *thumb = 0; if (Graphics::checkThumbnailHeader(*in)) { - thumb = new Graphics::Surface(); - assert(thumb); - if (!Graphics::loadThumbnail(*in, *thumb)) { - delete thumb; - thumb = 0; - } + thumb = Graphics::loadThumbnail(*in); } delete in; -- cgit v1.2.3 From 4ea4172cbad466738836f7be8ebdcad4eabd0bb9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 26 Aug 2011 05:51:08 +0200 Subject: SCUMM: Implement proper Indy4 Amiga palette handling. This should fix incorrect text colors in some scenes. --- engines/scumm/saveload.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 870ec8cdf7..27fa7bc27b 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1348,6 +1348,13 @@ 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); + // // Save/load more global object state // -- cgit v1.2.3 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 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'engines/scumm/saveload.cpp') 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 -- cgit v1.2.3 From 003c16920c1790152e64250b38613f36e39ec719 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 27 Aug 2011 19:57:45 +0200 Subject: SCUMM: Also save first used color beyond 80 in Indy4 Amiga palette. --- engines/scumm/saveload.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index e0eba99cce..db151c2457 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -1357,6 +1357,15 @@ void ScummEngine::saveOrLoad(Serializer *s) { 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 -- cgit v1.2.3 From d0e64ce4a3a30d3db6194f15320dac981a0c7a16 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 27 Aug 2011 19:58:36 +0200 Subject: SCUMM: Properly prefix player_towns.h include with scumm/. --- engines/scumm/saveload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/scumm/saveload.cpp') diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index db151c2457..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" -- cgit v1.2.3