diff options
-rw-r--r-- | engines/wage/gui.cpp | 15 | ||||
-rw-r--r-- | engines/wage/gui.h | 4 | ||||
-rw-r--r-- | engines/wage/wage.cpp | 3 |
3 files changed, 9 insertions, 13 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 8ec904eb90..c2b0223398 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -56,6 +56,7 @@ #include "wage/design.h" #include "wage/entities.h" #include "wage/gui.h" +#include "wage/world.h" namespace Wage { @@ -116,7 +117,8 @@ static const byte macCursorBeam[] = { 0, 0, 3, 3, 3, 0, 0, 3, 3, 3, 3, }; -Gui::Gui() { +Gui::Gui(WageEngine *engine) { + _engine = engine; _scene = NULL; _sceneDirty = true; _bordersDirty = true; @@ -146,13 +148,6 @@ Gui::Gui() { Gui::~Gui() { } -void Gui::setScene(Scene *scene) { - if (_scene != scene) - _sceneDirty = true; - - _scene = scene; -} - void Gui::clearOutput() { _out.clear(); } @@ -181,7 +176,9 @@ void Gui::appendText(String &str) { } void Gui::draw() { - if (_scene != NULL && _sceneDirty) { + if (_scene != _engine->_world->_player->_currentScene || _sceneDirty) { + _scene = _engine->_world->_player->_currentScene; + _scene->paint(&_screen, 0 + kComponentsPadding, kMenuHeight + kComponentsPadding); _sceneArea.left = 0 + kComponentsPadding + kBorderWidth; diff --git a/engines/wage/gui.h b/engines/wage/gui.h index 25629f64b9..dc04e90c17 100644 --- a/engines/wage/gui.h +++ b/engines/wage/gui.h @@ -61,11 +61,10 @@ enum WindowType { class Gui { public: - Gui(); + Gui(WageEngine *engine); ~Gui(); void draw(); - void setScene(Scene *scene); void appendText(Common::String &str); void clearOutput(); void mouseMove(int x, int y); @@ -80,6 +79,7 @@ private: void renderMenu(); private: + WageEngine *_engine; Graphics::Surface _screen; Graphics::Surface _console; Scene *_scene; diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index e492bdb8c9..1f4c3729c1 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -96,7 +96,7 @@ Common::Error WageEngine::run() { debug("WageEngine::init"); - _gui = new Gui(); + _gui = new Gui(this); // Your main event loop should be (invoked from) here. _resManager = new Common::MacResManager(); @@ -116,7 +116,6 @@ Common::Error WageEngine::run() { _world->_player->_currentScene = _world->_orderedScenes[1]; _world->_globalScript->execute(_world, 1, &input, NULL, this); - _gui->setScene(_world->_orderedScenes[1]); _gui->draw(); while (true) { |