From cc0b30370ed19bdcfc4018f8892476e1f7ed45fc Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 29 Jun 2009 18:49:17 +0000 Subject: Fix kyra2/kyra3 mouse cursor related regressions, introduced with r41959. svn-id: r41960 --- engines/kyra/screen.cpp | 8 ++++---- engines/kyra/screen.h | 1 + engines/kyra/screen_lok.h | 2 +- engines/kyra/screen_lol.cpp | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'engines/kyra') 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; } -- cgit v1.2.3