[Scummvm-cvs-logs] SF.net SVN: scummvm: [23123] scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Thu Jun 15 10:09:40 CEST 2006


Revision: 23123
Author:   eriktorbjorn
Date:     2006-06-15 01:09:35 -0700 (Thu, 15 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23123&view=rev

Log Message:
-----------
Delete the old cursor buffer before allocating a new one. If the theme is
enabled by the time it's refreshed, replace the cursor.

Modified Paths:
--------------
    scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp
Modified: scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp	2006-06-15 08:07:20 UTC (rev 23122)
+++ scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp	2006-06-15 08:09:35 UTC (rev 23123)
@@ -180,8 +180,11 @@
 void ThemeNew::refresh() {
 	init();
 	resetupGuiRenderer();
-	if (_enabled)
+	if (_enabled) {
 		_system->showOverlay();
+		PaletteMan.replaceCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
+		CursorMan.replaceCursor(_cursor, _cursorWidth, _cursorHeight, _cursorHotspotX, _cursorHotspotY, 255, _cursorTargetScale);
+	}		
 }
 
 void ThemeNew::enable() {
@@ -1610,6 +1613,8 @@
 	_system->colorToRGB(_colors[kColorTransparency], r, g, b);
 	uint16 transparency = RGBToColor<ColorMasks<565> >(r, g, b);
 
+	delete [] _cursor;
+
 	_cursor = new byte[_cursorWidth * _cursorHeight];
 	assert(_cursor);
 	memset(_cursor, 255, sizeof(byte)*_cursorWidth*_cursorHeight);


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