aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/charset.cpp7
-rw-r--r--engines/scumm/charset.h2
-rw-r--r--engines/scumm/gfx.cpp9
-rw-r--r--engines/scumm/palette.cpp11
-rw-r--r--engines/scumm/scumm.h1
5 files changed, 28 insertions, 2 deletions
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 00c1f194ca..b248b5cb6d 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -620,6 +620,13 @@ void CharsetRendererV3::setColor(byte color) {
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) {
diff --git a/engines/scumm/charset.h b/engines/scumm/charset.h
index 4b6d5a98f9..8071160e7b 100644
--- a/engines/scumm/charset.h
+++ b/engines/scumm/charset.h
@@ -170,6 +170,8 @@ protected:
public:
CharsetRendererPCE(ScummEngine *vm) : CharsetRendererV3(vm) {}
+
+ void setColor(byte color);
};
class CharsetRendererV2 : public CharsetRendererV3 {
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 651bbec1ab..2d284e8e7c 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -643,9 +643,14 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
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;
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 1b0edd743d..467ed9617c 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -209,6 +209,17 @@ void colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b) {
*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;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 3bc59eb63f..882b2023c6 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1050,6 +1050,7 @@ public:
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);