diff options
| -rw-r--r-- | backends/platform/sdl/graphics.cpp | 18 | ||||
| -rw-r--r-- | backends/platform/sdl/sdl.h | 5 | ||||
| -rw-r--r-- | common/system.h | 8 | ||||
| -rw-r--r-- | graphics/cursorman.cpp | 6 | 
4 files changed, 12 insertions, 25 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index d7cabd00cc..f6b4d76418 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -1162,15 +1162,7 @@ void OSystem_SDL::setCursorPalette(const byte *colors, uint start, uint num) {  	}  	_cursorPaletteDisabled = false; -#ifdef ENABLE_RGB_COLOR -} - -void OSystem_SDL::setCursorFormat(Graphics::PixelFormat format) { -	assert(format.bytesPerPixel); -	_cursorFormat = format; - -#endif -//	blitCursor(); +	blitCursor();  } @@ -1378,10 +1370,12 @@ void OSystem_SDL::warpMouse(int x, int y) {  	}  } -void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format) { +void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format) {  #ifdef ENABLE_RGB_COLOR -	if (format.bytesPerPixel <= _screenFormat.bytesPerPixel) -		_cursorFormat = format; +	if (!format) +		format = new Graphics::PixelFormat(1,8,8,8,8,0,0,0,0); +	if (format->bytesPerPixel <= _screenFormat.bytesPerPixel) +		_cursorFormat = *format;  	keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;  #else  	keycolor &= 0xFF; diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index efe1984446..2048b7f536 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -152,10 +152,7 @@ public:  	virtual void warpMouse(int x, int y); // overloaded by CE backend (FIXME)  	// Set the bitmap that's used when drawing the cursor. -	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat format); // overloaded by CE backend (FIXME) -#ifdef ENABLE_RGB_COLOR -	virtual void setCursorFormat(Graphics::PixelFormat format); -#endif +	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, Graphics::PixelFormat *format); // overloaded by CE backend (FIXME)  	// Set colors of cursor palette  	void setCursorPalette(const byte *colors, uint start, uint num); diff --git a/common/system.h b/common/system.h index af672a505e..28947d00c5 100644 --- a/common/system.h +++ b/common/system.h @@ -732,13 +732,9 @@ public:  	 * @param hotspotY			vertical offset from the top side to the hotspot  	 * @param keycolor			transparency color index  	 * @param cursorTargetScale	scale factor which cursor is designed for -	 * @param format			pixel format which cursor graphic uses +	 * @param format			pointer to the pixel format which cursor graphic uses  	 */ -	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8()) = 0; -#ifdef ENABLE_RGB_COLOR -	virtual void setCursorFormat(Graphics::PixelFormat format) = 0; -#endif - +	virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int cursorTargetScale = 1, Graphics::PixelFormat *format = NULL) = 0;  	/**  	 * Replace the specified range of cursor the palette with new colors. diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp index 574950a09b..bf6de44fbf 100644 --- a/graphics/cursorman.cpp +++ b/graphics/cursorman.cpp @@ -64,7 +64,7 @@ void CursorManager::pushCursor(const byte *buf, uint w, uint h, int hotspotX, in  	_cursorStack.push(cur);  	if (buf) { -		g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format); +		g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);  	}  } @@ -77,7 +77,7 @@ void CursorManager::popCursor() {  	if (!_cursorStack.empty()) {  		cur = _cursorStack.top(); -		g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, cur->_format); +		g_system->setMouseCursor(cur->_data, cur->_width, cur->_height, cur->_hotspotX, cur->_hotspotY, cur->_keycolor, cur->_targetScale, &(cur->_format));  	}  	g_system->showMouse(isVisible()); @@ -137,7 +137,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,  	cur->_format = *format;  #endif -	g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, *format); +	g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);  }  void CursorManager::disableCursorPalette(bool disable) {  | 
