aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2003-08-29 06:46:12 +0000
committerTravis Howell2003-08-29 06:46:12 +0000
commit33f9cb35a39604e6e2691e33624050a4ab1bbfd1 (patch)
tree159cbeb591a4da6feb8a1bbb50537689935f68e0
parented698cb63591963d0eb73c8dee69b95951bd476b (diff)
downloadscummvm-rg350-33f9cb35a39604e6e2691e33624050a4ab1bbfd1.tar.gz
scummvm-rg350-33f9cb35a39604e6e2691e33624050a4ab1bbfd1.tar.bz2
scummvm-rg350-33f9cb35a39604e6e2691e33624050a4ab1bbfd1.zip
Change zak room color remapping, so it work correctly after load/save in room with remapped colors.
svn-id: r9905
-rw-r--r--scumm/gfx.cpp3
-rw-r--r--scumm/script_v2.cpp1
-rw-r--r--scumm/scummvm.cpp4
3 files changed, 7 insertions, 1 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 1eda39ae0b..20a1c23586 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -1346,11 +1346,12 @@ void Gdi::drawStripC64Background(byte *dst, int stripnr, int height) {
height >>= 3;
for (int y = 0; y < height; y++) {
_C64Colors[3] = (_C64ColorMap[y + stripnr * height] & 7);
+ // Check for room color change in V1 zak
if (_vm->_roomPalette[0] == 255) {
- _vm->_roomPalette[0] = 0;
_C64Colors[2] = _vm->_roomPalette[2];
_C64Colors[1] = _vm->_roomPalette[1];
}
+
charIdx = _C64PicMap[y + stripnr * height] * 8;
for (int i = 0; i < 8; i++) {
byte c = _C64CharMap[charIdx + i];
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index a8cd5f3880..d6bf6f3a80 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -1334,6 +1334,7 @@ void Scumm_v2::o2_roomOps() {
break;
case 2: /* room color */
if (_version == 1) {
+ // V1 zak needs to know when room color is changed
_roomPalette[0] = 255;
_roomPalette[1] = a;
_roomPalette[2] = b;
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 0c9a196b51..12b4c8464e 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -1946,6 +1946,10 @@ void Scumm::initRoomSubBlocks() {
if (!roomptr || !roomResPtr)
error("Room %d: data not found (" __FILE__ ":%d)", _roomResource, __LINE__);
+ // Reset room color for V1 zak
+ if (_version == 1)
+ _roomPalette[0] = 0;
+
//
// Determine the room dimensions (width/height)
//