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

mikrosk noreply at scummvm.org
Sun Apr 26 11:06:14 UTC 2026


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

Summary:
854826756c GUI: Improve tooltip redrawing performance
7203d1078f GUI: Let drawDialog not reset the clipping rectangle
2c2f3bd175 GUI: Allow GUI manager to fetch the dirty rect of a Dialog
bac2fd6348 GUI: Implement clipping for drawDDText
b0cf50b286 GUI: Don't redraw the whole screen when a tooltip is opened or closed
fec10669b5 BACKENDS: ATARI: Tooltip patch is no longer needed


Commit: 854826756cbb2bb4efb455a5a8a3f804fab6a4a3
    https://github.com/scummvm/scummvm/commit/854826756cbb2bb4efb455a5a8a3f804fab6a4a3
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-26T21:06:07+10:00

Commit Message:
GUI: Improve tooltip redrawing performance

When displaying or hiding a tooltip, just render them on the screen
buffer and redraw the underneath foreground dialog.
For this, the tooltip is detached from the usual dialog stack and is
treated as a special case.

Changed paths:
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h
    gui/gui-manager.cpp
    gui/gui-manager.h


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 67a2b3c3621..0e57cc526e7 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -113,8 +113,8 @@ static const DrawDataInfo kDrawDataDefaults[] = {
 	{kDDMainDialogBackground,         "mainmenu_bg",          kDrawLayerBackground,   kDDNone},
 	{kDDSpecialColorBackground,       "special_bg",           kDrawLayerBackground,   kDDNone},
 	{kDDPlainColorBackground,         "plain_bg",             kDrawLayerBackground,   kDDNone},
-	{kDDTooltipBackground,            "tooltip_bg",           kDrawLayerBackground,   kDDNone},
 	{kDDDefaultBackground,            "default_bg",           kDrawLayerBackground,   kDDNone},
+	{kDDTooltipBackground,            "tooltip_bg",           kDrawLayerForeground,   kDDNone},
 	{kDDTextSelectionBackground,      "text_selection",       kDrawLayerForeground,  kDDNone},
 	{kDDTextSelectionFocusBackground, "text_selection_focus", kDrawLayerForeground,  kDDNone},
 	{kDDThumbnailBackground,    	  "thumb_bg",   		  kDrawLayerForeground,   kDDNone},
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 3b989eb3a68..13a9e1316ad 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -63,8 +63,8 @@ enum DrawData {
 	kDDMainDialogBackground,
 	kDDSpecialColorBackground,
 	kDDPlainColorBackground,
-	kDDTooltipBackground,
 	kDDDefaultBackground,
+	kDDTooltipBackground,
 	kDDTextSelectionBackground,
 	kDDTextSelectionFocusBackground,
 	kDDThumbnailBackground,
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 6e90f4f5b7a..d90e730f507 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -54,7 +54,7 @@ enum {
 
 // Constructor
 GuiManager::GuiManager() : CommandSender(nullptr), _redrawStatus(kRedrawDisabled), _stateIsSaved(false),
-	_cursorAnimateCounter(0), _cursorAnimateTimer(0) {
+	_cursorAnimateCounter(0), _cursorAnimateTimer(0), _tooltip(nullptr) {
 	_theme = nullptr;
 	_useStdCursor = false;
 
@@ -400,6 +400,30 @@ void GuiManager::redrawInternalTopDialogOnly() {
 			_theme->drawToScreen();
 			_theme->copyBackBufferToScreen();
 
+			_dialogStack.top()->drawDialog(kDrawLayerForeground);
+
+			if (_tooltip) {
+				// There is no background for tooltips as we never save them in backbuffer
+				_tooltip->drawDialog(kDrawLayerForeground);
+			}
+			break;
+
+		case kRedrawOpenTooltip:
+
+			// Draw the newly opened tooltip over everything and that's it
+			_theme->drawToScreen();
+
+			assert(_tooltip);
+			// There is no background for tooltips as we never save them in backbuffer
+			_tooltip->drawDialog(kDrawLayerForeground);
+			break;
+
+		case kRedrawCloseTooltip:
+
+			// Restore from background and render the top dialog foreground
+			_theme->drawToScreen();
+			_theme->restoreBackground(Common::Rect(0, 0, g_system->getOverlayWidth(), g_system->getOverlayHeight()));
+
 			_dialogStack.top()->drawDialog(kDrawLayerForeground);
 			break;
 
@@ -460,6 +484,30 @@ void GuiManager::redrawInternal() {
 			_theme->drawToScreen();
 			_theme->copyBackBufferToScreen();
 
+			_dialogStack.top()->drawDialog(kDrawLayerForeground);
+
+			if (_tooltip) {
+				// There is no background for tooltips as we never save them in backbuffer
+				_tooltip->drawDialog(kDrawLayerForeground);
+			}
+			break;
+
+		case kRedrawOpenTooltip:
+
+			// Draw the newly opened tooltip over everything and that's it
+			_theme->drawToScreen();
+
+			assert(_tooltip);
+			// There is no background for tooltips as we never save them in backbuffer
+			_tooltip->drawDialog(kDrawLayerForeground);
+			break;
+
+		case kRedrawCloseTooltip:
+
+			// Restore from background and render the top dialog foreground
+			_theme->drawToScreen();
+			_theme->restoreBackground(Common::Rect(0, 0, g_system->getOverlayWidth(), g_system->getOverlayHeight()));
+
 			_dialogStack.top()->drawDialog(kDrawLayerForeground);
 			break;
 
@@ -486,6 +534,8 @@ void GuiManager::redraw() {
 }
 
 Dialog *GuiManager::getTopDialog() const {
+	if (_tooltip)
+		return _tooltip;
 	if (_dialogStack.empty())
 		return nullptr;
 	return _dialogStack.top();
@@ -619,7 +669,8 @@ void GuiManager::runLoop() {
 		// 2. If the mouse was moved but ended on the same (tooltip enabled) widget,
 		//    then delay showing the tooltip based on the value of kTooltipSameWidgetDelay.
 		uint32 systemMillisNowForTooltipCheck = _system->getMillis(true);
-		if ((_lastTooltipShown.x != _lastMousePosition.x || _lastTooltipShown.y != _lastMousePosition.y)
+		if (!_tooltip
+		    && (_lastTooltipShown.x != _lastMousePosition.x || _lastTooltipShown.y != _lastMousePosition.y)
 		    && systemMillisNowForTooltipCheck - _lastMousePosition.time > (uint32)kTooltipDelay
 		    && !activeDialog->isDragging()) {
 			Widget *wdg = activeDialog->findWidget(_lastMousePosition.x, _lastMousePosition.y);
@@ -636,7 +687,9 @@ void GuiManager::runLoop() {
 					if (wdg->hasTooltip()) {
 						Tooltip *tooltip = new Tooltip();
 						tooltip->setup(activeDialog, wdg, _lastMousePosition.x, _lastMousePosition.y);
-						tooltip->runModal();
+						_tooltip = tooltip;
+						_tooltip->runModal();
+						// _tooltip is reset in closeTopDialog
 						delete tooltip;
 					}
 				}
@@ -719,17 +772,23 @@ void GuiManager::restoreState() {
 
 void GuiManager::openDialog(Dialog *dialog) {
 	if (!_dialogStack.empty())
-		getTopDialog()->lostFocus();
+		_dialogStack.top()->lostFocus();
 
 	giveFocusToDialog(dialog);
 
-	_dialogStack.push(dialog);
-	// We were already ready to redraw a new dialog
-	// Redraw fully to ensure a proper draw of the whole stack
-	if (_redrawStatus == kRedrawOpenDialog)
-		_redrawStatus = kRedrawFull;
-	if (_redrawStatus != kRedrawFull)
-		_redrawStatus = kRedrawOpenDialog;
+	if (dialog == _tooltip) {
+		if (_redrawStatus == kRedrawDisabled)
+			_redrawStatus = kRedrawOpenTooltip;
+	} else {
+		_dialogStack.push(dialog);
+
+		// We were already ready to redraw a new dialog
+		// Redraw fully to ensure a proper draw of the whole stack
+		if (_redrawStatus == kRedrawOpenDialog)
+			_redrawStatus = kRedrawFull;
+		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,
@@ -740,21 +799,34 @@ void GuiManager::openDialog(Dialog *dialog) {
 
 void GuiManager::closeTopDialog() {
 	// Don't do anything if no dialog is open
-	if (_dialogStack.empty())
+	if (!_tooltip && _dialogStack.empty())
 		return;
 
-	// Remove the dialog from the stack
-	_dialogStack.pop()->lostFocus();
+	if (!_tooltip) {
+		// Remove the dialog from the stack
+		_dialogStack.pop()->lostFocus();
+	}
 
 	if (!_dialogStack.empty()) {
-		Dialog *dialog = getTopDialog();
+		Dialog *dialog = _dialogStack.top();
 		giveFocusToDialog(dialog);
 	}
 
-	if (_redrawStatus != kRedrawFull)
-		_redrawStatus = kRedrawCloseDialog;
+	if (_tooltip) {
+		if (_redrawStatus == kRedrawDisabled)
+			_redrawStatus = kRedrawCloseTooltip;
+	} else {
+		if (_redrawStatus != kRedrawFull)
+			_redrawStatus = kRedrawCloseDialog;
+	}
 
 	redraw();
+
+	if (_tooltip) {
+		// We need to reset it to nullptr here, else getTopDialog keeps
+		// returning us as top dialog and we never leave the tooltip event loop
+		_tooltip = nullptr;
+	}
 }
 
 void GuiManager::setupCursor() {
diff --git a/gui/gui-manager.h b/gui/gui-manager.h
index 4562d007647..a4f0cec9429 100644
--- a/gui/gui-manager.h
+++ b/gui/gui-manager.h
@@ -64,6 +64,7 @@ enum {
 class Dialog;
 class ThemeEval;
 class GuiObject;
+class Tooltip;
 
 #define g_gui	(GUI::GuiManager::instance())
 
@@ -163,6 +164,8 @@ public:
 protected:
 	enum RedrawStatus {
 		kRedrawDisabled = 0,
+		kRedrawOpenTooltip,
+		kRedrawCloseTooltip,
 		kRedrawOpenDialog,
 		kRedrawCloseDialog,
 		kRedrawTopDialog,
@@ -203,11 +206,12 @@ protected:
 	} _lastClick, _lastMousePosition, _globalMousePosition;
 
 	struct TooltipData {
-		TooltipData() : x(-1), y(-1) { time = 0; wdg = nullptr; }
+		TooltipData() : x(-1), y(-1), wdg(nullptr) { time = 0; }
 		uint32 time; // Time
 		Widget *wdg; // Widget that had its tooltip shown
 		int16 x, y;  // Position of mouse before tooltip was focused
 	} _lastTooltipShown;
+	Tooltip *_tooltip;
 
 	// mouse cursor state
 	uint32	_cursorAnimateCounter;


Commit: 7203d1078fd790020cbf434d630e74a9537b20e5
    https://github.com/scummvm/scummvm/commit/7203d1078fd790020cbf434d630e74a9537b20e5
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-26T21:06:07+10:00

Commit Message:
GUI: Let drawDialog not reset the clipping rectangle

This will allow for optimized redrawing of select parts of the dialog.

Changed paths:
    engines/scumm/dialogs.cpp
    engines/scumm/dialogs.h
    gui/Tooltip.cpp
    gui/Tooltip.h
    gui/about.cpp
    gui/about.h
    gui/console.cpp
    gui/console.h
    gui/dialog.cpp
    gui/dialog.h
    gui/textviewer.cpp
    gui/textviewer.h
    gui/widgets/popup.cpp
    gui/widgets/popup.h


diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 852d6773531..121e98354e3 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -908,8 +908,8 @@ ValueDisplayDialog::ValueDisplayDialog(const Common::U32String &label, int minVa
 	assert(_min <= _value && _value <= _max);
 }
 
-void ValueDisplayDialog::drawDialog(GUI::DrawLayer layerToDraw) {
-	Dialog::drawDialog(layerToDraw);
+void ValueDisplayDialog::drawDialog(GUI::DrawLayer layerToDraw, bool resetClipping) {
+	Dialog::drawDialog(layerToDraw, resetClipping);
 
 	const int labelWidth = _w - 8 - _percentBarWidth;
 	g_gui.theme()->drawText(Common::Rect(_x+4, _y+4, _x+labelWidth+4,
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index f0a2ef98c1c..31b78863a10 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -137,7 +137,7 @@ public:
 	ValueDisplayDialog(const Common::U32String &label, int minVal, int maxVal, int val, uint16 incKey, uint16 decKey);
 
 	void open() override;
-	void drawDialog(GUI::DrawLayer layerToDraw) override;
+	void drawDialog(GUI::DrawLayer layerToDraw, bool resetClipping = true) override;
 	void handleTickle() override;
 	void handleMouseDown(int x, int y, int button, int clickCount) override {
 		close();
diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
index ed81d7665b1..0c2cae77d07 100644
--- a/gui/Tooltip.cpp
+++ b/gui/Tooltip.cpp
@@ -64,11 +64,11 @@ void Tooltip::setup(Dialog *parent, Widget *widget, int x, int y) {
 	}
 }
 
-void Tooltip::drawDialog(DrawLayer layerToDraw) {
+void Tooltip::drawDialog(DrawLayer layerToDraw, bool resetClipping) {
 	int num = 0;
 	int h = g_gui.theme()->getFontHeight(ThemeEngine::kFontStyleTooltip) + 2;
 
-	Dialog::drawDialog(layerToDraw);
+	Dialog::drawDialog(layerToDraw, resetClipping);
 
 	int16 textX = _x + 1 + _xpadding;
 	if (g_gui.useRTL()) {
diff --git a/gui/Tooltip.h b/gui/Tooltip.h
index f3e9e9950a7..981373a968b 100644
--- a/gui/Tooltip.h
+++ b/gui/Tooltip.h
@@ -37,7 +37,7 @@ private:
 public:
 	Tooltip();
 	void setup(Dialog *parent, Widget *widget, int x, int y);
-	void drawDialog(DrawLayer layerToDraw) override;
+	void drawDialog(DrawLayer layerToDraw, bool resetClipping = true) override;
 	void receivedFocus(int x = -1, int y = -1) override {}
 
 protected:
diff --git a/gui/about.cpp b/gui/about.cpp
index ac719ba54d0..e8999e9ad91 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -268,8 +268,8 @@ void AboutDialog::close() {
 	Dialog::close();
 }
 
-void AboutDialog::drawDialog(DrawLayer layerToDraw) {
-	Dialog::drawDialog(layerToDraw);
+void AboutDialog::drawDialog(DrawLayer layerToDraw, bool resetClipping) {
+	Dialog::drawDialog(layerToDraw, resetClipping);
 
 	// Draw text inside this rectangle to mimic a viewport
 	Common::Rect r = _textRect;
diff --git a/gui/about.h b/gui/about.h
index 693c6ec2516..5c2a50f716e 100644
--- a/gui/about.h
+++ b/gui/about.h
@@ -65,7 +65,7 @@ public:
 
 	void open() override;
 	void close() override;
-	void drawDialog(DrawLayer layerToDraw) override;
+	void drawDialog(DrawLayer layerToDraw, bool resetClipping = true) override;
 	void handleTickle() override;
 	void handleMouseDown(int x, int y, int button, int clickCount) override;
 	void handleMouseUp(int x, int y, int button, int clickCount) override;
diff --git a/gui/console.cpp b/gui/console.cpp
index 5901de0cc1e..07586792733 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -201,8 +201,8 @@ void ConsoleDialog::close() {
 	Dialog::close();
 }
 
-void ConsoleDialog::drawDialog(DrawLayer layerToDraw) {
-	Dialog::drawDialog(layerToDraw);
+void ConsoleDialog::drawDialog(DrawLayer layerToDraw, bool resetClipping) {
+	Dialog::drawDialog(layerToDraw, resetClipping);
 
 	for (int line = 0; line < _linesPerPage; line++)
 		drawLine(line);
diff --git a/gui/console.h b/gui/console.h
index 5967d67456d..caa5e5ea19f 100644
--- a/gui/console.h
+++ b/gui/console.h
@@ -143,7 +143,7 @@ public:
 
 	void open() override;
 	void close() override;
-	void drawDialog(DrawLayer layerToDraw) override;
+	void drawDialog(DrawLayer layerToDraw, bool resetClipping = true) override;
 
 	void handleTickle() override;
 	void reflowLayout() override;
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 0010c3dcb7a..14daa8875bd 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -163,12 +163,14 @@ void Dialog::markWidgetsAsDirty() {
 	}
 }
 
-void Dialog::drawDialog(DrawLayer layerToDraw) {
+void Dialog::drawDialog(DrawLayer layerToDraw, bool resetClipping) {
 
 	if (!isVisible())
 		return;
 
-	g_gui.theme()->disableClipRect();
+	if (resetClipping) {
+		g_gui.theme()->disableClipRect();
+	}
 	g_gui.theme()->_layerToDraw = layerToDraw;
 	int16 x = _x;
 	if (g_gui.useRTL()) {
diff --git a/gui/dialog.h b/gui/dialog.h
index 2262857337e..d3acf7fecf1 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -102,8 +102,7 @@ protected:
 	void markWidgetsAsDirty();
 
 	/** Draw the dialog in its entirety (background and widgets) */
-	virtual void drawDialog(DrawLayer layerToDraw);
-
+	virtual void drawDialog(DrawLayer layerToDraw, bool resetClipping = true);
 	/** Draw only the dialog's widgets */
 	void drawWidgets();
 
diff --git a/gui/textviewer.cpp b/gui/textviewer.cpp
index 24df3e83c64..f7b84d3aa88 100644
--- a/gui/textviewer.cpp
+++ b/gui/textviewer.cpp
@@ -155,8 +155,8 @@ void TextViewerDialog::open() {
 	Dialog::open();
 }
 
-void TextViewerDialog::drawDialog(DrawLayer layerToDraw) {
-	Dialog::drawDialog(layerToDraw);
+void TextViewerDialog::drawDialog(DrawLayer layerToDraw, bool resetClipping) {
+	Dialog::drawDialog(layerToDraw, resetClipping);
 
 	setTextDrawableArea(Common::Rect(_x, _y, _x + _w, _y + _h));
 
diff --git a/gui/textviewer.h b/gui/textviewer.h
index 3c3ddd9ecaa..54d521d41c5 100644
--- a/gui/textviewer.h
+++ b/gui/textviewer.h
@@ -72,7 +72,7 @@ public:
 
 	void destroy();
 	void open() override;
-	void drawDialog(DrawLayer layerToDraw) override;
+	void drawDialog(DrawLayer layerToDraw, bool resetClipping = true) override;
 
 	void handleMouseWheel(int x, int y, int direction) override;
 	void handleKeyDown(Common::KeyState state) override;
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index c6b34e1dd10..fc911f96efe 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -127,8 +127,8 @@ void PopUpDialog::open() {
 void PopUpDialog::reflowLayout() {
 }
 
-void PopUpDialog::drawDialog(DrawLayer layerToDraw) {
-	Dialog::drawDialog(layerToDraw);
+void PopUpDialog::drawDialog(DrawLayer layerToDraw, bool resetClipping) {
+	Dialog::drawDialog(layerToDraw, resetClipping);
 
 	int16 x = _x;
 	if (g_gui.useRTL()) {
diff --git a/gui/widgets/popup.h b/gui/widgets/popup.h
index d661483a762..89fb837fed0 100644
--- a/gui/widgets/popup.h
+++ b/gui/widgets/popup.h
@@ -109,7 +109,7 @@ public:
 
 	void open() override;
 	void reflowLayout() override;
-	void drawDialog(DrawLayer layerToDraw) override;
+	void drawDialog(DrawLayer layerToDraw, bool resetClipping = true) override;
 
 	void handleMouseUp(int x, int y, int button, int clickCount) override;
 	void handleMouseWheel(int x, int y, int direction) override;	// Scroll through entries with scroll wheel


Commit: 2c2f3bd1750121d5a4d5bd55d94948438fc4b93a
    https://github.com/scummvm/scummvm/commit/2c2f3bd1750121d5a4d5bd55d94948438fc4b93a
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-04-26T21:06:07+10:00

Commit Message:
GUI: Allow GUI manager to fetch the dirty rect of a Dialog

Co-authored-by: Miro Kropacek <miro.kropacek at gmail.com>

Changed paths:
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h
    gui/dialog.cpp
    gui/dialog.h


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 0e57cc526e7..0d18ccbfb81 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -899,6 +899,21 @@ bool ThemeEngine::loadThemeXML(const Common::String &themeId) {
 /**********************************************************
  * Draw Date descriptors drawing functions
  *********************************************************/
+Common::Rect ThemeEngine::getDrawDataExtendedRect(DrawData type, const Common::Rect &r) const {
+	WidgetDrawData *drawData = _widgets[type];
+	if (!drawData)
+		return Common::Rect();
+
+	Common::Rect extendedRect = r;
+	extendedRect.clip(_screen.w, _screen.h);
+	extendedRect.grow(kDirtyRectangleThreshold + drawData->_backgroundOffset);
+	if (drawData->_shadowOffset > drawData->_backgroundOffset) {
+		extendedRect.right += drawData->_shadowOffset - drawData->_backgroundOffset;
+		extendedRect.bottom += drawData->_shadowOffset - drawData->_backgroundOffset;
+	}
+	return extendedRect;
+}
+
 void ThemeEngine::drawDD(DrawData type, const Common::Rect &r, uint32 dynamic, bool forceRestore) {
 	WidgetDrawData *drawData = _widgets[type];
 
@@ -911,16 +926,15 @@ void ThemeEngine::drawDD(DrawData type, const Common::Rect &r, uint32 dynamic, b
 	Common::Rect area = r;
 	area.clip(_screen.w, _screen.h);
 
-	Common::Rect extendedRect = area;
-	extendedRect.grow(kDirtyRectangleThreshold + drawData->_backgroundOffset);
-	if (drawData->_shadowOffset > drawData->_backgroundOffset) {
-		extendedRect.right += drawData->_shadowOffset - drawData->_backgroundOffset;
-		extendedRect.bottom += drawData->_shadowOffset - drawData->_backgroundOffset;
-	}
+	// An empty clip means "fully outside active clip region" (e.g. a widget
+	// whose boss clip does not intersect the tooltip clip). Cull entirely —
+	// otherwise restoreBackground() below would overwrite screen pixels at
+	// the full widget rect with backbuffer content.
+	if (_clip.isEmpty())
+		return;
 
-	if (!_clip.isEmpty()) {
-		extendedRect.clip(_clip);
-	}
+	Common::Rect extendedRect = getDrawDataExtendedRect(type, r);
+	extendedRect.clip(_clip);
 
 	// Cull the elements not in the clip rect
 	if (extendedRect.isEmpty()) {
@@ -1160,37 +1174,49 @@ void ThemeEngine::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHe
 	drawDD(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2);
 }
 
-void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground bgtype) {
-	if (!ready())
-		return;
-
+static DrawData drawDataFromBgType(ThemeEngine::DialogBackground bgtype) {
 	switch (bgtype) {
-	case kDialogBackgroundMain:
-		drawDD(kDDMainDialogBackground, r);
-		break;
+	case ThemeEngine::kDialogBackgroundMain:
+		return kDDMainDialogBackground;
+	case ThemeEngine::kDialogBackgroundSpecial:
+		return kDDSpecialColorBackground;
+	case ThemeEngine::kDialogBackgroundPlain:
+		return kDDPlainColorBackground;
+	case ThemeEngine::kDialogBackgroundTooltip:
+		return kDDTooltipBackground;
+	case ThemeEngine::kDialogBackgroundDefault:
+		return kDDDefaultBackground;
+	default:
+		// fallthrough intended
+	case ThemeEngine::kDialogBackgroundNone:
+		// no op
+		return kDDNone;
+	}
+}
 
-	case kDialogBackgroundSpecial:
-		drawDD(kDDSpecialColorBackground, r);
-		break;
+Common::Rect ThemeEngine::getDialogDirtyRect(const Common::Rect &r, DialogBackground bgtype) {
+	if (!ready()) {
+		return Common::Rect();
+	}
 
-	case kDialogBackgroundPlain:
-		drawDD(kDDPlainColorBackground, r);
-		break;
+	DrawData type = drawDataFromBgType(bgtype);
+	if (type == kDDNone) {
+		return Common::Rect();
+	}
 
-	case kDialogBackgroundTooltip:
-		drawDD(kDDTooltipBackground, r);
-		break;
+	return getDrawDataExtendedRect(type, r);
+}
 
-	case kDialogBackgroundDefault:
-		drawDD(kDDDefaultBackground, r);
-		break;
+void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground bgtype) {
+	if (!ready())
+		return;
 
-	default:
-		// fallthrough intended
-	case kDialogBackgroundNone:
-		// no op
-		break;
+	DrawData type = drawDataFromBgType(bgtype);
+	if (type == kDDNone) {
+		return;
 	}
+
+	drawDD(type, r);
 }
 
 void ThemeEngine::drawCaret(const Common::Rect &r, bool erase) {
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 13a9e1316ad..199d0f5984b 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -458,6 +458,16 @@ public:
 	 */
 	void disableClipRect();
 
+	/**
+	 * Get the rectangle that a dialog with provided coordinates would dirty on screen.
+	 *
+	 * @param r The dialog rectangle
+	 * @param bgtype The dialog background
+	 *
+	 * @return The rectangle drawn by the engine including drop shadows
+	 */
+	Common::Rect getDialogDirtyRect(const Common::Rect &r, DialogBackground bgtype);
+
 	/** @name WIDGET DRAWING METHODS */
 	//@{
 
@@ -744,6 +754,12 @@ protected:
 	                TextAlignVertical alignV = kTextAlignVTop, int deltax = 0,
 	                const Common::Rect &drawableTextArea = Common::Rect(0, 0, 0, 0));
 
+	/**
+	 * Compute the extended (dirty) rectangle for a given draw data type applied
+	 * to the given base rect. Includes background and shadow offsets.
+	 */
+	Common::Rect getDrawDataExtendedRect(DrawData type, const Common::Rect &r) const;
+
 	/**
 	 * DEBUG: Draws a white square and writes some text next to it.
 	 */
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 14daa8875bd..1593bc458fd 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -163,6 +163,14 @@ void Dialog::markWidgetsAsDirty() {
 	}
 }
 
+Common::Rect Dialog::getMaxDirtyRect() const {
+	int16 x = _x;
+	if (g_gui.useRTL()) {
+		x = g_system->getOverlayWidth() - _x - _w;
+	}
+	return g_gui.theme()->getDialogDirtyRect(Common::Rect(x, _y, x + _w, _y + _h), _backgroundType);
+}
+
 void Dialog::drawDialog(DrawLayer layerToDraw, bool resetClipping) {
 
 	if (!isVisible())
diff --git a/gui/dialog.h b/gui/dialog.h
index d3acf7fecf1..31f79cb976d 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -101,6 +101,9 @@ protected:
 	/** Recursively mark all the widgets in this dialog as dirty so they are redrawn */
 	void markWidgetsAsDirty();
 
+	/** Returns the maximum dirty rectangle of this dialog */
+	Common::Rect getMaxDirtyRect() const;
+
 	/** Draw the dialog in its entirety (background and widgets) */
 	virtual void drawDialog(DrawLayer layerToDraw, bool resetClipping = true);
 	/** Draw only the dialog's widgets */


Commit: bac2fd634801f677a42de9eb9a46b1a4aef95adf
    https://github.com/scummvm/scummvm/commit/bac2fd634801f677a42de9eb9a46b1a4aef95adf
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-04-26T21:06:07+10:00

Commit Message:
GUI: Implement clipping for drawDDText

Changed paths:
    gui/ThemeEngine.cpp


diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 0d18ccbfb81..4d470792d82 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -964,16 +964,20 @@ void ThemeEngine::drawDDText(TextData type, TextColor color, const Common::Rect
 	Common::Rect area = r;
 	area.clip(_screen.w, _screen.h);
 
+	// First, clip to what the user provides
+	// If an empty rect is provided, use the standard area
 	Common::Rect dirty = drawableTextArea;
 	if (dirty.isEmpty()) dirty = area;
 	else dirty.clip(area);
 
-	if (!_clip.isEmpty()) {
-		dirty.clip(_clip);
-	}
+	// Then, clip to the clipping rect set by GUI
+	dirty.clip(_clip);
 
-	// HACK: One small pixel should be invisible enough
-	if (dirty.isEmpty()) dirty = Common::Rect(0, 0, 1, 1);
+	// An empty clip means "fully outside active clip region" — cull entirely
+	// rather than falling through, otherwise restoreBackground() below would
+	// wipe the widget's pixels on screen without re-drawing them.
+	if (dirty.isEmpty())
+		return;
 
 	if (restoreBg)
 		restoreBackground(dirty);


Commit: b0cf50b286ec7f6c4b670a6854cc755f583635df
    https://github.com/scummvm/scummvm/commit/b0cf50b286ec7f6c4b670a6854cc755f583635df
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-04-26T21:06:07+10:00

Commit Message:
GUI: Don't redraw the whole screen when a tooltip is opened or closed

Changed paths:
    gui/gui-manager.cpp


diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index d90e730f507..236612a9a02 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -418,14 +418,22 @@ void GuiManager::redrawInternalTopDialogOnly() {
 			_tooltip->drawDialog(kDrawLayerForeground);
 			break;
 
-		case kRedrawCloseTooltip:
+		case kRedrawCloseTooltip: {
+
+			// Restore the area under the tooltip from the backbuffer, then
+			// redraw the top dialog's foreground within that rect only. The
+			// clip is pinned to the tooltip rect so widget draws outside it
+			// are culled, keeping work proportional to the tooltip size.
+			Common::Rect tooltipRect = _tooltip->getMaxDirtyRect();
 
-			// Restore from background and render the top dialog foreground
 			_theme->drawToScreen();
-			_theme->restoreBackground(Common::Rect(0, 0, g_system->getOverlayWidth(), g_system->getOverlayHeight()));
+			_theme->restoreBackground(tooltipRect);
 
-			_dialogStack.top()->drawDialog(kDrawLayerForeground);
+			Common::Rect oldClip = _theme->swapClipRect(tooltipRect);
+			_dialogStack.top()->drawDialog(kDrawLayerForeground, false);
+			_theme->swapClipRect(oldClip);
 			break;
+		}
 
 		default:
 			// Redraw only the widgets that are marked as dirty on screen
@@ -502,14 +510,22 @@ void GuiManager::redrawInternal() {
 			_tooltip->drawDialog(kDrawLayerForeground);
 			break;
 
-		case kRedrawCloseTooltip:
+		case kRedrawCloseTooltip: {
+
+			// Restore the area under the tooltip from the backbuffer, then
+			// redraw the top dialog's foreground within that rect only. The
+			// clip is pinned to the tooltip rect so widget draws outside it
+			// are culled, keeping work proportional to the tooltip size.
+			Common::Rect tooltipRect = _tooltip->getMaxDirtyRect();
 
-			// Restore from background and render the top dialog foreground
 			_theme->drawToScreen();
-			_theme->restoreBackground(Common::Rect(0, 0, g_system->getOverlayWidth(), g_system->getOverlayHeight()));
+			_theme->restoreBackground(tooltipRect);
 
-			_dialogStack.top()->drawDialog(kDrawLayerForeground);
+			Common::Rect oldClip = _theme->swapClipRect(tooltipRect);
+			_dialogStack.top()->drawDialog(kDrawLayerForeground, false);
+			_theme->swapClipRect(oldClip);
 			break;
+		}
 
 		default:
 			// Redraw only the widgets that are marked as dirty on screen


Commit: fec10669b5823383302e11cf1a5ba4283386ee4b
    https://github.com/scummvm/scummvm/commit/fec10669b5823383302e11cf1a5ba4283386ee4b
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2026-04-26T21:06:07+10:00

Commit Message:
BACKENDS: ATARI: Tooltip patch is no longer needed

Changed paths:
  R backends/platform/atari/patches/tooltips.patch
    backends/platform/atari/atari.mk
    backends/platform/atari/build-firebee.sh
    backends/platform/atari/build-release.sh
    backends/platform/atari/build-release030.sh
    backends/platform/atari/readme.txt
    backends/platform/atari/readme.txt.in


diff --git a/backends/platform/atari/atari.mk b/backends/platform/atari/atari.mk
index da176ad91cf..77bd28c47ed 100644
--- a/backends/platform/atari/atari.mk
+++ b/backends/platform/atari/atari.mk
@@ -1,9 +1,6 @@
 .PHONY: atarilitedist atarifulldist fbdist
 
 DIST_FILES_PLATFORM := $(srcdir)/backends/platform/atari/readme.txt
-ifneq (${BACKEND},sdl)
-DIST_FILES_PLATFORM += $(srcdir)/backends/platform/atari/patches
-endif
 
 LITE_DIR	:= scummvm-${VERSION}-atari-lite
 LITE_DATA	:= ${LITE_DIR}/data
@@ -43,7 +40,7 @@ atarilitedist: $(EXECUTABLE)
 	! [ -f ${LITE_DATA}/teenagent.dat ] || mv ${LITE_DATA}/teenagent.dat ${LITE_DATA}/teenagen.dat
 
 	# readme.txt
-	$(CP) -r $(DIST_FILES_PLATFORM) ${LITE_DIR}
+	$(CP) $(DIST_FILES_PLATFORM) ${LITE_DIR}
 	unix2dos ${LITE_DIR}/readme.txt
 
 ifeq ($(CREATE_ZIP),y)
@@ -89,7 +86,7 @@ atarifulldist: $(EXECUTABLE)
 		done
 
 	# readme.txt
-	$(CP) -r $(DIST_FILES_PLATFORM) ${FULL_DIR}
+	$(CP) $(DIST_FILES_PLATFORM) ${FULL_DIR}
 	unix2dos ${FULL_DIR}/readme.txt
 
 ifeq ($(CREATE_ZIP),y)
@@ -128,7 +125,7 @@ fbdist: $(EXECUTABLE)
 		done
 
 	# readme.txt
-	$(CP) -r $(DIST_FILES_PLATFORM) ${FB_DIR}
+	$(CP) $(DIST_FILES_PLATFORM) ${FB_DIR}
 	unix2dos ${FB_DIR}/readme.txt
 
 ifeq ($(CREATE_ZIP),y)
diff --git a/backends/platform/atari/build-firebee.sh b/backends/platform/atari/build-firebee.sh
index 9d450eac506..51c5116f831 100755
--- a/backends/platform/atari/build-firebee.sh
+++ b/backends/platform/atari/build-firebee.sh
@@ -23,13 +23,6 @@ then
 	LDFLAGS="$LDFLAGS -mfastcall"
 fi
 
-if [ -f ../backends/platform/atari/.patched ]
-then
-	echo "FireBee SDL target shouldn't contain any ATARI patches!"
-	exit 1
-fi
-
-
 if [ ! -f config.log ]
 then
 ../configure \
diff --git a/backends/platform/atari/build-release.sh b/backends/platform/atari/build-release.sh
index ad09628fd83..d819bf02e5d 100755
--- a/backends/platform/atari/build-release.sh
+++ b/backends/platform/atari/build-release.sh
@@ -21,12 +21,6 @@ then
 	LDFLAGS="$LDFLAGS -mfastcall"
 fi
 
-if [ ! -f ../backends/platform/atari/.patched ]
-then
-	cd .. && cat backends/platform/atari/patches/tooltips.patch | patch -p1 && cd -
-	touch ../backends/platform/atari/.patched
-fi
-
 if [ ! -f config.log ]
 then
 ../configure \
diff --git a/backends/platform/atari/build-release030.sh b/backends/platform/atari/build-release030.sh
index df3c8edefa0..80ec6781ef4 100755
--- a/backends/platform/atari/build-release030.sh
+++ b/backends/platform/atari/build-release030.sh
@@ -21,12 +21,6 @@ then
 	LDFLAGS="$LDFLAGS -mfastcall"
 fi
 
-if [ ! -f ../backends/platform/atari/.patched ]
-then
-	cd .. && cat backends/platform/atari/patches/tooltips.patch | patch -p1 && cd -
-	touch ../backends/platform/atari/.patched
-fi
-
 if [ ! -f config.log ]
 then
 ../configure \
diff --git a/backends/platform/atari/patches/tooltips.patch b/backends/platform/atari/patches/tooltips.patch
deleted file mode 100644
index c02df86b465..00000000000
--- a/backends/platform/atari/patches/tooltips.patch
+++ /dev/null
@@ -1,270 +0,0 @@
-commit edb1791e25fc15aeda40c0b3ab236b98b0574eab
-Author: Miro Kropacek <miro.kropacek at gmail.com>
-Date:   Sun Jun 4 14:50:49 2023 +0200
-
-    Don't merge: tooltips
-
-diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
-index bfb97cdd425..9c3ba964451 100644
---- a/gui/ThemeEngine.cpp
-+++ b/gui/ThemeEngine.cpp
-@@ -917,7 +917,7 @@ bool ThemeEngine::loadThemeXML(const Common::String &themeId) {
- /**********************************************************
-  * Draw Date descriptors drawing functions
-  *********************************************************/
--void ThemeEngine::drawDD(DrawData type, const Common::Rect &r, uint32 dynamic, bool forceRestore) {
-+void ThemeEngine::drawDD(DrawData type, const Common::Rect &r, uint32 dynamic, bool forceRestore, Common::Rect *bgRect) {
- 	WidgetDrawData *drawData = _widgets[type];
- 
- 	if (!drawData)
-@@ -943,6 +943,9 @@ void ThemeEngine::drawDD(DrawData type, const Common::Rect &r, uint32 dynamic, b
- 	// Cull the elements not in the clip rect
- 	if (extendedRect.isEmpty()) {
- 		return;
-+	} else if (bgRect) {
-+		*bgRect = extendedRect;
-+		return;
- 	}
- 
- 	if (forceRestore || drawData->_layer == kDrawLayerBackground)
-@@ -1178,7 +1181,7 @@ void ThemeEngine::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHe
- 	drawDD(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2);
- }
- 
--void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground bgtype) {
-+void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground bgtype, Common::Rect *bgRect) {
- 	if (!ready())
- 		return;
- 
-@@ -1196,7 +1199,7 @@ void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground b
- 		break;
- 
- 	case kDialogBackgroundTooltip:
--		drawDD(kDDTooltipBackground, r);
-+		drawDD(kDDTooltipBackground, r, 0, false, bgRect);
- 		break;
- 
- 	case kDialogBackgroundDefault:
-diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
-index eba9e29cf04..40b1de5698c 100644
---- a/gui/ThemeEngine.h
-+++ b/gui/ThemeEngine.h
-@@ -53,6 +53,7 @@ class Dialog;
- class GuiObject;
- class ThemeEval;
- class ThemeParser;
-+class Tooltip;
- 
- /**
-  * DrawData sets enumeration.
-@@ -212,6 +213,7 @@ protected:
- 
- 	friend class GUI::Dialog;
- 	friend class GUI::GuiObject;
-+	friend class GUI::Tooltip;
- 
- public:
- 	/// Vertical alignment of the text.
-@@ -492,7 +494,7 @@ public:
- 
- 	void drawLineSeparator(const Common::Rect &r);
- 
--	void drawDialogBackground(const Common::Rect &r, DialogBackground type);
-+	void drawDialogBackground(const Common::Rect &r, DialogBackground type, Common::Rect *bgRect = nullptr);
- 
- 	void drawText(const Common::Rect &r, const Common::U32String &str, WidgetStateInfo state = kStateEnabled,
- 	              Graphics::TextAlign align = Graphics::kTextAlignCenter,
-@@ -744,7 +746,7 @@ protected:
- 	 *
- 	 * These functions are called from all the Widget drawing methods.
- 	 */
--	void drawDD(DrawData type, const Common::Rect &r, uint32 dynamic = 0, bool forceRestore = false);
-+	void drawDD(DrawData type, const Common::Rect &r, uint32 dynamic = 0, bool forceRestore = false, Common::Rect *bgRect = nullptr);
- 	void drawDDText(TextData type, TextColor color, const Common::Rect &r, const Common::U32String &text, bool restoreBg,
- 	                bool elipsis, Graphics::TextAlign alignH = Graphics::kTextAlignLeft,
- 	                TextAlignVertical alignV = kTextAlignVTop, int deltax = 0,
-diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
-index ed81d7665b1..8890e362ba4 100644
---- a/gui/Tooltip.cpp
-+++ b/gui/Tooltip.cpp
-@@ -20,6 +20,7 @@
-  */
- 
- #include "common/util.h"
-+#include "graphics/VectorRenderer.h"
- #include "gui/widget.h"
- #include "gui/dialog.h"
- #include "gui/gui-manager.h"
-@@ -29,7 +30,7 @@
- namespace GUI {
- 
- Tooltip::Tooltip() :
--	Dialog(-1, -1, -1, -1), _maxWidth(-1), _widget(nullptr), _xdelta(0), _ydelta(0), _xpadding(0), _ypadding(0) {
-+	Dialog(-1, -1, -1, -1), _maxWidth(-1), _widget(nullptr), _xdelta(0), _ydelta(0), _xpadding(0), _ypadding(0), _firstDraw(true) {
- 	_backgroundType = GUI::ThemeEngine::kDialogBackgroundTooltip;
- }
- 
-@@ -68,7 +69,40 @@ void Tooltip::drawDialog(DrawLayer layerToDraw) {
- 	int num = 0;
- 	int h = g_gui.theme()->getFontHeight(ThemeEngine::kFontStyleTooltip) + 2;
- 
--	Dialog::drawDialog(layerToDraw);
-+	// 	Dialog::drawDialog(layerToDraw)
-+	if (!isVisible())
-+		return;
-+
-+	g_gui.theme()->disableClipRect();
-+	g_gui.theme()->_layerToDraw = layerToDraw;
-+
-+	if (_firstDraw) {
-+		ThemeEngine *theme = g_gui.theme();
-+
-+		// store backgrounds from Backbuffer and Screen
-+		theme->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + _h), _backgroundType, &_bgRect);
-+
-+		theme->drawToBackbuffer();
-+		_bgBackbufferSurf.create(_bgRect.width(), _bgRect.height(), theme->renderer()->getActiveSurface()->format);
-+		_bgBackbufferSurf.copyRectToSurface(*theme->renderer()->getActiveSurface(), 0, 0, _bgRect);
-+
-+		theme->drawToScreen();
-+		_bgScreenSurf.create(_bgRect.width(), _bgRect.height(), theme->renderer()->getActiveSurface()->format);
-+		_bgScreenSurf.copyRectToSurface(*theme->renderer()->getActiveSurface(), 0, 0, _bgRect);
-+
-+		theme->drawToBackbuffer();
-+		_firstDraw = false;
-+	}
-+
-+	g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + _h), _backgroundType);
-+
-+	markWidgetsAsDirty();
-+
-+#ifdef LAYOUT_DEBUG_DIALOG
-+	return;
-+#endif
-+	drawWidgets();
-+	// end of Dialog::drawDialog(layerToDraw)
- 
- 	int16 textX = _x + 1 + _xpadding;
- 	if (g_gui.useRTL()) {
-@@ -95,6 +129,34 @@ void Tooltip::drawDialog(DrawLayer layerToDraw) {
- 	}
- }
- 
-+void Tooltip::open() {
-+	Dialog::open();
-+	g_gui._redrawStatus = GuiManager::kRedrawOpenTooltip;
-+}
-+
-+void Tooltip::close() {
-+	Dialog::close();
-+	g_gui._redrawStatus = GuiManager::kRedrawDisabled;
-+
-+	if (!_bgRect.isEmpty()) {
-+		ThemeEngine *theme = g_gui.theme();
-+
-+		theme->drawToBackbuffer();
-+		theme->renderer()->getActiveSurface()->copyRectToSurface(
-+			_bgBackbufferSurf, _bgRect.left, _bgRect.top, Common::Rect(_bgRect.width(), _bgRect.height()));
-+
-+		theme->drawToScreen();
-+		theme->renderer()->getActiveSurface()->copyRectToSurface(
-+			_bgScreenSurf, _bgRect.left, _bgRect.top, Common::Rect(_bgRect.width(), _bgRect.height()));
-+
-+		theme->addDirtyRect(_bgRect);
-+
-+		_bgRect = Common::Rect();
-+		_bgBackbufferSurf.free();
-+		_bgScreenSurf.free();
-+	}
-+}
-+
- void Tooltip::handleMouseDown(int x, int y, int button, int clickCount) {
- 	close();
- 	_widget->handleMouseDown(x + (getAbsX() - _widget->getAbsX()), y + (getAbsY() - _widget->getAbsY()), button, clickCount);
-diff --git a/gui/Tooltip.h b/gui/Tooltip.h
-index f3e9e9950a7..4fb1a935c90 100644
---- a/gui/Tooltip.h
-+++ b/gui/Tooltip.h
-@@ -23,7 +23,9 @@
- #define GUI_TOOLTIP_H
- 
- #include "common/keyboard.h"
-+#include "common/rect.h"
- #include "common/str-array.h"
-+#include "graphics/surface.h"
- #include "gui/dialog.h"
- 
- namespace GUI {
-@@ -41,6 +43,9 @@ public:
- 	void receivedFocus(int x = -1, int y = -1) override {}
- 
- protected:
-+	void open() override;
-+	void close() override;
-+
- 	void handleKeyDown(Common::KeyState state) override;
- 	void handleKeyUp(Common::KeyState state) override;
- 	void handleMouseDown(int x, int y, int button, int clickCount) override;
-@@ -53,6 +58,11 @@ protected:
- 	int _xpadding, _ypadding;
- 
- 	Common::U32StringArray _wrappedLines;
-+
-+	bool _firstDraw;
-+	Common::Rect _bgRect;
-+	Graphics::Surface _bgBackbufferSurf;
-+	Graphics::Surface _bgScreenSurf;
- };
- 
- } // End of namespace GUI
-diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
-index 02de69aa7c9..da57fdb2973 100644
---- a/gui/gui-manager.cpp
-+++ b/gui/gui-manager.cpp
-@@ -453,6 +453,9 @@ void GuiManager::redrawInternal() {
- 				_theme->applyScreenShading(shading);
- 			}
- 
-+			// fall through
-+
-+		case kRedrawOpenTooltip:
- 			// Finally, draw the top dialog background
- 			_dialogStack.top()->drawDialog(kDrawLayerBackground);
- 
-@@ -753,8 +756,6 @@ void GuiManager::closeTopDialog() {
- 
- 	if (_redrawStatus != kRedrawFull)
- 		_redrawStatus = kRedrawCloseDialog;
--
--	redraw();
- }
- 
- void GuiManager::setupCursor() {
-diff --git a/gui/gui-manager.h b/gui/gui-manager.h
-index 4562d007647..69b03dbd63c 100644
---- a/gui/gui-manager.h
-+++ b/gui/gui-manager.h
-@@ -63,6 +63,7 @@ enum {
- 
- class Dialog;
- class ThemeEval;
-+class Tooltip;
- class GuiObject;
- 
- #define g_gui	(GUI::GuiManager::instance())
-@@ -83,6 +84,7 @@ typedef Common::FixedStack<Dialog *> DialogStack;
-  */
- class GuiManager : public Common::Singleton<GuiManager>, public CommandSender {
- 	friend class Dialog;
-+	friend class Tooltip;
- 	friend class Common::Singleton<SingletonBaseType>;
- 	GuiManager();
- 	~GuiManager() override;
-@@ -164,6 +166,7 @@ protected:
- 	enum RedrawStatus {
- 		kRedrawDisabled = 0,
- 		kRedrawOpenDialog,
-+		kRedrawOpenTooltip,
- 		kRedrawCloseDialog,
- 		kRedrawTopDialog,
- 		kRedrawFull
diff --git a/backends/platform/atari/readme.txt b/backends/platform/atari/readme.txt
index 60d9f745b79..199de1a38b3 100644
--- a/backends/platform/atari/readme.txt
+++ b/backends/platform/atari/readme.txt
@@ -470,10 +470,6 @@ Changes to upstream
 There are a few features that have been disabled or changed and are not
 possible / plausible to merge into upstream:
 
-- This port contains an implementation of much faster tooltips in the overlay.
-  However, there is a minor rendering bug which sometimes corrupts the
-  background. But since its impact is huge, I left it in.
-
 - This port contains an experimental / pending optimisations to the SCUMM
   engine and audio mixing. I'll try to get them merged in the next release.
 
diff --git a/backends/platform/atari/readme.txt.in b/backends/platform/atari/readme.txt.in
index 4f0f69eaf26..d2a13d4119e 100644
--- a/backends/platform/atari/readme.txt.in
+++ b/backends/platform/atari/readme.txt.in
@@ -470,10 +470,6 @@ Changes to upstream
 There are a few features that have been disabled or changed and are not
 possible / plausible to merge into upstream:
 
-- This port contains an implementation of much faster tooltips in the overlay.
-  However, there is a minor rendering bug which sometimes corrupts the
-  background. But since its impact is huge, I left it in.
-
 - This port contains an experimental / pending optimisations to the SCUMM
   engine and audio mixing. I'll try to get them merged in the next release.
 




More information about the Scummvm-git-logs mailing list