From 9e0b1ca890fb0ae355bd2744f5a95d88455f69a0 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 5 Oct 2003 02:58:11 +0000 Subject: Use _roomPalette for 256 color 'SMALL_HEADER' games too, since it seems to help some. svn-id: r10599 --- scumm/gfx.cpp | 24 ++++++++++++------------ scumm/script_v5.cpp | 9 ++------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index f86b4e568d..381e6fb92a 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -1770,7 +1770,7 @@ void Gdi::unkDecodeA(byte *dst, const byte *src, int height) { int x = 8; do { FILL_BITS; - *dst++ = color + _palette_mod; + *dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod; againPos: if (!READ_BIT) { @@ -1819,7 +1819,7 @@ void Gdi::unkDecodeA_trans(byte *dst, const byte *src, int height) { do { FILL_BITS; if (color != _transparentColor) - *dst = color + _palette_mod; + *dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod; dst++; againPos: @@ -1870,7 +1870,7 @@ void Gdi::unkDecodeB(byte *dst, const byte *src, int height) { int x = 8; do { FILL_BITS; - *dst++ = color + _palette_mod; + *dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod; if (!READ_BIT) { } else if (!READ_BIT) { FILL_BITS; @@ -1901,7 +1901,7 @@ void Gdi::unkDecodeB_trans(byte *dst, const byte *src, int height) { do { FILL_BITS; if (color != _transparentColor) - *dst = color + _palette_mod; + *dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod; dst++; if (!READ_BIT) { } else if (!READ_BIT) { @@ -1933,7 +1933,7 @@ void Gdi::unkDecodeC(byte *dst, const byte *src, int height) { int h = height; do { FILL_BITS; - *dst = color + _palette_mod; + *dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod; dst += _vm->_screenWidth; if (!READ_BIT) { } else if (!READ_BIT) { @@ -1966,7 +1966,7 @@ void Gdi::unkDecodeC_trans(byte *dst, const byte *src, int height) { do { FILL_BITS; if (color != _transparentColor) - *dst = color + _palette_mod; + *dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod; dst += _vm->_screenWidth; if (!READ_BIT) { } else if (!READ_BIT) { @@ -2043,7 +2043,7 @@ void Gdi::unkDecode8(byte *dst, const byte *src, int height) { byte color = *src++; do { - *dst = color; + *dst = _vm->_roomPalette[color]; NEXT_ROW; } while (--run); } @@ -2072,7 +2072,7 @@ void Gdi::unkDecode9(byte *dst, const byte *src, int height) { color += bits << i; } for (i = 0; i < ((c & 3) + 2); i++) { - *dst = (run * 16 + color); + *dst = (run * 16 + _vm->_roomPalette[color]); NEXT_ROW; } break; @@ -2084,7 +2084,7 @@ void Gdi::unkDecode9(byte *dst, const byte *src, int height) { READ_256BIT; color += bits << j; } - *dst = (run * 16 + color); + *dst = (run * 16 + _vm->_roomPalette[color]); NEXT_ROW; } break; @@ -2113,13 +2113,13 @@ void Gdi::unkDecode10(byte *dst, const byte *src, int height) { for (;;) { byte color = *src++; if (color < numcolors) { - *dst = local_palette[color]; + *dst = local_palette[_vm->_roomPalette[color]]; NEXT_ROW; } else { uint run = color - numcolors + 1; color = *src++; do { - *dst = color; + *dst = _vm->_roomPalette[color]; NEXT_ROW; } while (--run); } @@ -2136,7 +2136,7 @@ void Gdi::unkDecode11(byte *dst, const byte *src, int height) { do { int h = height; do { - *dst = color; + *dst = _vm->_roomPalette[color]; dst += _vm->_screenWidth; for (i = 0; i < 3; i++) { READ_256BIT; diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 857883cfa2..670622aa6a 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -1834,13 +1834,8 @@ void ScummEngine_v5::o5_roomOps() { b = getVarOrDirectWord(0x40); } checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)"); - if (_features & GF_16COLOR) { - _roomPalette[b] = a; - _fullRedraw = true; - } else { - _shadowPalette[b] = a; - setDirtyColors(b, b); - } + _roomPalette[b] = a; + _fullRedraw = true; } else { error("room-color is no longer a valid command"); } -- cgit v1.2.3