aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorBastien Bouclet2018-01-07 10:39:22 +0100
committerEugene Sandulenko2018-03-12 11:46:04 +0100
commit4d0bb753e418ee9f70937777cb3827cd3181a26b (patch)
tree151cffe7d73693389430ba33f8843f941629c6fb /engines/scumm
parent99eb0159dbd35c0081352fbc9bfeaf3077204655 (diff)
downloadscummvm-rg350-4d0bb753e418ee9f70937777cb3827cd3181a26b.tar.gz
scummvm-rg350-4d0bb753e418ee9f70937777cb3827cd3181a26b.tar.bz2
scummvm-rg350-4d0bb753e418ee9f70937777cb3827cd3181a26b.zip
GUI: Remove the ThemeItem draw queues
Drawing nows happens directly when the Dialog or Widget draw methods are called. This makes it easy to debug why a particular low level draw method was called, by inspecting the call stack. This replaces the notion of "buffering" by two independant ways to control what is drawn and where: - The active layer is used to select whether the foreground or background part of the dialogs are rendered by the draw calls. - The active surface is used to select if the draw calls affect the back buffer or the screen. The foreground layer of the active dialog is drawn directly to the screen. Its background layer is drawn to the back buffer. This way widgets can restore the back buffer in order to update without having to redraw the dialog's background. Dialogs lower in the dialog stack are drawn entirely to the back buffer.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/dialogs.cpp5
-rw-r--r--engines/scumm/dialogs.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 1af752326a..215abe107b 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -514,9 +514,10 @@ ValueDisplayDialog::ValueDisplayDialog(const Common::String& label, int minVal,
assert(_min <= _value && _value <= _max);
}
-void ValueDisplayDialog::drawDialog() {
+void ValueDisplayDialog::drawDialog(GUI::DrawLayer layerToDraw) {
+ Dialog::drawDialog(layerToDraw);
+
const int labelWidth = _w - 8 - _percentBarWidth;
- g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), GUI::ThemeEngine::kDialogBackgroundDefault);
g_gui.theme()->drawText(Common::Rect(_x+4, _y+4, _x+labelWidth+4,
_y+g_gui.theme()->getFontHeight()+4), _label);
g_gui.theme()->drawSlider(Common::Rect(_x+4+labelWidth, _y+4, _x+_w-4, _y+_h-4),
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index bd0645597e..9dee4c8a0b 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -128,7 +128,7 @@ public:
ValueDisplayDialog(const Common::String& label, int minVal, int maxVal, int val, uint16 incKey, uint16 decKey);
virtual void open();
- virtual void drawDialog();
+ void drawDialog(GUI::DrawLayer layerToDraw) override;
virtual void handleTickle();
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
close();