aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-06-29 18:49:17 +0000
committerJohannes Schickel2009-06-29 18:49:17 +0000
commitcc0b30370ed19bdcfc4018f8892476e1f7ed45fc (patch)
tree6ef1eb75f5317ab829a51eab0df28769ad87cc37
parent67f69bcaf2a0e425eb0799683fc631213775aabb (diff)
downloadscummvm-rg350-cc0b30370ed19bdcfc4018f8892476e1f7ed45fc.tar.gz
scummvm-rg350-cc0b30370ed19bdcfc4018f8892476e1f7ed45fc.tar.bz2
scummvm-rg350-cc0b30370ed19bdcfc4018f8892476e1f7ed45fc.zip
Fix kyra2/kyra3 mouse cursor related regressions, introduced with r41959.
svn-id: r41960
-rw-r--r--engines/kyra/screen.cpp8
-rw-r--r--engines/kyra/screen.h1
-rw-r--r--engines/kyra/screen_lok.h2
-rw-r--r--engines/kyra/screen_lol.cpp2
4 files changed, 7 insertions, 6 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 84be942a1f..7f47fd9cf3 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -34,7 +34,8 @@
namespace Kyra {
Screen::Screen(KyraEngine_v1 *vm, OSystem *system)
- : _system(system), _vm(vm), _sjisInvisibleColor(0) {
+ : _system(system), _vm(vm), _sjisInvisibleColor(0),
+ _cursorColorKey((vm->gameFlags().gameID == GI_KYRA1) ? 0xFF : 0x00) {
_debugEnabled = false;
_maskMinY = _maskMaxY = -1;
}
@@ -2622,12 +2623,11 @@ void Screen::setMouseCursor(int x, int y, const byte *shape) {
y <<= 1;
mouseWidth <<= 1;
mouseHeight <<= 1;
- fillRect(mouseWidth, 0, mouseWidth, mouseHeight, 255, 8);
}
uint8 *cursor = new uint8[mouseHeight * mouseWidth];
- fillRect(0, 0, mouseWidth, mouseHeight, 255, 8);
+ fillRect(0, 0, mouseWidth, mouseHeight, _cursorColorKey, 8);
drawShape(8, shape, 0, 0, 0, 0);
int xOffset = 0;
@@ -2642,7 +2642,7 @@ void Screen::setMouseCursor(int x, int y, const byte *shape) {
CursorMan.showMouse(false);
copyRegionToBuffer(8, xOffset, 0, mouseWidth, mouseHeight, cursor);
- CursorMan.replaceCursor(cursor, mouseWidth, mouseHeight, x, y, 255);
+ CursorMan.replaceCursor(cursor, mouseWidth, mouseHeight, x, y, _cursorColorKey);
if (isMouseVisible())
CursorMan.showMouse(true);
delete[] cursor;
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 3d2bda3b59..390d058bb8 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -398,6 +398,7 @@ protected:
// mouse handling
int _mouseLockCount;
+ const uint8 _cursorColorKey;
virtual void postProcessCursor(uint8 *data, int w, int h, int pitch) {};
diff --git a/engines/kyra/screen_lok.h b/engines/kyra/screen_lok.h
index f845261f29..4eb22df374 100644
--- a/engines/kyra/screen_lok.h
+++ b/engines/kyra/screen_lok.h
@@ -91,7 +91,7 @@ private:
void convertTo16Colors(uint8 *page, int w, int h, int pitch, int keyColor = -1);
void postProcessCursor(uint8 *data, int width, int height, int pitch) {
- convertTo16Colors(data, width, height, pitch, 255);
+ convertTo16Colors(data, width, height, pitch, _cursorColorKey);
}
void mergeOverlay(int x, int y, int w, int h);
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp
index ad7061dd97..5453ee0e75 100644
--- a/engines/kyra/screen_lol.cpp
+++ b/engines/kyra/screen_lol.cpp
@@ -997,7 +997,7 @@ void Screen_LoL::convertPC98Gfx(uint8 *data, int w, int h, int pitch) {
void Screen_LoL::postProcessCursor(uint8 *data, int w, int h, int pitch) {
while (h--) {
for (int i = 0; i < w; ++i) {
- if (*data != 255)
+ if (*data != _cursorColorKey)
*data = _paletteConvTable[*data];
++data;
}