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

tanoku at users.sourceforge.net tanoku at users.sourceforge.net
Sat Apr 11 19:12:17 CEST 2009


Revision: 39938
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39938&view=rev
Author:   tanoku
Date:     2009-04-11 17:12:17 +0000 (Sat, 11 Apr 2009)

Log Message:
-----------
Fixed bug #2706939 (Enabled button not drawn correctly) and other similar cases.
Fixed background shading weirdness when opening many dialogs on top of each other.
Fixed some modal dialogs not redrawing properly when closed.

Modified Paths:
--------------
    scummvm/trunk/gui/GuiManager.cpp
    scummvm/trunk/gui/widget.cpp

Modified: scummvm/trunk/gui/GuiManager.cpp
===================================================================
--- scummvm/trunk/gui/GuiManager.cpp	2009-04-11 15:38:13 UTC (rev 39937)
+++ scummvm/trunk/gui/GuiManager.cpp	2009-04-11 17:12:17 UTC (rev 39938)
@@ -136,19 +136,25 @@
 
 void GuiManager::redraw() {
 	int i;
+	ThemeEngine::ShadingStyle shading;
 
-	if (_redrawStatus == kRedrawDisabled)
+	if (_redrawStatus == kRedrawDisabled || _dialogStack.empty())
 		return;
 
-	if (_dialogStack.empty())
-		return;
+	shading = (ThemeEngine::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0);
 
+	// Tanoku: Do not apply shading more than once when opening many dialogs
+	// on top of each other. Screen ends up being too dark and it's a
+	// performance hog.
+	if (_redrawStatus == kRedrawOpenDialog && _dialogStack.size() > 2)
+		shading = ThemeEngine::kShadingNone;
+
 	switch (_redrawStatus) {
 		case kRedrawCloseDialog:
 		case kRedrawFull:
 		case kRedrawTopDialog:
 			_theme->clearAll();
-			_theme->openDialog(true);
+			_theme->openDialog(true, ThemeEngine::kShadingNone);
 
 			for (i = 0; i < _dialogStack.size() - 1; i++) {
 				_dialogStack[i]->drawDialog();
@@ -158,7 +164,7 @@
 
 		case kRedrawOpenDialog:
 			_theme->updateScreen();
-			_theme->openDialog(true, (ThemeEngine::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0));
+			_theme->openDialog(true, shading);
 			_dialogStack.top()->drawDialog();
 			_theme->finishBuffering();
 			break;
@@ -370,6 +376,8 @@
 	_dialogStack.pop();
 	if (_redrawStatus != kRedrawFull)
 		_redrawStatus = kRedrawCloseDialog;
+
+	redraw();
 }
 
 void GuiManager::setupCursor() {

Modified: scummvm/trunk/gui/widget.cpp
===================================================================
--- scummvm/trunk/gui/widget.cpp	2009-04-11 15:38:13 UTC (rev 39937)
+++ scummvm/trunk/gui/widget.cpp	2009-04-11 17:12:17 UTC (rev 39938)
@@ -146,10 +146,14 @@
 }
 
 void Widget::setEnabled(bool e) {
-	if (e)
-		setFlags(WIDGET_ENABLED);
-	else
-		clearFlags(WIDGET_ENABLED);
+	if ((_flags & WIDGET_ENABLED) != e) {
+		if (e)
+			setFlags(WIDGET_ENABLED);
+		else
+			clearFlags(WIDGET_ENABLED);
+
+		_boss->draw();
+	}
 }
 
 bool Widget::isEnabled() const {


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