From 4087a3e6e8ebc0b519fc4c178a29696bd64fdd6f Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 6 Jun 2009 08:02:45 +0000 Subject: Corrected 16-bit cursor blit errors on GFX mode change. svn-id: r41212 --- backends/platform/sdl/graphics.cpp | 18 +++++++++++++++++- backends/platform/sdl/sdl.cpp | 2 +- backends/platform/sdl/sdl.h | 7 +++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 8ecf4ecda1..81e137e19c 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -332,7 +332,11 @@ void OSystem_SDL::setGraphicsModeIntern() { // Even if the old and new scale factors are the same, we may have a // different scaler for the cursor now. +#ifdef ENABLE_16BIT + blitCursor(_cursorBitDepth); +#else blitCursor(); +#endif } int OSystem_SDL::getGraphicsMode() const { @@ -600,7 +604,11 @@ bool OSystem_SDL::hotswapGFXMode() { SDL_FreeSurface(old_overlayscreen); // Update cursor to new scale +#ifdef ENABLE_16BIT + blitCursor(_cursorBitDepth); +#else blitCursor(); +#endif // Blit everything to the screen internUpdateScreen(); @@ -1163,7 +1171,11 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) { // Some games blink cursors with palette if (_cursorPaletteDisabled) +#ifdef ENABLE_16BIT + blitCursor(_cursorBitDepth); +#else blitCursor(); +#endif } void OSystem_SDL::grabPalette(byte *colors, uint start, uint num) { @@ -1192,7 +1204,11 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) { _cursorPaletteDisabled = false; +#ifdef ENABLE_16BIT + blitCursor(_cursorBitDepth); +#else blitCursor(); +#endif } void OSystem_SDL::setShakePos(int shake_pos) { @@ -1412,7 +1428,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, colmask |= 0xFF; } keycolor &= colmask; - + _cursorBitDepth = bitDepth; #else void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) { #endif diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index b91d6938a2..3e8cefc86a 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -197,7 +197,7 @@ OSystem_SDL::OSystem_SDL() #endif _hwscreen(0), _screen(0), _tmpscreen(0), #ifdef ENABLE_16BIT - _screen16(0), + _screen16(0), _cursorBitDepth(8), #endif _overlayVisible(false), _overlayscreen(0), _tmpscreen2(0), diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 7d71ecb6ab..b6b7a8b284 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -124,7 +124,11 @@ public: // Disables or enables cursor palette void disableCursorPalette(bool disable) { _cursorPaletteDisabled = disable; +#ifdef ENABLE_16BIT + blitCursor(_cursorBitDepth); +#else blitCursor(); +#endif } // Shaking is used in SCUMM. Set current shake position. @@ -354,6 +358,9 @@ protected: MousePos _mouseCurState; byte _mouseKeyColor; int _cursorTargetScale; +#ifdef ENABLE_16BIT + uint8 _cursorBitDepth; +#endif bool _cursorPaletteDisabled; SDL_Surface *_mouseOrigSurface; SDL_Surface *_mouseSurface; -- cgit v1.2.3