diff options
author | Travis Howell | 2009-08-16 00:20:23 +0000 |
---|---|---|
committer | Travis Howell | 2009-08-16 00:20:23 +0000 |
commit | 09845556e0383fb187f548c7cfc1a68b22329f7e (patch) | |
tree | 01f49c1d3da2c69a9172d80a0ad421997c3d93ec /engines/scumm/palette.cpp | |
parent | 8e417b0884e676ff5fe297d1642c9d8499ad9b90 (diff) | |
download | scummvm-rg350-09845556e0383fb187f548c7cfc1a68b22329f7e.tar.gz scummvm-rg350-09845556e0383fb187f548c7cfc1a68b22329f7e.tar.bz2 scummvm-rg350-09845556e0383fb187f548c7cfc1a68b22329f7e.zip |
Revert revision 43410, and add alternative fix.
svn-id: r43416
Diffstat (limited to 'engines/scumm/palette.cpp')
-rw-r--r-- | engines/scumm/palette.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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) { |