aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorBorja Lorente2016-07-29 12:10:30 +0200
committerBorja Lorente2016-07-31 14:05:15 +0200
commit4a16f5fc3987be23dd67d6ed42c9f8f0453eba6d (patch)
treea2ab33ecc29def5c4fa782b4c963b7ffc3935b61 /engines/wage
parent3d950ad125dee02b45931c2a7943e4ee4d6a93d9 (diff)
downloadscummvm-rg350-4a16f5fc3987be23dd67d6ed42c9f8f0453eba6d.tar.gz
scummvm-rg350-4a16f5fc3987be23dd67d6ed42c9f8f0453eba6d.tar.bz2
scummvm-rg350-4a16f5fc3987be23dd67d6ed42c9f8f0453eba6d.zip
WAGE: Begin adding borders to the windows
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/gui.cpp24
-rw-r--r--engines/wage/gui.h3
2 files changed, 13 insertions, 14 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 49a457d5ac..0e0c034c5b 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -170,7 +170,7 @@ Gui::Gui(WageEngine *engine) {
_consoleWindow->setCallback(consoleWindowCallback, this);
loadBorders();
- //_sceneWindow->setBorders(&_borders);
+ _sceneWindow->setBorders(&_borders);
}
Gui::~Gui() {
@@ -223,8 +223,6 @@ void Gui::draw() {
_sceneDirty = false;
_consoleDirty = false;
_consoleFullRedraw = false;
-
- loadBorders();
}
void Gui::drawScene() {
@@ -370,27 +368,29 @@ void Gui::executeMenuCommand(int action, Common::String &text) {
void Gui::loadBorders() {
Common::File borderfile;
- if (!borderfile.open("borders.bmp")) {
+ if (!borderfile.open("logo.bmp")) {
debug(1, "Cannot open border file");
return;
}
Image::BitmapDecoder bmpDecoder;
Common::SeekableReadStream *stream = borderfile.readStream(borderfile.size());
- const Graphics::Surface * source;
+ Graphics::Surface source;
if (stream) {
- bmpDecoder.loadStream(*stream);
- source = bmpDecoder.getSurface();
+ bmpDecoder.loadStream(*stream);
+ source = *bmpDecoder.getSurface();
+ source.convertToInPlace(_borders.getSupportedPixelFormat(), bmpDecoder.getPalette());
- _borders.create(source->w, source->h, source->format);
- _borders.copyRectToSurface(*source, 0, 0, Common::Rect(0, 0, source->w, source->h));
+ _borders.create(source.w, source.h, source.format);
+ _borders.copyFrom(source);
+ _borders.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();
+ //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();
}
debug(1, "Hello");
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index 23ee9f0660..a72f469ccd 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -61,9 +61,8 @@
#include "common/file.h"
#include "graphics/pixelformat.h"
#include "image/bmp.h"
-#include "image/png.h"
-#include "graphics/primitives.h"
+#include "graphics/palette.h"
namespace Wage {