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

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Sat Jul 4 06:13:10 CEST 2009


Revision: 42084
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42084&view=rev
Author:   upthorn
Date:     2009-07-04 04:13:10 +0000 (Sat, 04 Jul 2009)

Log Message:
-----------
Fixed cursor corruption in non-8bit graphics games when switching back from overlay.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp
    scummvm/branches/gsoc2009-16bit/graphics/cursorman.h

Modified: scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp	2009-07-04 01:48:08 UTC (rev 42083)
+++ scummvm/branches/gsoc2009-16bit/graphics/cursorman.cpp	2009-07-04 04:13:10 UTC (rev 42084)
@@ -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());
@@ -135,7 +135,10 @@
 	cur->_keycolor = keycolor;
 	cur->_targetScale = targetScale;
 #ifdef ENABLE_RGB_COLOR
-	cur->_format = format;
+	if (format)
+		cur->_format = *format;
+	else
+		cur->_format = Graphics::PixelFormat::createFormatCLUT8();
 #endif
 
 	g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format);

Modified: scummvm/branches/gsoc2009-16bit/graphics/cursorman.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/graphics/cursorman.h	2009-07-04 01:48:08 UTC (rev 42083)
+++ scummvm/branches/gsoc2009-16bit/graphics/cursorman.h	2009-07-04 04:13:10 UTC (rev 42084)
@@ -148,22 +148,20 @@
 		int _hotspotX;
 		int _hotspotY;
 		uint32 _keycolor;
-		const Graphics::PixelFormat *_format;
+		Graphics::PixelFormat _format;
 		byte _targetScale;
 
 		uint _size;
 		Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) {
 #ifdef ENABLE_RGB_COLOR
-			if (!format) {
-				_size = w * h;
-				_keycolor &= 0xFF;
-			} else {
-				_size = w * h * format->bytesPerPixel;
-				_keycolor &= ((1 << (format->bytesPerPixel << 3)) - 1);
-			}
-			_format = format;
+			if (!format)
+				_format = Graphics::PixelFormat::createFormatCLUT8();
+			 else 
+				_format = *format;
+			_size = w * h * _format.bytesPerPixel;
+			_keycolor &= ((1 << (_format.bytesPerPixel << 3)) - 1);
 #else
-			_format = NULL;
+			_format = Graphics::PixelFormat::createFormatCLUT8();
 			_size = w * h;
 			_keycolor &= 0xFF;
 #endif


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