diff options
author | Alyssa Milburn | 2011-02-20 11:47:10 +0100 |
---|---|---|
committer | Alyssa Milburn | 2011-02-20 12:36:21 +0100 |
commit | 417dd6314b5355f74423cb2de22c18da1b0e968b (patch) | |
tree | 48000326bc6adba2be0f6db108b37dbcab48de4d | |
parent | adf6c8f09eab48f9268b9e96c1e546ea550fa810 (diff) | |
download | scummvm-rg350-417dd6314b5355f74423cb2de22c18da1b0e968b.tar.gz scummvm-rg350-417dd6314b5355f74423cb2de22c18da1b0e968b.tar.bz2 scummvm-rg350-417dd6314b5355f74423cb2de22c18da1b0e968b.zip |
MOHAWK: Fix LB palettes which don't start at 0.
(Thanks to LordHoto for pointing out this was crazy.)
-rw-r--r-- | engines/mohawk/livingbooks.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 29d282203c..a7af9ac711 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -2988,6 +2988,10 @@ void LBPaletteItem::readData(uint16 type, uint16 size, Common::SeekableSubReadSt if (_drawStart + _drawCount > 256) error("encountered palette trying to set more than 256 colors"); assert(size == 8 + _drawCount * 4); + + // TODO: _drawCount is really more like _drawEnd, so once we're sure that + // there's really no use for the palette entries before _drawCount, we + // might want to just discard them here, at load time. _palette = new byte[_drawCount * 3]; for (uint i = 0; i < _drawCount; i++) { _palette[i*3 + 0] = stream->readByte(); @@ -3032,7 +3036,7 @@ void LBPaletteItem::update() { // TODO: actual fading-in if (_visible && _globalVisible) { - _vm->_system->getPaletteManager()->setPalette(_palette + _drawStart * 3, _drawStart, _drawCount); + _vm->_system->getPaletteManager()->setPalette(_palette + _drawStart * 3, _drawStart, _drawCount - _drawStart); _vm->_needsRedraw = true; } } |