[Scummvm-git-logs] scummvm master -> f824f8ad13ccefb5ed2e9df1f324fb8847397806

sev- noreply at scummvm.org
Sat Apr 29 10:00:53 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f824f8ad13 GUI: Don't redraw whole dialog stack with kRedrawTopDialog


Commit: f824f8ad13ccefb5ed2e9df1f324fb8847397806
    https://github.com/scummvm/scummvm/commit/f824f8ad13ccefb5ed2e9df1f324fb8847397806
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-04-29T12:00:49+02:00

Commit Message:
GUI: Don't redraw whole dialog stack with kRedrawTopDialog

Changed paths:
    gui/gui-manager.cpp


diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 47c2beffcd9..f9477b2c4ca 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -310,7 +310,6 @@ void GuiManager::redraw() {
 	switch (_redrawStatus) {
 		case kRedrawCloseDialog:
 		case kRedrawFull:
-		case kRedrawTopDialog:
 			_theme->clearAll();
 			_theme->drawToBackbuffer();
 
@@ -324,8 +323,9 @@ void GuiManager::redraw() {
 			// fall through
 
 		case kRedrawOpenDialog:
+		case kRedrawTopDialog:
 			// This case is an optimization to avoid redrawing the whole dialog
-			// stack when opening a new dialog.
+			// stack when opening a new dialog or redrawing the current one.
 
 			if (_displayTopDialogOnly) {
 				// When displaying only the top dialog clear the screen
@@ -341,7 +341,8 @@ void GuiManager::redraw() {
 					previousDialog->drawDialog(kDrawLayerForeground);
 				}
 
-				_theme->applyScreenShading(shading);
+				if (_redrawStatus != kRedrawTopDialog)
+					_theme->applyScreenShading(shading);
 			}
 
 			_dialogStack.top()->drawDialog(kDrawLayerBackground);
@@ -776,7 +777,9 @@ void GuiManager::processEvent(const Common::Event &event, Dialog *const activeDi
 }
 
 void GuiManager::scheduleTopDialogRedraw() {
-	_redrawStatus = kRedrawTopDialog;
+	// Open/Close dialog redraws have higher priority, otherwise they may not be processed at all
+	if (_redrawStatus != kRedrawOpenDialog && _redrawStatus != kRedrawCloseDialog)
+		_redrawStatus = kRedrawTopDialog;
 }
 
 void GuiManager::giveFocusToDialog(Dialog *dialog) {




More information about the Scummvm-git-logs mailing list