From 09845556e0383fb187f548c7cfc1a68b22329f7e Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 16 Aug 2009 00:20:23 +0000 Subject: Revert revision 43410, and add alternative fix. svn-id: r43416 --- engines/scumm/akos.cpp | 4 ---- engines/scumm/cursor.cpp | 4 ---- engines/scumm/he/palette_he.cpp | 21 --------------------- engines/scumm/palette.cpp | 21 +++++++++++++++++++++ 4 files changed, 21 insertions(+), 29 deletions(-) (limited to 'engines') diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index c7f53b9763..f4bb8a2c8b 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -299,7 +299,6 @@ void AkosRenderer::setPalette(uint16 *new_palette) { if (size > 256) error("akos_setPalette: %d is too many colors", size); -#ifdef ENABLE_HE if (_vm->_game.features & GF_16BIT_COLOR) { if (_paletteNum) { for (i = 0; i < size; i++) @@ -318,13 +317,10 @@ void AkosRenderer::setPalette(uint16 *new_palette) { for (i = 0; i < size; i++) _palette[i] = (byte)_vm->_hePalettes[_paletteNum * _vm->_hePaletteSlot + 768 + akpl[i]]; } else { -#endif for (i = 0; i < size; i++) { _palette[i] = new_palette[i] != 0xFF ? new_palette[i] : akpl[i]; } -#ifdef ENABLE_HE } -#endif if (_vm->_game.heversion == 70) { for (i = 0; i < size; i++) diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 5af25e95ef..66ac68bd95 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -194,19 +194,15 @@ void ScummEngine_v70he::setDefaultCursor() { for (j = 0; j < 32; j++) { switch ((p & (0x3 << 14)) >> 14) { case 1: -#ifdef ENABLE_HE if (_bitDepth == 2) WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[4], palette[5], palette[6])); else -#endif _grabbedCursor[32 * i + j] = 0xfe; break; case 2: -#ifdef ENABLE_HE if (_bitDepth == 2) WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[0], palette[1], palette[2])); else -#endif _grabbedCursor[32 * i + j] = 0xfd; break; default: diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp index 02f3f3fc5c..ff29f9ecd0 100644 --- a/engines/scumm/he/palette_he.cpp +++ b/engines/scumm/he/palette_he.cpp @@ -33,27 +33,6 @@ namespace Scumm { -uint8 *ScummEngine::getHEPaletteSlot(uint16 palSlot) { - assertRange(0, palSlot, _numPalettes, "palette"); - - if (_game.heversion >= 99) { - if (palSlot) - return _hePalettes + palSlot * _hePaletteSlot + 768; - else - return _hePalettes + _hePaletteSlot + 768; - } - - return NULL; -} - -uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) { - uint16 ar = (r >> 3) << 10; - uint16 ag = (g >> 3) << 5; - uint16 ab = (b >> 3) << 0; - uint16 col = ar | ag | ab; - return col; -} - void ScummEngine_v71he::remapHEPalette(const uint8 *src, uint8 *dst) { int r, g, b, sum, bestitem, bestsum; int ar, ag, ab; diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index f59b59b40f..a596cc5b1a 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -33,6 +33,27 @@ namespace Scumm { +uint8 *ScummEngine::getHEPaletteSlot(uint16 palSlot) { + assertRange(0, palSlot, _numPalettes, "palette"); + + if (_game.heversion >= 99) { + if (palSlot) + return _hePalettes + palSlot * _hePaletteSlot + 768; + else + return _hePalettes + _hePaletteSlot + 768; + } + + return NULL; +} + +uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) { + uint16 ar = (r >> 3) << 10; + uint16 ag = (g >> 3) << 5; + uint16 ab = (b >> 3) << 0; + uint16 col = ar | ag | ab; + return col; +} + void ScummEngine::resetPalette() { if (_game.version <= 1) { if (_game.platform == Common::kPlatformApple2GS) { -- cgit v1.2.3