[Scummvm-cvs-logs] scummvm master -> 41537807036118c872964da11dc34195ca5626c8
sev-
sev at scummvm.org
Thu Apr 14 18:35:28 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4153780703 WAGE: Started to plug the WM in
Commit: 41537807036118c872964da11dc34195ca5626c8
https://github.com/scummvm/scummvm/commit/41537807036118c872964da11dc34195ca5626c8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-04-14T18:35:16+02:00
Commit Message:
WAGE: Started to plug the WM in
Changed paths:
engines/wage/gui.cpp
engines/wage/gui.h
engines/wage/macwindow.cpp
engines/wage/macwindow.h
engines/wage/macwindowmanager.h
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 00b7e24..50b8b00 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 c1f8b83..11e001b 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 a945589..3abfdf6 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 6af2db2..0d7d49f 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 0c35356..b15c773 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;
More information about the Scummvm-git-logs
mailing list