aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-02-19 23:12:53 +0100
committerAlyssa Milburn2011-02-19 23:12:53 +0100
commit92fac11c5feb21e16d8a7b895cc14ec4f3173d46 (patch)
treebed2fed617466a30e9eb0bc35616b5093f09c470 /engines/mohawk
parentaccab0e00f82ce1fe081c4f71fdab6326417620c (diff)
downloadscummvm-rg350-92fac11c5feb21e16d8a7b895cc14ec4f3173d46.tar.gz
scummvm-rg350-92fac11c5feb21e16d8a7b895cc14ec4f3173d46.tar.bz2
scummvm-rg350-92fac11c5feb21e16d8a7b895cc14ec4f3173d46.zip
MOHAWK: Update LBPaletteItem for RGB palettes.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/livingbooks.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 45c430e7e8..29d282203c 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -2988,8 +2988,13 @@ 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);
- _palette = new byte[_drawCount * 4];
- stream->read(_palette, _drawCount * 4);
+ _palette = new byte[_drawCount * 3];
+ for (uint i = 0; i < _drawCount; i++) {
+ _palette[i*3 + 0] = stream->readByte();
+ _palette[i*3 + 1] = stream->readByte();
+ _palette[i*3 + 2] = stream->readByte();
+ stream->readByte();
+ }
}
break;
@@ -3027,7 +3032,7 @@ void LBPaletteItem::update() {
// TODO: actual fading-in
if (_visible && _globalVisible) {
- _vm->_system->getPaletteManager()->setPalette(_palette + _drawStart * 4, _drawStart, _drawCount);
+ _vm->_system->getPaletteManager()->setPalette(_palette + _drawStart * 3, _drawStart, _drawCount);
_vm->_needsRedraw = true;
}
}