diff options
-rw-r--r-- | engines/wage/gui-console.cpp | 5 | ||||
-rw-r--r-- | engines/wage/gui.cpp | 17 | ||||
-rw-r--r-- | engines/wage/gui.h | 3 | ||||
-rw-r--r-- | engines/wage/macwindow.cpp | 10 |
4 files changed, 16 insertions, 19 deletions
diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp index 840b8e3ced..ea66826c3b 100644 --- a/engines/wage/gui-console.cpp +++ b/engines/wage/gui-console.cpp @@ -285,10 +285,7 @@ void Gui::drawInput() { if (!_screen.getPixels()) return; - if (_sceneIsActive) { - _sceneIsActive = false; - _bordersDirty = true; - } + _wm.setActive(_consoleWindow->getId()); _out.pop_back(); _lines.pop_back(); diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 2446be9945..b9635fb086 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -151,7 +151,6 @@ Gui::Gui(WageEngine *engine) { _scene = NULL; _sceneDirty = true; _consoleDirty = true; - _bordersDirty = true; _menuDirty = true; _cursorDirty = false; _consoleFullRedraw = true; @@ -163,7 +162,6 @@ Gui::Gui(WageEngine *engine) { _consoleLineHeight = 8; // Dummy value which makes sense _consoleNumLines = 24; // Dummy value _builtInFonts = false; - _sceneIsActive = false; _cursorX = 0; _cursorY = 0; @@ -262,10 +260,12 @@ void Gui::draw() { _sceneWindow->setDimensions(*_scene->_designBounds); _sceneWindow->setTitle(_scene->_name); + _sceneWindow->setDirty(true); _consoleWindow->setDimensions(*_scene->_textBounds); + _consoleWindow->setDirty(true); } - if (_sceneDirty || _bordersDirty) { + if (_sceneDirty) { drawDesktop(); _wm.setFullRefresh(true); } @@ -287,13 +287,12 @@ void Gui::draw() { _sceneDirty = false; _consoleDirty = false; - _bordersDirty = false; _menuDirty = false; _consoleFullRedraw = false; } void Gui::drawScene() { - if (!_sceneDirty && !_bordersDirty) + if (!_sceneDirty) return; _scene->paint(_sceneWindow->getSurface(), 0, 0); @@ -304,11 +303,6 @@ void Gui::drawScene() { _menuDirty = true; _consoleFullRedraw = true; - _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); @@ -342,7 +336,7 @@ bool Gui::processSceneEvents(WindowClick click, Common::Event &event) { // Render console void Gui::drawConsole() { - if (!_consoleDirty && !_consoleFullRedraw && !_bordersDirty && !_sceneDirty) + if (!_consoleDirty && !_consoleFullRedraw && !_sceneDirty) return; renderConsole(_consoleWindow->getSurface(), Common::Rect(kBorderWidth - 2, kBorderWidth - 2, @@ -545,7 +539,6 @@ void Gui::mouseUp(int x, int y) { if (_menu->mouseRelease(x, y)) { _sceneDirty = true; _consoleDirty = true; - _bordersDirty = true; _menuDirty = true; } diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 6783b2efdd..c337b1f9f3 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -158,7 +158,6 @@ private: Menu *_menu; bool _sceneDirty; bool _consoleDirty; - bool _bordersDirty; Common::StringArray _out; Common::StringArray _lines; @@ -167,8 +166,6 @@ private: uint _consoleNumLines; bool _consoleFullRedraw; - Common::Rect _sceneArea; - bool _sceneIsActive; bool _cursorIsArrow; bool _inTextSelection; diff --git a/engines/wage/macwindow.cpp b/engines/wage/macwindow.cpp index 01767d7732..7b913355ac 100644 --- a/engines/wage/macwindow.cpp +++ b/engines/wage/macwindow.cpp @@ -91,12 +91,20 @@ void MacWindow::resize(int w, int h) { _dims.setWidth(w); _dims.setHeight(h); + + _contentIsDirty = true; + _borderIsDirty = true; } void MacWindow::move(int x, int y) { + if (_dims.left == x && _dims.top == y) + return; + _dims.moveTo(x, y); _innerDims.setWidth(0); // Invalidate rect + + _contentIsDirty = true; } void MacWindow::setDimensions(const Common::Rect &r) { @@ -113,6 +121,8 @@ bool MacWindow::draw(Graphics::ManagedSurface *g, bool forceRedraw) { if (_borderIsDirty || forceRedraw) drawBorder(); + _contentIsDirty = false; + // Compose _composeSurface.blitFrom(_surface, Common::Rect(0, 0, _surface.w - 2, _surface.h - 2), Common::Point(2, 2)); _composeSurface.transBlitFrom(_borderSurface, kColorGreen); |