From 3a64d35dfd9126d7912c4d4496030f7ed120d660 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 4 Jun 2009 01:05:47 +0000 Subject: Add 16bit color support for later HE games. svn-id: r41153 --- engines/scumm/palette.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'engines/scumm/palette.cpp') diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index a2cd4a0d4d..c6ec85cd88 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -310,9 +310,6 @@ void ScummEngine::setDirtyColors(int min, int max) { _palDirtyMin = min; if (_palDirtyMax < max) _palDirtyMax = max; - - if (_hePaletteCache) - memset(_hePaletteCache, -1, 65536); } void ScummEngine::initCycl(const byte *ptr) { @@ -813,16 +810,6 @@ void ScummEngine_v8::desaturatePalette(int hueScale, int satScale, int lightScal #endif -int ScummEngine::convert16BitColor(uint16 color, uint8 r, uint8 g, uint8 b) { - // HACK: Find the closest matching color, and store in - // cache for faster access. - if (_hePaletteCache[color] == -1) { - _hePaletteCache[color] = remapPaletteColor(r, g, b, -1); - } - - return _hePaletteCache[color]; -} - int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) { byte *pal; int ar, ag, ab, i; -- cgit v1.2.3 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/palette.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'engines/scumm/palette.cpp') 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