[Scummvm-cvs-logs] SF.net SVN: scummvm:[35661] scummvm/trunk/gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Jan 2 02:23:18 CET 2009


Revision: 35661
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35661&view=rev
Author:   fingolfin
Date:     2009-01-02 01:23:17 +0000 (Fri, 02 Jan 2009)

Log Message:
-----------
GUI: Fix the recent regression where starting games directly (bypassing the launcher) would result in a black screen; also reinit the theme (which each time causes the full XML data to be parsed) less often

Modified Paths:
--------------
    scummvm/trunk/gui/ThemeEngine.cpp
    scummvm/trunk/gui/newgui.cpp

Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp	2009-01-02 01:21:38 UTC (rev 35660)
+++ scummvm/trunk/gui/ThemeEngine.cpp	2009-01-02 01:23:17 UTC (rev 35661)
@@ -176,7 +176,8 @@
 }
 
 void ThemeEngine::enable() {
-	init();
+	if (_enabled)
+		return;
 
 	if (_useCursor) {
 		CursorMan.pushCursorPalette(_cursorPal, 0, MAX_CURS_COLORS);
@@ -190,6 +191,9 @@
 }
 
 void ThemeEngine::disable() {
+	if (!_enabled)
+		return;
+
 	_system->hideOverlay();
 
 	if (_useCursor) {

Modified: scummvm/trunk/gui/newgui.cpp
===================================================================
--- scummvm/trunk/gui/newgui.cpp	2009-01-02 01:21:38 UTC (rev 35660)
+++ scummvm/trunk/gui/newgui.cpp	2009-01-02 01:23:17 UTC (rev 35661)
@@ -113,9 +113,20 @@
 	// Enable the new theme
 	//
 	_theme = newTheme;
-	screenChange();
 	_themeChange = true;
 
+	// refresh all dialogs
+	for (int i = 0; i < _dialogStack.size(); ++i) {
+		_dialogStack[i]->reflowLayout();
+	}
+
+	// We need to redraw immediately. Otherwise
+	// some other event may cause a widget to be
+	// redrawn before redraw() has been called.
+	_redrawStatus = kRedrawFull;
+//	redraw();
+//	_system->updateScreen();
+
 	return true;
 }
 
@@ -179,6 +190,12 @@
 		_useStdCursor = !_theme->ownCursor();
 		if (_useStdCursor)
 			setupCursor();
+
+//		_theme->refresh();
+
+		_themeChange = false;
+		_redrawStatus = kRedrawFull;
+		redraw();
 	}
 
 	Common::EventManager *eventMan = _system->getEventManager();
@@ -226,7 +243,7 @@
 				if (_useStdCursor)
 					setupCursor();
 
-				_theme->refresh();
+//				_theme->refresh();
 
 				_themeChange = false;
 				_redrawStatus = kRedrawFull;
@@ -322,7 +339,8 @@
 
 void GuiManager::openDialog(Dialog *dialog) {
 	_dialogStack.push(dialog);
-	_redrawStatus = kRedrawOpenDialog;
+	if (_redrawStatus != kRedrawFull)
+		_redrawStatus = kRedrawOpenDialog;
 
 	// We reflow the dialog just before opening it. If the screen changed
 	// since the last time we looked, also refresh the loaded theme,
@@ -338,7 +356,8 @@
 
 	// Remove the dialog from the stack
 	_dialogStack.pop();
-	_redrawStatus = kRedrawCloseDialog;
+	if (_redrawStatus != kRedrawFull)
+		_redrawStatus = kRedrawCloseDialog;
 }
 
 void GuiManager::setupCursor() {
@@ -394,6 +413,7 @@
 
 	// reinit the whole theme
 	_theme->refresh();
+
 	// refresh all dialogs
 	for (int i = 0; i < _dialogStack.size(); ++i) {
 		_dialogStack[i]->reflowLayout();
@@ -403,7 +423,6 @@
 	// redrawn before redraw() has been called.
 	_redrawStatus = kRedrawFull;
 	redraw();
-	_system->showOverlay();
 	_system->updateScreen();
 }
 


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