diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/gui.cpp | 66 | ||||
-rw-r--r-- | engines/wage/gui.h | 2 |
2 files changed, 39 insertions, 29 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 15d82a68fb..3591000edb 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -239,37 +239,10 @@ void Gui::draw() { } if (_scene != _engine->_world->_player->_currentScene || _sceneDirty) { - _scene = _engine->_world->_player->_currentScene; - - drawDesktop(); - - _sceneDirty = true; - _consoleDirty = true; - _menuDirty = true; - _consoleFullRedraw = true; - - _scene->paint(&_screen, _scene->_designBounds->left, _scene->_designBounds->top); - - _sceneArea.left = _scene->_designBounds->left + kBorderWidth - 2; - _sceneArea.top = _scene->_designBounds->top + kBorderWidth - 2; - _sceneArea.setWidth(_scene->_designBounds->width() - 2 * kBorderWidth); - _sceneArea.setHeight(_scene->_designBounds->height() - 2 * kBorderWidth); - - _consoleTextArea.left = _scene->_textBounds->left + kBorderWidth - 2; - _consoleTextArea.top = _scene->_textBounds->top + kBorderWidth - 2; - _consoleTextArea.setWidth(_scene->_textBounds->width() - 2 * kBorderWidth); - _consoleTextArea.setHeight(_scene->_textBounds->height() - 2 * kBorderWidth); + drawScene(); } - if (_scene && (_bordersDirty || _sceneDirty)) - paintBorder(&_screen, _sceneArea, kWindowScene); - - // Render console - if (_consoleDirty || _consoleFullRedraw) - renderConsole(&_screen, _consoleTextArea); - - if (_bordersDirty || _consoleDirty || _consoleFullRedraw) - paintBorder(&_screen, _consoleTextArea, kWindowConsole); + drawConsole(); if (_menuDirty) _menu->render(); @@ -288,6 +261,41 @@ void Gui::draw() { _consoleFullRedraw = false; } +void Gui::drawScene() { + _scene = _engine->_world->_player->_currentScene; + + drawDesktop(); + + _sceneDirty = true; + _consoleDirty = true; + _menuDirty = true; + _consoleFullRedraw = true; + + _scene->paint(&_screen, _scene->_designBounds->left, _scene->_designBounds->top); + + _sceneArea.left = _scene->_designBounds->left + kBorderWidth - 2; + _sceneArea.top = _scene->_designBounds->top + kBorderWidth - 2; + _sceneArea.setWidth(_scene->_designBounds->width() - 2 * kBorderWidth); + _sceneArea.setHeight(_scene->_designBounds->height() - 2 * kBorderWidth); + + _consoleTextArea.left = _scene->_textBounds->left + kBorderWidth - 2; + _consoleTextArea.top = _scene->_textBounds->top + kBorderWidth - 2; + _consoleTextArea.setWidth(_scene->_textBounds->width() - 2 * kBorderWidth); + _consoleTextArea.setHeight(_scene->_textBounds->height() - 2 * kBorderWidth); + + if (_scene && (_bordersDirty || _sceneDirty)) + paintBorder(&_screen, _sceneArea, kWindowScene); +} + +// Render console +void Gui::drawConsole() { + if (_consoleDirty || _consoleFullRedraw) + renderConsole(&_screen, _consoleTextArea); + + if (_bordersDirty || _consoleDirty || _consoleFullRedraw) + paintBorder(&_screen, _consoleTextArea, kWindowConsole); +} + void Gui::drawBox(Graphics::Surface *g, int x, int y, int w, int h) { Common::Rect r(x, y, x + w + 1, y + h + 1); diff --git a/engines/wage/gui.h b/engines/wage/gui.h index c136163951..48ec41c30a 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -121,6 +121,8 @@ public: void enableNewGameMenus(); private: + void drawScene(); + void drawConsole(); void undrawCursor(); void drawDesktop(); void paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowType, int highlightedPart = kBorderNone, |