aboutsummaryrefslogtreecommitdiff
path: root/gui/gui-manager.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2018-01-06 14:40:02 +0100
committerBastien Bouclet2018-01-27 18:12:34 +0100
commit0496ede62f8b86e1885d594e3aa5320c96b708eb (patch)
tree6a4453606061a15a5ee3462d1680936c257ae7f5 /gui/gui-manager.cpp
parent3b50b57f544cb7c719a5f02f061853e10885ae6c (diff)
downloadscummvm-rg350-0496ede62f8b86e1885d594e3aa5320c96b708eb.tar.gz
scummvm-rg350-0496ede62f8b86e1885d594e3aa5320c96b708eb.tar.bz2
scummvm-rg350-0496ede62f8b86e1885d594e3aa5320c96b708eb.zip
GUI: Implement dirty-checking for widget redraws
Diffstat (limited to 'gui/gui-manager.cpp')
-rw-r--r--gui/gui-manager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 2e947c6f32..4b91019372 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -208,7 +208,7 @@ bool GuiManager::loadNewTheme(Common::String id, ThemeEngine::GraphicsMode gfx,
void GuiManager::redraw() {
ThemeEngine::ShadingStyle shading;
- if (_redrawStatus == kRedrawDisabled || _dialogStack.empty())
+ if (_dialogStack.empty())
return;
shading = (ThemeEngine::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0);
@@ -241,9 +241,12 @@ void GuiManager::redraw() {
break;
default:
- return;
+ break;
}
+ // Redraw the widgets that are marked as dirty
+ _dialogStack.top()->drawWidgets();
+
_theme->updateScreen();
_redrawStatus = kRedrawDisabled;
}
@@ -304,8 +307,6 @@ void GuiManager::runLoop() {
while (!_dialogStack.empty() && activeDialog == getTopDialog() && !eventMan->shouldQuit()) {
uint32 frameStartTime = _system->getMillis(true);
- redraw();
-
// Don't "tickle" the dialog until the theme has had a chance
// to re-allocate buffers in case of a scaler change.
@@ -365,7 +366,7 @@ void GuiManager::runLoop() {
}
}
- _theme->updateScreen();
+ redraw();
// Delay until the allocated frame time is elapsed to match the target frame rate
uint32 actualFrameDuration = _system->getMillis(true) - frameStartTime;