diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/design.cpp | 32 | ||||
-rw-r--r-- | engines/wage/design.h | 5 | ||||
-rw-r--r-- | engines/wage/wage.cpp | 26 | ||||
-rw-r--r-- | engines/wage/wage.h | 18 |
4 files changed, 59 insertions, 22 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 59cf80f15b..399c2adcef 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -45,6 +45,7 @@ * */ +#include "common/system.h" #include "wage/wage.h" #include "wage/design.h" @@ -55,7 +56,9 @@ Design::Design(Common::SeekableReadStream *data) { _data = (byte *)malloc(_len); data->read(_data, _len); - paint(0, 0, false); + Graphics::Surface screen; + screen.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); + paint(&screen, 0, false); } Design::~Design() { @@ -98,9 +101,17 @@ void Design::paint(Graphics::Surface *canvas, TexturePaint *patterns, bool mask) break; */ default: - error("Unknown type => %d", type); + warning("Unknown type => %d", type); + while (true) { + ((WageEngine *)g_engine)->processEvents(); + g_system->updateScreen(); + } return; } + + g_system->copyRectToScreen(canvas->getPixels(), canvas->pitch, 0, 0, canvas->w, canvas->h); + g_system->updateScreen(); + } } @@ -133,22 +144,22 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, boo int y2 = y1; int x2 = x1; int b = in.readSByte(); - warning("YB = %x", b); + //warning("YB = %x", b); if (b == (byte)0x80) { y2 = in.readSint16BE(); numBytes -= 3; } else { - warning("Y"); + //warning("Y"); y2 += b; numBytes -= 1; } b = in.readSByte(); - warning("XB = %x", b); + //warning("XB = %x", b); if (b == (byte) 0x80) { x2 = in.readSint16BE(); numBytes -= 3; } else { - warning("X"); + //warning("X"); x2 += b; numBytes -= 1; } @@ -194,11 +205,12 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, boo Stroke oldStroke = surface->getStroke(); //if (borderThickness != 1) surface->setStroke(new BasicStroke(borderThickness - 0.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL)); - for (int i = 1; i < npoints; i++) - surface->drawLine(xpoints[i-1], ypoints[i-1], xpoints[i], ypoints[i]); - surface->setStroke(oldStroke); - } */ + for (int i = 1; i < npoints; i++) + surface->drawLine(xpoints[i-1], ypoints[i-1], xpoints[i], ypoints[i], kColorWhite); +// surface->setStroke(oldStroke); +// } + free(xpoints); free(ypoints); } diff --git a/engines/wage/design.h b/engines/wage/design.h index beb5c89427..294ffb1430 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -57,8 +57,9 @@ namespace Wage { struct TexturePaint; enum { - kColorWhite = 0xff, - kColorBlack = 0x0 + kColorBlack = 0, + kColorGray = 1, + kColorWhite = 2 }; class Design { diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index d47d284b54..ec9396f81d 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -53,9 +53,11 @@ #include "common/file.h" #include "common/fs.h" +#include "engines/engine.h" #include "engines/util.h" #include "gui/EventRecorder.h" - +#include "graphics/palette.h" + #include "wage/wage.h" #include "wage/entities.h" #include "wage/world.h" @@ -77,9 +79,17 @@ WageEngine::~WageEngine() { delete _rnd; } +static byte palette[] = { + 0, 0, 0, + 0x80, 0x80, 0x80, + 0xff, 0xff, 0xff +}; + Common::Error WageEngine::run() { initGraphics(320, 200, false); + g_system->getPaletteManager()->setPalette(palette, 0, 3); + // Create debugger console. It requires GFX to be initialized _console = new Console(this); @@ -97,4 +107,18 @@ Common::Error WageEngine::run() { return Common::kNoError; } +void WageEngine::processEvents() { + Common::Event event; + + while (_eventMan->pollEvent(event)) { + switch (event.type) { + case Common::EVENT_QUIT: + error("Exiting"); + break; + default: + break; + } + } +} + } // End of namespace Wage diff --git a/engines/wage/wage.h b/engines/wage/wage.h index 516550f932..d58be8f72a 100644 --- a/engines/wage/wage.h +++ b/engines/wage/wage.h @@ -47,7 +47,7 @@ #ifndef WAGE_H #define WAGE_H - + #include "engines/engine.h" #include "common/debug.h" #include "gui/debugger.h" @@ -59,7 +59,7 @@ struct ADGameDescription; namespace Wage { - + class Console; class World; class Scene; @@ -67,7 +67,7 @@ class Obj; class Chr; using Common::String; - + // our engine debug levels enum { kWageDebugExample = 1 << 0, @@ -83,11 +83,11 @@ class WageEngine : public Engine { public: WageEngine(OSystem *syst, const ADGameDescription *gameDesc); ~WageEngine(); - + virtual bool hasFeature(EngineFeature f) const; virtual Common::Error run(); - + bool canLoadGameStateCurrently(); bool canSaveGameStateCurrently(); @@ -115,7 +115,7 @@ public: void playSound(String soundName) {} void setMenu(String soundName) {} void appendText(String str) {} - + void processEvents(); private: Console *_console; @@ -125,14 +125,14 @@ private: Common::MacResManager *_resManager; }; - + // Example console class class Console : public GUI::Debugger { public: Console(WageEngine *vm) {} virtual ~Console(void) {} }; - + } // End of namespace Wage - + #endif |