[Scummvm-cvs-logs] SF.net SVN: scummvm:[35713] scummvm/trunk/engines/scumm
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Sun Jan 4 01:58:45 CET 2009
Revision: 35713
http://scummvm.svn.sourceforge.net/scummvm/?rev=35713&view=rev
Author: Kirben
Date: 2009-01-04 00:58:45 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
Use slow palette color match, for 16bit color HE games for now.
Modified Paths:
--------------
scummvm/trunk/engines/scumm/akos.cpp
scummvm/trunk/engines/scumm/akos.h
scummvm/trunk/engines/scumm/he/wiz_he.cpp
scummvm/trunk/engines/scumm/he/wiz_he.h
scummvm/trunk/engines/scumm/palette.cpp
Modified: scummvm/trunk/engines/scumm/akos.cpp
===================================================================
--- scummvm/trunk/engines/scumm/akos.cpp 2009-01-03 22:15:07 UTC (rev 35712)
+++ scummvm/trunk/engines/scumm/akos.cpp 2009-01-04 00:58:45 UTC (rev 35713)
@@ -303,6 +303,19 @@
if (_vm->_game.heversion >= 99 && _paletteNum) {
for (i = 0; i < size; i++)
_palette[i] = (byte)_vm->_hePalettes[_paletteNum * 1024 + 768 + akpl[i]];
+ } else if (_vm->_game.heversion >= 99 && rgbs) {
+ for (i = 0; i < size; i++) {
+ if (new_palette[i] == 0xFF) {
+ uint8 col = akpl[i];
+ uint8 r = rgbs[col * 3 + 0];
+ uint8 g = rgbs[col * 3 + 1];
+ uint8 b = rgbs[col * 3 + 2];
+
+ _palette[i] = _vm->remapPaletteColor(r, g, b, -1);
+ } else {
+ _palette[i] = new_palette[i];
+ }
+ }
} else {
for (i = 0; i < size; i++) {
_palette[i] = new_palette[i] != 0xFF ? new_palette[i] : akpl[i];
@@ -336,6 +349,7 @@
akpl = _vm->findResourceData(MKID_BE('AKPL'), akos);
_codec = READ_LE_UINT16(&akhd->codec);
akct = _vm->findResourceData(MKID_BE('AKCT'), akos);
+ rgbs = _vm->findResourceData(MKID_BE('RGBS'), akos);
xmap = 0;
if (shadow) {
Modified: scummvm/trunk/engines/scumm/akos.h
===================================================================
--- scummvm/trunk/engines/scumm/akos.h 2009-01-03 22:15:07 UTC (rev 35712)
+++ scummvm/trunk/engines/scumm/akos.h 2009-01-04 00:58:45 UTC (rev 35713)
@@ -73,7 +73,8 @@
const byte *akcd; // costume data (contains the data for the codecs)
const byte *akct; // HE specific: condition table
- const uint8 *xmap; // HE specific: shadow color table ?!?
+ const byte *rgbs; // HE specific: RGB table
+ const uint8 *xmap; // HE specific: shadow color table
struct {
bool repeatMode;
@@ -97,6 +98,7 @@
akof = 0;
akcd = 0;
akct = 0;
+ rgbs = 0;
xmap = 0;
_actorHitMode = false;
}
Modified: scummvm/trunk/engines/scumm/he/wiz_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/wiz_he.cpp 2009-01-03 22:15:07 UTC (rev 35712)
+++ scummvm/trunk/engines/scumm/he/wiz_he.cpp 2009-01-04 00:58:45 UTC (rev 35713)
@@ -570,7 +570,12 @@
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 @@
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 @@
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];
}
Modified: scummvm/trunk/engines/scumm/he/wiz_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/wiz_he.h 2009-01-03 22:15:07 UTC (rev 35712)
+++ scummvm/trunk/engines/scumm/he/wiz_he.h 2009-01-04 00:58:45 UTC (rev 35713)
@@ -203,11 +203,11 @@
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);
Modified: scummvm/trunk/engines/scumm/palette.cpp
===================================================================
--- scummvm/trunk/engines/scumm/palette.cpp 2009-01-03 22:15:07 UTC (rev 35712)
+++ scummvm/trunk/engines/scumm/palette.cpp 2009-01-04 00:58:45 UTC (rev 35713)
@@ -811,12 +811,16 @@
int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
- int i;
- int ar, ag, ab;
+ byte *pal;
+ int ar, ag, ab, i;
uint sum, bestsum, bestitem = 0;
int startColor = (_game.version == 8) ? 24 : 1;
- byte *pal = _currentPalette + startColor * 3;
+
+ if (_game.heversion >= 99)
+ pal = _hePalettes + 1024 + startColor * 3;
+ else
+ pal = _currentPalette + startColor * 3;
if (r > 255)
r = 255;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list