From 7df3792ae360f7d0ec5ea4a50b2b7b68c1e7ccda Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 1 Oct 2022 16:57:03 +0200 Subject: [PATCH] GUI: Implement drawing mode of top dialog only --- gui/gui-manager.cpp | 19 ++++++++++++++++--- gui/gui-manager.h | 4 ++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 7073dabaeb4..57e4ebace04 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -78,6 +78,8 @@ GuiManager::GuiManager() : CommandSender(nullptr), _redrawStatus(kRedrawDisabled _topDialogLeftPadding = 0; _topDialogRightPadding = 0; + _displayTopDialogOnly = false; + // Clear the cursor memset(_cursor, 0xFF, sizeof(_cursor)); @@ -343,6 +345,15 @@ void GuiManager::redrawFull() { _system->updateScreen(); } +void GuiManager::displayTopDialogOnly(bool mode) { + if (mode == _displayTopDialogOnly) + return; + + _displayTopDialogOnly = mode; + + redrawFull(); +} + void GuiManager::redraw() { ThemeEngine::ShadingStyle shading; @@ -369,9 +380,11 @@ void GuiManager::redraw() { _theme->clearAll(); _theme->drawToBackbuffer(); - for (DialogStack::size_type i = 0; i < _dialogStack.size() - 1; i++) { - _dialogStack[i]->drawDialog(kDrawLayerBackground); - _dialogStack[i]->drawDialog(kDrawLayerForeground); + if (!_displayTopDialogOnly) { + for (DialogStack::size_type i = 0; i < _dialogStack.size() - 1; i++) { + _dialogStack[i]->drawDialog(kDrawLayerBackground); + _dialogStack[i]->drawDialog(kDrawLayerForeground); + } } // fall through diff --git a/gui/gui-manager.h b/gui/gui-manager.h index 66df2f6acdb..8dfb46210ba 100644 --- a/gui/gui-manager.h +++ b/gui/gui-manager.h @@ -140,6 +140,8 @@ public: void initIconsSet(); + void displayTopDialogOnly(bool mode); + protected: enum RedrawStatus { kRedrawDisabled = 0, @@ -169,6 +171,8 @@ protected: int _topDialogLeftPadding; int _topDialogRightPadding; + bool _displayTopDialogOnly; + Common::Mutex _iconsMutex; Common::SearchSet _iconsSet; bool _iconsSetChanged;