From 0323638ce933e1dea7dd81b35a6646a9773a01ea Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 6 Jun 2009 08:41:03 +0000 Subject: [PATCH] Streamlined the cursor blitting changes introduced in revision 41412 svn-id: r41213 --- backends/platform/sdl/graphics.cpp | 26 ++------------------------ backends/platform/sdl/sdl.h | 8 -------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 81e137e19c3..2872c71f44d 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -332,11 +332,7 @@ 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 { @@ -604,11 +600,7 @@ 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(); @@ -1171,11 +1163,7 @@ 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) { @@ -1204,11 +1192,7 @@ 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) { @@ -1469,21 +1453,15 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, #ifdef ENABLE_16BIT _mouseData = (byte *)malloc(w * h * byteDepth); memcpy(_mouseData, buf, w * h * byteDepth); - - blitCursor(bitDepth); #else _mouseData = (byte *)malloc(w * h); memcpy(_mouseData, buf, w * h); +#endif blitCursor(); -#endif } -#ifdef ENABLE_16BIT -void OSystem_SDL::blitCursor(uint8 bitDepth) { -#else void OSystem_SDL::blitCursor() { -#endif byte *dstPtr; const byte *srcPtr = _mouseData; byte color; @@ -1522,7 +1500,7 @@ void OSystem_SDL::blitCursor() { for (j = 0; j < w; j++) { color = *srcPtr; #ifdef ENABLE_16BIT - if (bitDepth == 16) { + if (_cursorBitDepth == 16) { if (color != _mouseKeyColor) { // transparent, don't draw int8 r = ((*(uint16 *)srcPtr >> 10) & 0x1F) << 3; int8 g = ((*(uint16 *)srcPtr >> 5) & 0x1F) << 3; diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index b6b7a8b284e..6fe871fa834 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -124,11 +124,7 @@ 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. @@ -420,11 +416,7 @@ protected: virtual void drawMouse(); // overloaded by CE backend virtual void undrawMouse(); // overloaded by CE backend (FIXME) -#ifdef ENABLE_16BIT - virtual void blitCursor(uint8 bitDepth = 8); // overloaded by CE backend (FIXME) -#else virtual void blitCursor(); // overloaded by CE backend (FIXME) -#endif /** Set the position of the virtual mouse cursor. */ void setMousePos(int x, int y);