diff options
author | Travis Howell | 2009-01-04 00:58:45 +0000 |
---|---|---|
committer | Travis Howell | 2009-01-04 00:58:45 +0000 |
commit | 4670e37a78409bfe9279c5d73c8d581f0d66143e (patch) | |
tree | 3bf9094f7ff49bb7a81488a22a2f28d0d5916f8f /engines/scumm/he | |
parent | 3a4b4831dce092ac04f0756b48c3d73c8638449c (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/scumm/he/wiz_he.cpp | 21 | ||||
-rw-r--r-- | engines/scumm/he/wiz_he.h | 6 |
2 files changed, 21 insertions, 6 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]; } diff --git a/engines/scumm/he/wiz_he.h b/engines/scumm/he/wiz_he.h index b2baf8f2b0..86df15c3e6 100644 --- a/engines/scumm/he/wiz_he.h +++ b/engines/scumm/he/wiz_he.h @@ -203,11 +203,11 @@ public: static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch); static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags = 0, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); static void copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP); - static void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags = 0, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); + void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags = 0, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor); - static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor); + void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor); template<int type> static void decompressWizImage(uint8 *dst, int dstPitch, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); - template<int type> static void decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); + template<int type> void decompress16BitWizImage(uint8 *dst, int dstPitch, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); template<int type> static void decompressRawWizImage(uint8 *dst, int dstPitch, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr = NULL); int isWizPixelNonTransparent(const uint8 *data, int x, int y, int w, int h, uint bitdepth); uint8 getWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint bitDepth, uint8 color); |