From 92fac11c5feb21e16d8a7b895cc14ec4f3173d46 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Sat, 19 Feb 2011 23:12:53 +0100 Subject: MOHAWK: Update LBPaletteItem for RGB palettes. --- engines/mohawk/livingbooks.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'engines/mohawk') 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; } } -- cgit v1.2.3