aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2015-11-24 16:26:02 +0100
committerMartin Kiewitz2015-11-24 16:26:02 +0100
commitc620f1076dc50106350c881278ffba49b8c61c6f (patch)
treedef82e4bce2c94ada43787644a882e81ea2f445e
parent85ebe4c8e0ceab6bf3177add007ae1278586df3c (diff)
downloadscummvm-rg350-c620f1076dc50106350c881278ffba49b8c61c6f.tar.gz
scummvm-rg350-c620f1076dc50106350c881278ffba49b8c61c6f.tar.bz2
scummvm-rg350-c620f1076dc50106350c881278ffba49b8c61c6f.zip
ACCESS: movie player: convert 6-bit pal properly
-rw-r--r--engines/access/video/movie_decoder.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/access/video/movie_decoder.cpp b/engines/access/video/movie_decoder.cpp
index c67dac6379..3e1a4962c0 100644
--- a/engines/access/video/movie_decoder.cpp
+++ b/engines/access/video/movie_decoder.cpp
@@ -617,13 +617,17 @@ bool AccessVIDMovieDecoder::StreamVideoTrack::skipOverPalette(Common::SeekableRe
}
void AccessVIDMovieDecoder::StreamVideoTrack::decodePalette(Common::SeekableReadStream *stream) {
+ byte red, green, blue;
assert(stream);
// VID files use a 6-bit palette and not a 8-bit one, we change it to 8-bit
for (uint16 curColor = 0; curColor < 256; curColor++) {
- _palette[curColor * 3] = stream->readByte() << 2;
- _palette[curColor * 3 + 1] = stream->readByte() << 2;
- _palette[curColor * 3 + 2] = stream->readByte() << 2;
+ red = stream->readByte() & 0x3F;
+ green = stream->readByte() & 0x3F;
+ blue = stream->readByte() & 0x3F;
+ _palette[curColor * 3] = (red << 2) | (red >> 4);
+ _palette[curColor * 3 + 1] = (green << 2) | (green >> 4);
+ _palette[curColor * 3 + 2] = (blue << 2) | (blue >> 4);
}
_dirtyPalette = true;