aboutsummaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorTorbjörn Andersson2014-01-01 19:48:17 +0100
committerTorbjörn Andersson2014-01-01 19:48:17 +0100
commit75806cd73c45278105ac4a3326ba7c80e86618ba (patch)
tree0e9d1684cc372d32819389c3bafdb7c042ffae3e /video
parent4dc80ffdfe9527865ffc5ce19233a200d94b0245 (diff)
downloadscummvm-rg350-75806cd73c45278105ac4a3326ba7c80e86618ba.tar.gz
scummvm-rg350-75806cd73c45278105ac4a3326ba7c80e86618ba.tar.bz2
scummvm-rg350-75806cd73c45278105ac4a3326ba7c80e86618ba.zip
VIDEO: Fix Smacker palette upscaling to match Multimedia Wiki
The Multimedia Wiki suggests using a lookup table, but this should produce the same result.
Diffstat (limited to 'video')
-rw-r--r--video/smk_decoder.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index 3dbcebcde4..868050e988 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -732,10 +732,11 @@ void SmackerDecoder::SmackerVideoTrack::unpackPalette(Common::SeekableReadStream
assert(g < 0xc0 && b < 0xc0);
- // upscale to full 8-bit color values by multiplying by 4
- *pal++ = b * 4;
- *pal++ = g * 4;
- *pal++ = r * 4;
+ // upscale to full 8-bit color values. The Multimedia Wiki suggests
+ // a lookup table for this, but this should produce the same result.
+ *pal++ = (b * 4 + b / 16);
+ *pal++ = (g * 4 + g / 16);
+ *pal++ = (r * 4 + r / 16);
}
}