aboutsummaryrefslogtreecommitdiff
path: root/engines/director/dib.cpp
diff options
context:
space:
mode:
authorIskrich2016-05-20 23:33:55 +0300
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commit08641d688dfb003af01a342a27a847f8cf75f192 (patch)
treea883150ab045a7c52a09a1c7ae77582bfb1f740a /engines/director/dib.cpp
parent9ed9a601165977780c45a562f38f36787918fe6d (diff)
downloadscummvm-rg350-08641d688dfb003af01a342a27a847f8cf75f192.tar.gz
scummvm-rg350-08641d688dfb003af01a342a27a847f8cf75f192.tar.bz2
scummvm-rg350-08641d688dfb003af01a342a27a847f8cf75f192.zip
DIRECTOR: FIX load palette
Diffstat (limited to 'engines/director/dib.cpp')
-rw-r--r--engines/director/dib.cpp14
1 files changed, 5 insertions, 9 deletions
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;
}
}