From c620f1076dc50106350c881278ffba49b8c61c6f Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 24 Nov 2015 16:26:02 +0100 Subject: ACCESS: movie player: convert 6-bit pal properly --- engines/access/video/movie_decoder.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engines/access/video') 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; -- cgit v1.2.3