aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/cursor.cpp
diff options
context:
space:
mode:
authorJody Northup2009-06-05 23:59:40 +0000
committerJody Northup2009-06-05 23:59:40 +0000
commitd65bbe1d7a5efbcf04831dbb68a45ca833db1ae1 (patch)
tree9061e150b7671af93508c1017381e8d7ba3cad3d /engines/scumm/cursor.cpp
parentccee18a489ece14c499c4e0c43aeb7fc216451fb (diff)
downloadscummvm-rg350-d65bbe1d7a5efbcf04831dbb68a45ca833db1ae1.tar.gz
scummvm-rg350-d65bbe1d7a5efbcf04831dbb68a45ca833db1ae1.tar.bz2
scummvm-rg350-d65bbe1d7a5efbcf04831dbb68a45ca833db1ae1.zip
Fixes ScummEngine_v70he::setDefaultCursor to work in 16-bit, using a temporary hack.
svn-id: r41204
Diffstat (limited to 'engines/scumm/cursor.cpp')
-rw-r--r--engines/scumm/cursor.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index 3710956b74..5ec9e63e32 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -112,7 +112,7 @@ void ScummEngine_v6::setCursorTransparency(int a) {
void ScummEngine::updateCursor() {
int transColor = (_game.heversion >= 80) ? 5 : 255;
- if (_game.features & GF_16BIT_COLOR && _hePalettes) {
+ if (_game.features & GF_16BIT_COLOR) {
//HACK Had to make a second method to avoid many, many linker errors from other engines
//this requires ENABLE_16BIT to be defined in the Scumm project, again, because I #ifdef'ed
//the method's definition and declaration in cursorman.h
@@ -176,8 +176,13 @@ void ScummEngine_v70he::setDefaultCursor() {
static const byte palette[] = {0, 0, 0, 0,
0xff, 0xff, 0xff, 0,
0, 0, 0, 0};
-
- memset(_grabbedCursor, 5, sizeof(_grabbedCursor));
+
+ if (_bitDepth == 2) {
+ for (i = 0; i < 1024; i++)
+ WRITE_UINT16(_grabbedCursor + i * 2, 5);
+ } else {
+ memset(_grabbedCursor, 5, sizeof(_grabbedCursor));
+ }
_cursor.hotspotX = _cursor.hotspotY = 2;
src = default_he_cursor;
@@ -190,10 +195,16 @@ void ScummEngine_v70he::setDefaultCursor() {
for (j = 0; j < 32; j++) {
switch ((p & (0x3 << 14)) >> 14) {
case 1:
- _grabbedCursor[32 * i + j] = 0xfe;
+ if (_bitDepth == 2)
+ WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[4], palette[5], palette[6]));
+ else
+ _grabbedCursor[32 * i + j] = 0xfe;
break;
case 2:
- _grabbedCursor[32 * i + j] = 0xfd;
+ if (_bitDepth == 2)
+ WRITE_UINT16(_grabbedCursor + 64 * i + j * 2, get16BitColor(palette[0], palette[1], palette[2]));
+ else
+ _grabbedCursor[32 * i + j] = 0xfd;
break;
default:
break;
@@ -205,9 +216,11 @@ void ScummEngine_v70he::setDefaultCursor() {
}
}
- // Since white color position is not guaranteed
- // we setup our own palette if supported by backend
- CursorMan.replaceCursorPalette(palette, 0xfd, 3);
+ if (_bitDepth == 1) {
+ // Since white color position is not guaranteed
+ // we setup our own palette if supported by backend
+ CursorMan.replaceCursorPalette(palette, 0xfd, 3);
+ }
updateCursor();
}