diff options
author | Johannes Schickel | 2006-01-27 15:43:23 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-01-27 15:43:23 +0000 |
commit | 5051b080a2cfefef81907be0324e229f284ae355 (patch) | |
tree | af2b67affe5aaf357c3278e3befdbd412dea5545 /gui/dialog.cpp | |
parent | 901645cb0f28ef0278e5b5e3a7347a85f9142b8b (diff) | |
download | scummvm-rg350-5051b080a2cfefef81907be0324e229f284ae355.tar.gz scummvm-rg350-5051b080a2cfefef81907be0324e229f284ae355.tar.bz2 scummvm-rg350-5051b080a2cfefef81907be0324e229f284ae355.zip |
- adds the new gui renderer also a new implementation for the classic gui
- adds a ImageMan and ImageDec class for loading and managing image files
- adds a loader for zip files which is used by the new theme and the image manager
- changes the widgets to use the new gui code
- changes the scumm dialogs to use the new gui code
- fixes a #include problem in the sky debugger with the new gui code
To use the new gui copy gui/themes/default-theme.zip to your extrapath.
If the theme zip can not be found the gui will fallback to the classic theme.
If you want to change the gui styles use "gui_theme=classic" for the classic theme
and "gui_theme=default-theme" for the new theme.
Thanks to eriktorbjorn for testing and help with the new theme and to sev for
reviewing this patch.
svn-id: r20227
Diffstat (limited to 'gui/dialog.cpp')
-rw-r--r-- | gui/dialog.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index fd8cec6a87..c6be54248d 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -40,7 +40,7 @@ namespace GUI { Dialog::Dialog(int x, int y, int w, int h) : GuiObject(x, y, w, h), - _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false) { + _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _mainDialog(false) { } Dialog::~Dialog() { @@ -88,6 +88,18 @@ void Dialog::close() { releaseFocus(); } +void Dialog::handleScreenChanged() { + // The screen has changed. That means the screen visual may also have + // changed, so any cached image may be invalid. The subsequent redraw + // should be treated as the very first draw. + + Widget *w = _firstWidget; + while (w) { + w->setHints(THEME_HINT_FIRST_DRAW); + w = w->_next; + } +} + void Dialog::releaseFocus() { if (_focusedWidget) { _focusedWidget->lostFocus(); @@ -104,8 +116,7 @@ void Dialog::drawDialog() { if (!isVisible()) return; - g_gui.blendRect(_x, _y, _w, _h, g_gui._bgcolor); - g_gui.box(_x, _y, _w, _h, g_gui._color, g_gui._shadowcolor); + g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), Theme::kStateEnabled, _mainDialog); // Draw all children Widget *w = _firstWidget; @@ -113,9 +124,6 @@ void Dialog::drawDialog() { w->draw(); w = w->_next; } - - // Flag the draw area as dirty - g_gui.addDirtyRect(_x, _y, _w, _h); } void Dialog::handleMouseDown(int x, int y, int button, int clickCount) { |