[Scummvm-cvs-logs] SF.net SVN: scummvm:[41901] scummvm/branches/gsoc2009-16bit

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Fri Jun 26 12:37:01 CEST 2009


Revision: 41901
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41901&view=rev
Author:   upthorn
Date:     2009-06-26 10:37:00 +0000 (Fri, 26 Jun 2009)

Log Message:
-----------
Converted OSystem::SetMouseCursor to take pointer to PixelFormat, instead of full PixelFormat. Removed OSystem::setCursorFormat (since I forgot to do so several commits ago)

Modified Paths:
--------------
    scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp
    scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h
    scummvm/branches/gsoc2009-16bit/common/system.h
    scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp

Modified: scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp	2009-06-26 08:50:11 UTC (rev 41900)
+++ scummvm/branches/gsoc2009-16bit/backends/platform/sdl/graphics.cpp	2009-06-26 10:37:00 UTC (rev 41901)
@@ -1162,18 +1162,10 @@
 	}
 
 	_cursorPaletteDisabled = false;
-#ifdef ENABLE_RGB_COLOR
+	blitCursor();
 }
 
-void OSystem_SDL::setCursorFormat(Graphics::PixelFormat format) {
-	assert(format.bytesPerPixel);
-	_cursorFormat = format;
 
-#endif
-//	blitCursor();
-}
-
-
 void OSystem_SDL::setShakePos(int shake_pos) {
 	assert (_transactionMode == kTransactionNone);
 
@@ -1378,10 +1370,12 @@
 	}
 }
 
-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;

Modified: scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h	2009-06-26 08:50:11 UTC (rev 41900)
+++ scummvm/branches/gsoc2009-16bit/backends/platform/sdl/sdl.h	2009-06-26 10:37:00 UTC (rev 41901)
@@ -152,10 +152,7 @@
 	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);

Modified: scummvm/branches/gsoc2009-16bit/common/system.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/common/system.h	2009-06-26 08:50:11 UTC (rev 41900)
+++ scummvm/branches/gsoc2009-16bit/common/system.h	2009-06-26 10:37:00 UTC (rev 41901)
@@ -732,14 +732,10 @@
 	 * @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.
 	 * The palette entries from 'start' till (start+num-1) will be replaced - so

Modified: scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp	2009-06-26 08:50:11 UTC (rev 41900)
+++ scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp	2009-06-26 10:37:00 UTC (rev 41901)
@@ -64,7 +64,7 @@
 	_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 @@
 
 	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 @@
 	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) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list