From 08641d688dfb003af01a342a27a847f8cf75f192 Mon Sep 17 00:00:00 2001 From: Iskrich Date: Fri, 20 May 2016 23:33:55 +0300 Subject: DIRECTOR: FIX load palette --- engines/director/dib.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'engines/director') diff --git a/engines/director/dib.cpp b/engines/director/dib.cpp index b59d688788..733d666ab2 100644 --- a/engines/director/dib.cpp +++ b/engines/director/dib.cpp @@ -59,24 +59,20 @@ void DIBDecoder::destroy() { } void DIBDecoder::loadPalette(Common::SeekableReadStream &stream) { - _palette = new byte[768]; uint16 steps = stream.size()/6; uint16 index = (steps * 3) - 1; + _palette = new byte[index]; for (uint8 i = 0; i < steps; i++) { - _palette[index--] = stream.readByte(); + _palette[index - 2] = stream.readByte(); stream.readByte(); - _palette[index--] = stream.readByte(); + _palette[index - 1] = stream.readByte(); stream.readByte(); - _palette[index--] = stream.readByte(); + _palette[index] = stream.readByte(); stream.readByte(); - } - - index = (steps * 3) - 1; - while (index < 768) { - _palette[index++] = 0; + index -= 3; } } -- cgit v1.2.3