aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/gfx.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2011-08-27 10:23:19 -0700
committerEugene Sandulenko2011-08-27 10:23:19 -0700
commit064ab0fd628f660d8565512dfbffb0c11a82f046 (patch)
treeac553523b5442af31bad9a1a3fa80bb3af85682f /engines/scumm/gfx.cpp
parent35aa235e4b4c4212b59d00adb77d2e3d00dd440e (diff)
parentcd45d63e064c5f45e911256de75c3efef156337d (diff)
downloadscummvm-rg350-064ab0fd628f660d8565512dfbffb0c11a82f046.tar.gz
scummvm-rg350-064ab0fd628f660d8565512dfbffb0c11a82f046.tar.bz2
scummvm-rg350-064ab0fd628f660d8565512dfbffb0c11a82f046.zip
Merge pull request #77 from lordhoto/indy4amiga
SCUMM: Implement proper Indy4 Amiga palette handling.
Diffstat (limited to 'engines/scumm/gfx.cpp')
-rw-r--r--engines/scumm/gfx.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 8a32b963cd..a22aa1802f 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -1025,6 +1025,16 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
if (rect.left > vs->w)
return;
+ // Indy4 Amiga always uses the room or verb palette map to match colors to
+ // the currently setup palette, thus we need to select it over here too.
+ // Done like the original interpreter.
+ if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) {
+ if (vs->number == kVerbVirtScreen)
+ backColor = _verbPalette[backColor];
+ else
+ backColor = _roomPalette[backColor];
+ }
+
// Convert 'rect' to local (virtual screen) coordinates
rect.top -= vs->topline;
rect.bottom -= vs->topline;
@@ -1235,6 +1245,16 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
if ((vs = findVirtScreen(y)) == NULL)
return;
+ // Indy4 Amiga always uses the room or verb palette map to match colors to
+ // the currently setup palette, thus we need to select it over here too.
+ // Done like the original interpreter.
+ if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) {
+ if (vs->number == kVerbVirtScreen)
+ color = _verbPalette[color];
+ else
+ color = _roomPalette[color];
+ }
+
if (x > x2)
SWAP(x, x2);
@@ -1872,6 +1892,16 @@ bool Gdi::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width,
}
assertRange(0, offset, smapLen-1, "screen strip");
+ // Indy4 Amiga always uses the room or verb palette map to match colors to
+ // the currently setup palette, thus we need to select it over here too.
+ // Done like the original interpreter.
+ if (_vm->_game.platform == Common::kPlatformAmiga && _vm->_game.id == GID_INDY4) {
+ if (vs->number == kVerbVirtScreen)
+ _roomPalette = _vm->_verbPalette;
+ else
+ _roomPalette = _vm->_roomPalette;
+ }
+
return decompressBitmap(dstPtr, vs->pitch, smap_ptr + offset, height);
}