aboutsummaryrefslogtreecommitdiff
path: root/gui/widgets
diff options
context:
space:
mode:
authorBastien Bouclet2018-01-07 10:39:22 +0100
committerEugene Sandulenko2018-03-12 11:46:04 +0100
commit4d0bb753e418ee9f70937777cb3827cd3181a26b (patch)
tree151cffe7d73693389430ba33f8843f941629c6fb /gui/widgets
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 'gui/widgets')
-rw-r--r--gui/widgets/popup.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index f59a89e543..40af769a34 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -37,7 +37,6 @@ class PopUpDialog : public Dialog {
protected:
PopUpWidget *_popUpBoss;
int _clickX, _clickY;
- byte *_buffer;
int _selection;
uint32 _openTime;
bool _twoColumns;
@@ -49,7 +48,7 @@ protected:
public:
PopUpDialog(PopUpWidget *boss, int clickX, int clickY);
- void drawDialog();
+ void drawDialog(DrawLayer layerToDraw) override;
void handleMouseUp(int x, int y, int button, int clickCount);
void handleMouseWheel(int x, int y, int direction); // Scroll through entries with scroll wheel
@@ -70,9 +69,9 @@ protected:
PopUpDialog::PopUpDialog(PopUpWidget *boss, int clickX, int clickY)
: Dialog(0, 0, 16, 16),
_popUpBoss(boss) {
+ _backgroundType = ThemeEngine::kDialogBackgroundNone;
_openTime = 0;
- _buffer = nullptr;
_entriesPerColumn = 1;
// Copy the selection index
@@ -148,7 +147,9 @@ PopUpDialog::PopUpDialog(PopUpWidget *boss, int clickX, int clickY)
_clickY = clickY - _y;
}
-void PopUpDialog::drawDialog() {
+void PopUpDialog::drawDialog(DrawLayer layerToDraw) {
+ Dialog::drawDialog(layerToDraw);
+
// Draw the menu border
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0);