aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJody Northup2009-06-26 10:37:00 +0000
committerJody Northup2009-06-26 10:37:00 +0000
commit27e50db5d7cdbed498d6a61b1ee1ad5405ce33a2 (patch)
tree69b15c5697f95dfd1b28206e68c149fc17b8903d
parent2859c9130462e66df705d534f9a70d1430628be7 (diff)
downloadscummvm-rg350-27e50db5d7cdbed498d6a61b1ee1ad5405ce33a2.tar.gz
scummvm-rg350-27e50db5d7cdbed498d6a61b1ee1ad5405ce33a2.tar.bz2
scummvm-rg350-27e50db5d7cdbed498d6a61b1ee1ad5405ce33a2.zip
Converted OSystem::SetMouseCursor to take pointer to PixelFormat, instead of full PixelFormat. Removed OSystem::setCursorFormat (since I forgot to do so several commits ago)
svn-id: r41901
-rw-r--r--backends/platform/sdl/graphics.cpp18
-rw-r--r--backends/platform/sdl/sdl.h5
-rw-r--r--common/system.h8
-rw-r--r--graphics/cursorman.cpp6
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) {