aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/wiz_he.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-01-04 00:58:45 +0000
committerTravis Howell2009-01-04 00:58:45 +0000
commit4670e37a78409bfe9279c5d73c8d581f0d66143e (patch)
tree3bf9094f7ff49bb7a81488a22a2f28d0d5916f8f /engines/scumm/he/wiz_he.cpp
parent3a4b4831dce092ac04f0756b48c3d73c8638449c (diff)
downloadscummvm-rg350-4670e37a78409bfe9279c5d73c8d581f0d66143e.tar.gz
scummvm-rg350-4670e37a78409bfe9279c5d73c8d581f0d66143e.tar.bz2
scummvm-rg350-4670e37a78409bfe9279c5d73c8d581f0d66143e.zip
Use slow palette color match, for 16bit color HE games for now.
svn-id: r35713
Diffstat (limited to 'engines/scumm/he/wiz_he.cpp')
-rw-r--r--engines/scumm/he/wiz_he.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index c2637e9526..fb1eb28765 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -570,7 +570,12 @@ void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth,
dst += r2.left + r2.top * dstw;
while (h--) {
for (int i = 0; i < w; ++i) {
- uint16 col = READ_LE_UINT16(src + 2 * i) / 256;
+ uint16 col = READ_LE_UINT16(src + 2 * i);
+ uint8 r = ((col >> 10) & 0x1F) << 3;
+ uint8 g = ((col >> 5) & 0x1F) << 3;
+ uint8 b = ((col >> 0) & 0x1F) << 3;
+ col = _vm->remapPaletteColor(r, g, b, -1);
+
if (transColor == -1 || transColor != col) {
dst[i] = palPtr[col];
}
@@ -653,7 +658,12 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, co
code += w;
}
while (code--) {
- uint16 col = READ_LE_UINT16(dataPtr) / 256;
+ uint16 col = READ_LE_UINT16(dataPtr);
+ uint8 r = ((col >> 10) & 0x1F) << 3;
+ uint8 g = ((col >> 5) & 0x1F) << 3;
+ uint8 b = ((col >> 0) & 0x1F) << 3;
+ col = _vm->remapPaletteColor(r, g, b, -1);
+
if (type == kWizXMap) {
*dstPtr = xmapPtr[col * 256 + *dstPtr];
}
@@ -682,7 +692,12 @@ void Wiz::decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, co
code += w;
}
while (code--) {
- uint16 col = READ_LE_UINT16(dataPtr) / 256;
+ uint16 col = READ_LE_UINT16(dataPtr);
+ uint8 r = ((col >> 10) & 0x1F) << 3;
+ uint8 g = ((col >> 5) & 0x1F) << 3;
+ uint8 b = ((col >> 0) & 0x1F) << 3;
+ col = _vm->remapPaletteColor(r, g, b, -1);
+
if (type == kWizXMap) {
*dstPtr = xmapPtr[col * 256 + *dstPtr];
}