From e5a64e7b7fae4e87d509724fcac3e5fa6d5c815e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 18 Apr 2016 18:39:45 +0200 Subject: WAGE: Draw windows with WindowManager --- engines/wage/gui.cpp | 23 +++++++---------------- engines/wage/macwindowmanager.h | 2 ++ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 6cb762851d..3afdb48853 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -249,17 +249,16 @@ void Gui::draw() { if (_scene != _engine->_world->_player->_currentScene) _sceneDirty = true; - if (_sceneDirty || _bordersDirty) + if (_sceneDirty || _bordersDirty) { drawDesktop(); - - if (_sceneIsActive) { - drawConsole(); - drawScene(); - } else { - drawScene(); - drawConsole(); + _wm.setFullRefresh(true); } + drawScene(); + drawConsole(); + + _wm.draw(); + if (_menuDirty) _menu->render(); @@ -288,11 +287,7 @@ void Gui::drawScene() { w->setDimensions(*_scene->_designBounds); w->setTitle(_scene->_name); _scene->paint(w->getSurface(), 0, 0); - w->draw(&_screen); w->setDirty(true); - g_system->copyRectToScreen(_screen.getBasePtr(_scene->_designBounds->left - 2, _scene->_designBounds->top - 2), - _screen.pitch, _scene->_designBounds->left - 2, _scene->_designBounds->top - 2, - _scene->_designBounds->width(), _scene->_designBounds->height()); _sceneDirty = true; _consoleDirty = true; @@ -319,11 +314,7 @@ void Gui::drawConsole() { w->setDimensions(*_scene->_textBounds); renderConsole(w->getSurface(), Common::Rect(kBorderWidth - 2, kBorderWidth - 2, _scene->_textBounds->width() - kBorderWidth, _scene->_textBounds->height() - kBorderWidth)); - w->draw(&_screen); w->setDirty(true); - g_system->copyRectToScreen(_screen.getBasePtr(_scene->_textBounds->left - 2, _scene->_textBounds->top - 2), - _screen.pitch, _scene->_textBounds->left - 2, _scene->_textBounds->top - 2, - _scene->_textBounds->width(), _scene->_textBounds->height()); } void Gui::drawBox(Graphics::ManagedSurface *g, int x, int y, int w, int h) { diff --git a/engines/wage/macwindowmanager.h b/engines/wage/macwindowmanager.h index ae4f356d12..d840799961 100644 --- a/engines/wage/macwindowmanager.h +++ b/engines/wage/macwindowmanager.h @@ -62,6 +62,8 @@ public: int add(bool scrollable); void setActive(int id); + void setFullRefresh(bool redraw) { _fullRefresh = true; } + void draw(); MacWindow *getWindow(int id) { return _windows[id]; } -- cgit v1.2.3