aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2009-11-22 08:55:36 +0000
committerTravis Howell2009-11-22 08:55:36 +0000
commitd81bb78053453b02e36b1aa7b2a972931ddbd549 (patch)
treeb95aafa22f07bd903def2d87d95d66fde73f68d9
parentd5d3ca66ce174e8c0b95c288f991a047f2f718d7 (diff)
downloadscummvm-rg350-d81bb78053453b02e36b1aa7b2a972931ddbd549.tar.gz
scummvm-rg350-d81bb78053453b02e36b1aa7b2a972931ddbd549.tar.bz2
scummvm-rg350-d81bb78053453b02e36b1aa7b2a972931ddbd549.zip
Add patch for Tobias, for cursor palette in PCE version of Loom.
svn-id: r46066
-rw-r--r--engines/scumm/cursor.cpp17
-rw-r--r--engines/scumm/palette.cpp2
-rw-r--r--engines/scumm/scumm.h1
3 files changed, 17 insertions, 3 deletions
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 55f3af45ad..a998402474 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -44,6 +44,10 @@ static const byte default_v1_cursor_colors[4] = {
1, 1, 12, 11
};
+static const uint16 default_pce_cursor_colors[4] = {
+ 0x01FF, 0x016D, 0x0000, 0x0092
+};
+
static const byte default_cursor_colors[4] = {
15, 15, 7, 8
};
@@ -533,13 +537,22 @@ void ScummEngine_v5::resetCursors() {
void ScummEngine_v5::setBuiltinCursor(int idx) {
int i, j;
- byte color = default_cursor_colors[idx];
+ uint16 color;
const uint16 *src = _cursorImages[_currentCursor];
if (_bytesPerPixel == 2) {
+ if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) {
+ byte r, g, b;
+ colorPCEToRGB(default_pce_cursor_colors[idx], &r, &g, &b);
+ color = get16BitColor(r, g, b);
+ } else {
+ color = _16BitPalette[default_cursor_colors[idx]];
+ }
+
for (i = 0; i < 1024; i++)
WRITE_UINT16(_grabbedCursor + i * 2, 0xFF);
} else {
+ color = default_cursor_colors[idx];
memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
}
@@ -552,7 +565,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) {
for (j = 0; j < 16; j++) {
if (src[i] & (1 << j)) {
if (_bytesPerPixel == 2)
- WRITE_UINT16(_grabbedCursor + 32 * i + (15 - j) * 2, _16BitPalette[color]);
+ WRITE_UINT16(_grabbedCursor + 32 * i + (15 - j) * 2, color);
else
_grabbedCursor[16 * i + 15 - j] = color;
}
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 18b6b3e383..8be707c281 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -202,7 +202,7 @@ void ScummEngine::setPaletteFromTable(const byte *ptr, int numcolor, int index)
setPalColor( index, ptr[0], ptr[1], ptr[2]);
}
-void colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b) {
+void ScummEngine::colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b) {
// 3 bits for each color component: 0xgggrrrbbb
*b = ((color) & 0x7) * 0xFF / 0x7;
*r = ((color >> 3) & 0x7) * 0xFF / 0x7;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 882b2023c6..d903e883af 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 colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b);
void setPCETextPalette(uint8 color);
protected:
void moveMemInPalRes(int start, int end, byte direction);