aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-04-19 10:56:42 +0200
committerEugene Sandulenko2016-04-19 10:56:42 +0200
commitc9d3b7210e10b32c48ecd037e42fa9ef946576ac (patch)
tree6d5302b1d0d4586fcfa5ae491badbb16facca96a
parentb8ec681b86b165caf1486fdf2f1b11c0567e6714 (diff)
downloadscummvm-rg350-c9d3b7210e10b32c48ecd037e42fa9ef946576ac.tar.gz
scummvm-rg350-c9d3b7210e10b32c48ecd037e42fa9ef946576ac.tar.bz2
scummvm-rg350-c9d3b7210e10b32c48ecd037e42fa9ef946576ac.zip
WAGE: Switched WM::add() to returning window pointer instead of id
-rw-r--r--engines/wage/gui.cpp21
-rw-r--r--engines/wage/gui.h4
-rw-r--r--engines/wage/macwindowmanager.cpp4
-rw-r--r--engines/wage/macwindowmanager.h2
4 files changed, 14 insertions, 17 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 5bb342fcab..c93c1ee751 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -189,8 +189,8 @@ Gui::Gui(WageEngine *engine) {
_menu = new Menu(this);
- _sceneWindowId = _wm.add(false);
- _consoleWindowId = _wm.add(true);
+ _sceneWindow = _wm.add(false);
+ _consoleWindow = _wm.add(true);
}
Gui::~Gui() {
@@ -282,12 +282,10 @@ void Gui::drawScene() {
_scene = _engine->_world->_player->_currentScene;
- MacWindow *w = _wm.getWindow(_sceneWindowId);
-
- w->setDimensions(*_scene->_designBounds);
- w->setTitle(_scene->_name);
- _scene->paint(w->getSurface(), 0, 0);
- w->setDirty(true);
+ _sceneWindow->setDimensions(*_scene->_designBounds);
+ _sceneWindow->setTitle(_scene->_name);
+ _scene->paint(_sceneWindow->getSurface(), 0, 0);
+ _sceneWindow->setDirty(true);
_sceneDirty = true;
_consoleDirty = true;
@@ -310,11 +308,10 @@ void Gui::drawConsole() {
if (!_consoleDirty && !_consoleFullRedraw && !_bordersDirty && !_sceneDirty)
return;
- MacWindow *w = _wm.getWindow(_consoleWindowId);
- w->setDimensions(*_scene->_textBounds);
- renderConsole(w->getSurface(), Common::Rect(kBorderWidth - 2, kBorderWidth - 2,
+ _consoleWindow->setDimensions(*_scene->_textBounds);
+ renderConsole(_consoleWindow->getSurface(), Common::Rect(kBorderWidth - 2, kBorderWidth - 2,
_scene->_textBounds->width() - kBorderWidth, _scene->_textBounds->height() - kBorderWidth));
- w->setDirty(true);
+ _consoleWindow->setDirty(true);
}
void Gui::drawBox(Graphics::ManagedSurface *g, int x, int y, int w, int h) {
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index c731c94425..58d24bfb5d 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -181,8 +181,8 @@ private:
int _inputTextLineNum;
MacWindowManager _wm;
- int _sceneWindowId;
- int _consoleWindowId;
+ MacWindow *_sceneWindow;
+ MacWindow *_consoleWindow;
};
} // End of namespace Wage
diff --git a/engines/wage/macwindowmanager.cpp b/engines/wage/macwindowmanager.cpp
index 1bf7b54190..3fbd156d06 100644
--- a/engines/wage/macwindowmanager.cpp
+++ b/engines/wage/macwindowmanager.cpp
@@ -69,7 +69,7 @@ MacWindowManager::~MacWindowManager() {
delete _windows[i];
}
-int MacWindowManager::add(bool scrollable) {
+MacWindow *MacWindowManager::add(bool scrollable) {
MacWindow *w = new MacWindow(_lastId, scrollable);
_windows.push_back(w);
@@ -79,7 +79,7 @@ int MacWindowManager::add(bool scrollable) {
_lastId++;
- return _lastId - 1;
+ return w;
}
void MacWindowManager::setActive(int id) {
diff --git a/engines/wage/macwindowmanager.h b/engines/wage/macwindowmanager.h
index d074564f54..41744931a2 100644
--- a/engines/wage/macwindowmanager.h
+++ b/engines/wage/macwindowmanager.h
@@ -59,7 +59,7 @@ public:
void setScreen(Graphics::ManagedSurface *screen) { _screen = screen; }
- int add(bool scrollable);
+ MacWindow *add(bool scrollable);
void setActive(int id);
void setFullRefresh(bool redraw) { _fullRefresh = true; }