[Scummvm-cvs-logs] SF.net SVN: scummvm:[46064] scummvm/trunk/engines/scumm
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Sun Nov 22 09:36:14 CET 2009
Revision: 46064
http://scummvm.svn.sourceforge.net/scummvm/?rev=46064&view=rev
Author: Kirben
Date: 2009-11-22 08:36:14 +0000 (Sun, 22 Nov 2009)
Log Message:
-----------
Fix charset palette in PCE version of Loom, based on information from Tobias.
Modified Paths:
--------------
scummvm/trunk/engines/scumm/charset.cpp
scummvm/trunk/engines/scumm/charset.h
scummvm/trunk/engines/scumm/gfx.cpp
scummvm/trunk/engines/scumm/palette.cpp
scummvm/trunk/engines/scumm/scumm.h
Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp 2009-11-22 08:36:05 UTC (rev 46063)
+++ scummvm/trunk/engines/scumm/charset.cpp 2009-11-22 08:36:14 UTC (rev 46064)
@@ -620,6 +620,13 @@
translateColor();
}
+void CharsetRendererPCE::setColor(byte color) {
+ _vm->setPCETextPalette(color);
+ _color = 15;
+
+ enableShadow(true);
+}
+
void CharsetRendererCommon::enableShadow(bool enable) {
if (enable) {
if (_vm->_game.platform == Common::kPlatformFMTowns) {
Modified: scummvm/trunk/engines/scumm/charset.h
===================================================================
--- scummvm/trunk/engines/scumm/charset.h 2009-11-22 08:36:05 UTC (rev 46063)
+++ scummvm/trunk/engines/scumm/charset.h 2009-11-22 08:36:14 UTC (rev 46064)
@@ -170,6 +170,8 @@
public:
CharsetRendererPCE(ScummEngine *vm) : CharsetRendererV3(vm) {}
+
+ void setColor(byte color);
};
class CharsetRendererV2 : public CharsetRendererV3 {
Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp 2009-11-22 08:36:05 UTC (rev 46063)
+++ scummvm/trunk/engines/scumm/gfx.cpp 2009-11-22 08:36:14 UTC (rev 46064)
@@ -643,9 +643,14 @@
for (int h = 0; h < height * m; ++h) {
for (int w = 0; w < width * m; ++w) {
uint16 tmp = *textPtr++;
- if (tmp == CHARSET_MASK_TRANSPARENCY)
+ if (tmp == CHARSET_MASK_TRANSPARENCY) {
tmp = READ_UINT16(srcPtr);
- WRITE_UINT16(dstPtr, tmp); dstPtr += 2;
+ WRITE_UINT16(dstPtr, tmp); dstPtr += 2;
+ } else if (_game.heversion != 0) {
+ error ("16Bit Color HE Game using old charset");
+ } else {
+ WRITE_UINT16(dstPtr, _16BitPalette[tmp]); dstPtr += 2;
+ }
srcPtr += vs->bytesPerPixel;
}
srcPtr += vsPitch;
Modified: scummvm/trunk/engines/scumm/palette.cpp
===================================================================
--- scummvm/trunk/engines/scumm/palette.cpp 2009-11-22 08:36:05 UTC (rev 46063)
+++ scummvm/trunk/engines/scumm/palette.cpp 2009-11-22 08:36:14 UTC (rev 46064)
@@ -209,6 +209,17 @@
*g = ((color >> 6) & 0x7) << 5;
}
+void ScummEngine::setPCETextPalette(uint8 color) {
+ const uint16 CHARSET_COLORS[16] = {
+ 0x0000, 0x0096, 0x0140, 0x0145, 0x0059, 0x002D, 0x00A8, 0x016D,
+ 0x0092, 0x016F, 0x01CD, 0x01DF, 0x00F7, 0x00B6, 0x01B0, 0x01B6
+ };
+
+ byte r, g, b;
+ colorPCEToRGB(CHARSET_COLORS[color], &r, &g, &b);
+ setPalColor(15, r, g, b);
+}
+
void ScummEngine::readPCEPalette(const byte **ptr, byte **dest, int numEntries) {
byte r, g, b;
byte msbs = 0;
Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h 2009-11-22 08:36:05 UTC (rev 46063)
+++ scummvm/trunk/engines/scumm/scumm.h 2009-11-22 08:36:14 UTC (rev 46064)
@@ -1050,6 +1050,7 @@
uint16 get16BitColor(uint8 r, uint8 g, uint8 b);
int remapPaletteColor(int r, int g, int b, int threshold); // Used by Actor::remapActorPalette
void readPCEPalette(const byte **ptr, byte **dest, int numEntries);
+ void setPCETextPalette(uint8 color);
protected:
void moveMemInPalRes(int start, int end, byte direction);
void setShadowPalette(int slot, int redScale, int greenScale, int blueScale, int startColor, int endColor);
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