aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBorja Lorente2016-07-29 12:15:01 +0200
committerBorja Lorente2016-07-31 14:45:36 +0200
commit1bfb1a561c61a30865ba5fadeb3cdb76831ad522 (patch)
tree9d8ac60cb3aad482c3f15f3ae2ad596f07dc9e83 /engines
parenta2955b102547ab37a7cf9b42ca0addeed82bb942 (diff)
downloadscummvm-rg350-1bfb1a561c61a30865ba5fadeb3cdb76831ad522.tar.gz
scummvm-rg350-1bfb1a561c61a30865ba5fadeb3cdb76831ad522.tar.bz2
scummvm-rg350-1bfb1a561c61a30865ba5fadeb3cdb76831ad522.zip
WAGE: Implement active/inactive borders
Diffstat (limited to 'engines')
-rw-r--r--engines/wage/gui.cpp37
-rw-r--r--engines/wage/gui.h6
2 files changed, 31 insertions, 12 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 4ef2cf8d30..35a8f28e5f 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -170,7 +170,8 @@ Gui::Gui(WageEngine *engine) {
_consoleWindow->setCallback(consoleWindowCallback, this);
loadBorders();
- _sceneWindow->setBorders(&_borders);
+ _sceneWindow->setBorder(_activeBorder, true);
+ _sceneWindow->setBorder(_inactiveBorder, false);
}
Gui::~Gui() {
@@ -368,7 +369,7 @@ void Gui::executeMenuCommand(int action, Common::String &text) {
void Gui::loadBorders() {
Common::File borderfile;
- if (!borderfile.open("border.bmp")) {
+ if (!borderfile.open("border_act.bmp")) {
debug(1, "Cannot open border file");
return;
}
@@ -380,19 +381,35 @@ void Gui::loadBorders() {
if (stream) {
bmpDecoder.loadStream(*stream);
source = *(bmpDecoder.getSurface());
- source.convertToInPlace(_borders.getSupportedPixelFormat(), bmpDecoder.getPalette());
- _borders.create(source.w, source.h, source.format);
- _borders.copyFrom(source);
- _borders.applyColorKey(255, 0, 255, false);
+
+ _activeBorder = new Graphics::TransparentSurface();
+ source.convertToInPlace(_activeBorder->getSupportedPixelFormat(), bmpDecoder.getPalette());
+ _activeBorder->create(source.w, source.h, source.format);
+ _activeBorder->copyFrom(source);
+ _activeBorder->applyColorKey(255, 0, 255, false);
delete stream;
+ }
- //g_system->copyRectToScreen(source.getPixels(), source.pitch, 40, 0, source.w, source.h);
- //g_system->copyRectToScreen(_borders.getPixels(), _borders.pitch, 40, 100, _borders.w, _borders.h);
- //g_system->updateScreen();
+ if (!borderfile.open("border_inac.bmp")) {
+ debug(1, "Cannot open border file");
+ return;
}
+
+ stream = borderfile.readStream(borderfile.size());
- debug(1, "Hello");
+ if (stream) {
+ bmpDecoder.loadStream(*stream);
+ source = *(bmpDecoder.getSurface());
+
+ _inactiveBorder = new Graphics::TransparentSurface();
+ source.convertToInPlace(_inactiveBorder->getSupportedPixelFormat(), bmpDecoder.getPalette());
+ _inactiveBorder->create(source.w, source.h, source.format);
+ _inactiveBorder->copyFrom(source);
+ _inactiveBorder->applyColorKey(255, 0, 255, false);
+
+ delete stream;
+ }
}
} // End of namespace Wage
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index a72f469ccd..a6a25266b1 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -154,6 +154,7 @@ private:
int calcTextX(int x, int textLine);
int calcTextY(int y);
void updateTextSelection(int x, int y);
+
void loadBorders();
public:
@@ -173,9 +174,10 @@ public:
Graphics::MacWindow *_sceneWindow;
Graphics::MacWindow *_consoleWindow;
- Graphics::TransparentSurface _borders;
-
private:
+ Graphics::TransparentSurface *_activeBorder;
+ Graphics::TransparentSurface *_inactiveBorder;
+
Graphics::ManagedSurface _console;
Graphics::Menu *_menu;
bool _sceneDirty;