aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorEugene Sandulenko2016-04-14 18:26:25 +0200
committerEugene Sandulenko2016-04-14 18:35:16 +0200
commit41537807036118c872964da11dc34195ca5626c8 (patch)
treed1a8e83a98f41379f78aa0ecce7bcca33d662619 /engines/wage
parent5e4980090198a334b136bcdce16ea6addbe708a2 (diff)
downloadscummvm-rg350-41537807036118c872964da11dc34195ca5626c8.tar.gz
scummvm-rg350-41537807036118c872964da11dc34195ca5626c8.tar.bz2
scummvm-rg350-41537807036118c872964da11dc34195ca5626c8.zip
WAGE: Started to plug the WM in
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/gui.cpp7
-rw-r--r--engines/wage/gui.h5
-rw-r--r--engines/wage/macwindow.cpp8
-rw-r--r--engines/wage/macwindow.h1
-rw-r--r--engines/wage/macwindowmanager.h2
5 files changed, 23 insertions, 0 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 00b7e24735..50b8b00861 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -186,6 +186,9 @@ Gui::Gui(WageEngine *engine) {
g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 200000, this, "wageCursor");
_menu = new Menu(this);
+
+ _sceneWindowId = _wm.add(false);
+ _consoleWindowId = _wm.add(true);
}
Gui::~Gui() {
@@ -278,6 +281,10 @@ void Gui::drawScene() {
_scene = _engine->_world->_player->_currentScene;
+ MacWindow *w = _wm.getWindow(_sceneWindowId);
+
+ w->setDimensions(*_scene->_designBounds);
+
_sceneDirty = true;
_consoleDirty = true;
_menuDirty = true;
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index c1f8b83a11..11e001b274 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -55,6 +55,7 @@
#include "common/rect.h"
#include "wage/macwindow.h"
+#include "wage/macwindowmanager.h"
namespace Wage {
@@ -176,6 +177,10 @@ private:
Common::String _undobuffer;
int _inputTextLineNum;
+
+ MacWindowManager _wm;
+ int _sceneWindowId;
+ int _consoleWindowId;
};
} // End of namespace Wage
diff --git a/engines/wage/macwindow.cpp b/engines/wage/macwindow.cpp
index a94558900a..3abfdf6017 100644
--- a/engines/wage/macwindow.cpp
+++ b/engines/wage/macwindow.cpp
@@ -74,6 +74,9 @@ void MacWindow::setActive(bool active) {
}
void MacWindow::resize(int w, int h) {
+ if (_surface.w == w && _surface.h == h)
+ return;
+
_surface.free();
_surface.create(w, h, Graphics::PixelFormat::createFormatCLUT8());
_borderSurface.free();
@@ -92,6 +95,11 @@ void MacWindow::move(int x, int y) {
_borderDims.moveTo(x - kBorderWidth, y - kBorderWidth);
}
+void MacWindow::setDimensions(const Common::Rect &r) {
+ resize(r.width(), r.height());
+ move(r.left, r.top);
+}
+
void MacWindow::draw(Graphics::Surface *g, bool forceRedraw) {
if (_borderIsDirty || forceRedraw)
drawBorder();
diff --git a/engines/wage/macwindow.h b/engines/wage/macwindow.h
index 6af2db2718..0d7d49f06d 100644
--- a/engines/wage/macwindow.h
+++ b/engines/wage/macwindow.h
@@ -74,6 +74,7 @@ public:
~MacWindow();
void move(int x, int y);
void resize(int w, int h);
+ void setDimensions(const Common::Rect &r);
void draw(Graphics::Surface *g, bool forceRedraw = false);
void setActive(bool active);
Graphics::ManagedSurface *getSurface() { return &_surface; }
diff --git a/engines/wage/macwindowmanager.h b/engines/wage/macwindowmanager.h
index 0c35356863..b15c7737c6 100644
--- a/engines/wage/macwindowmanager.h
+++ b/engines/wage/macwindowmanager.h
@@ -62,6 +62,8 @@ public:
void draw(Graphics::Surface *g);
+ MacWindow *getWindow(int id) { return _windows[id]; }
+
private:
Common::List<MacWindow *> _windowStack;
Common::Array<MacWindow *> _windows;