aboutsummaryrefslogtreecommitdiff
path: root/engines/wage/design.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2015-12-16 20:59:33 +0100
committerEugene Sandulenko2015-12-27 15:39:52 +0100
commit080d3827f98f47e9e712ce6790fbc567ae249e64 (patch)
treee0fc389a81fdae8cd88009d6388ce22219e5f1ff /engines/wage/design.cpp
parentd3917bf9314f22adfb72b0ce9cb6b9634467c662 (diff)
downloadscummvm-rg350-080d3827f98f47e9e712ce6790fbc567ae249e64.tar.gz
scummvm-rg350-080d3827f98f47e9e712ce6790fbc567ae249e64.tar.bz2
scummvm-rg350-080d3827f98f47e9e712ce6790fbc567ae249e64.zip
WAGE: Implemented debug drawing
Diffstat (limited to 'engines/wage/design.cpp')
-rw-r--r--engines/wage/design.cpp32
1 files changed, 22 insertions, 10 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);
}