diff options
author | Eugene Sandulenko | 2016-08-03 14:37:38 +0200 |
---|---|---|
committer | GitHub | 2016-08-03 14:37:38 +0200 |
commit | a00272c62c012ed4f6ee98ada7415064e8faac5a (patch) | |
tree | 1ad50f4d2c7307b1b6cb26f92bafcec406cdd00b /engines/wage/gui.cpp | |
parent | 08c881e8eb72072816ab6539dc603f27963cbc65 (diff) | |
parent | ff9b1ccb57fad47b9bb32bb77c83a06c6fd75958 (diff) | |
download | scummvm-rg350-a00272c62c012ed4f6ee98ada7415064e8faac5a.tar.gz scummvm-rg350-a00272c62c012ed4f6ee98ada7415064e8faac5a.tar.bz2 scummvm-rg350-a00272c62c012ed4f6ee98ada7415064e8faac5a.zip |
Merge pull request #796 from blorente/move-macgui
GRAPHICS/WAGE: Extract Mac GUI system.
Diffstat (limited to 'engines/wage/gui.cpp')
-rw-r--r-- | engines/wage/gui.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index cdc646f649..86c2a9bfad 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -49,19 +49,19 @@ #include "common/system.h" #include "graphics/cursorman.h" #include "graphics/primitives.h" +#include "graphics/macgui/macwindowmanager.h" +#include "graphics/macgui/macwindow.h" +#include "graphics/macgui/macmenu.h" #include "wage/wage.h" #include "wage/design.h" #include "wage/entities.h" #include "wage/gui.h" -#include "wage/macwindow.h" -#include "wage/macwindowmanager.h" -#include "wage/macmenu.h" #include "wage/world.h" namespace Wage { -static const MenuData menuSubItems[] = { +static const Graphics::MenuData menuSubItems[] = { { kMenuHighLevel, "File", 0, 0, false }, { kMenuHighLevel, "Edit", 0, 0, false }, { kMenuFile, "New", kMenuActionNew, 0, false }, @@ -168,6 +168,9 @@ Gui::Gui(WageEngine *engine) { _consoleWindow = _wm.addWindow(true, true, true); _consoleWindow->setCallback(consoleWindowCallback, this); + + loadBorders(); + } Gui::~Gui() { @@ -363,4 +366,30 @@ void Gui::executeMenuCommand(int action, Common::String &text) { } } +void Gui::loadBorders() { + // Do not load borders for now + //loadBorder(_sceneWindow, "border_inac.bmp", false); + //loadBorder(_sceneWindow, "border_act.bmp", true); +} + +void Gui::loadBorder(Graphics::MacWindow *target, Common::String filename, bool active) { + Common::File borderfile; + + if (!borderfile.open(filename)) { + debug(1, "Cannot open border file"); + return; + } + + Image::BitmapDecoder bmpDecoder; + Common::SeekableReadStream *stream = borderfile.readStream(borderfile.size()); + if (stream) { + + target->loadBorder(*stream, active, 10, 10, 1, 1); + + borderfile.close(); + + delete stream; + } +} + } // End of namespace Wage |