diff options
author | Max Horn | 2002-07-08 00:10:11 +0000 |
---|---|---|
committer | Max Horn | 2002-07-08 00:10:11 +0000 |
commit | c9b1d393b836dc4239a42c0efad7712fb786930f (patch) | |
tree | 613ba6e70de76d499adbe793652289ca2b64c6aa /gui | |
parent | c3b606cd9b0b0445b0360f9a95225186252ae1c1 (diff) | |
download | scummvm-rg350-c9b1d393b836dc4239a42c0efad7712fb786930f.tar.gz scummvm-rg350-c9b1d393b836dc4239a42c0efad7712fb786930f.tar.bz2 scummvm-rg350-c9b1d393b836dc4239a42c0efad7712fb786930f.zip |
delay creation of dialogs till they are used; fixed new pause dialog & use it instead of the old one; dirty area handling in new gui code is more logical/useful now
svn-id: r4487
Diffstat (limited to 'gui')
-rw-r--r-- | gui/dialog.cpp | 3 | ||||
-rw-r--r-- | gui/widget.cpp | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index ab64eafe67..9d253db2cf 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -29,6 +29,7 @@ void Dialog::draw() _gui->clearArea(_x, _y, _w, _h); _gui->box(_x, _y, _w, _h); + _gui->setAreaDirty(_x, _y, _w, _h); while (w) { w->draw(); @@ -194,5 +195,5 @@ void OptionsDialog::handleCommand(uint32 cmd) PauseDialog::PauseDialog(NewGui *gui) : Dialog (gui, 50, 80, 220, 16) { - addResText(2, 2, 220, 16, 10); + addResText(4, 4, 220, 16, 10); } diff --git a/gui/widget.cpp b/gui/widget.cpp index 38033a2d06..ecc4c66608 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -34,6 +34,8 @@ Widget::Widget (Dialog *boss, int x, int y, int w, int h) void Widget::draw() { + NewGui *gui = _boss->_gui; + if (_flags & WIDGET_INVISIBLE) return; @@ -43,24 +45,26 @@ void Widget::draw() // Clear background if (_flags & WIDGET_CLEARBG) - _boss->_gui->clearArea(_x, _y, _w, _h); + gui->clearArea(_x, _y, _w, _h); // Draw border if (_flags & WIDGET_BORDER) { - _boss->_gui->box(_x, _y, _w, _h); + gui->box(_x, _y, _w, _h); _x += 4; _y += 4; } // Now perform the actual widget draw drawWidget(_flags & WIDGET_HILITED); + + // Flag the draw area as dirty + gui->setAreaDirty(_x, _y, _w, _h); + // Restore x/y if (_flags & WIDGET_BORDER) { _x -= 4; _y -= 4; } - - // Restore x/y _x -= _boss->_x; _y -= _boss->_y; } |