aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wage/design.cpp25
-rw-r--r--engines/wage/design.h4
2 files changed, 25 insertions, 4 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp
index 399c2adcef..42e1c0ac8e 100644
--- a/engines/wage/design.cpp
+++ b/engines/wage/design.cpp
@@ -58,7 +58,9 @@ Design::Design(Common::SeekableReadStream *data) {
Graphics::Surface screen;
screen.create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
- paint(&screen, 0, false);
+ Common::Rect r(0, 0, 320, 200);
+ setBounds(&r);
+ paint(&screen, 0, true);
}
Design::~Design() {
@@ -80,10 +82,10 @@ void Design::paint(Graphics::Surface *canvas, TexturePaint *patterns, bool mask)
byte borderFillType = in.readByte();
int type = in.readByte();
switch (type) {
-/*
case 4:
drawRect(canvas, in, mask, patterns, fillType, borderThickness, borderFillType);
break;
+ /*
case 8:
drawRoundRect(canvas, in, mask, patterns, fillType, borderThickness, borderFillType);
break;
@@ -115,6 +117,23 @@ void Design::paint(Graphics::Surface *canvas, TexturePaint *patterns, bool mask)
}
}
+void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool mask,
+ TexturePaint *patterns, byte fillType, byte borderThickness, byte borderFillType) {
+ int16 y = in.readSint16BE();
+ int16 x = in.readSint16BE();
+ int16 height = in.readSint16BE();
+ int16 width = in.readSint16BE();
+ Common::Rect outer(x, y, width, height);
+
+ if (mask) {
+ surface->fillRect(outer, kColorBlack);
+ return;
+ }
+ //Shape inner = new Rectangle(x+borderThickness, y+borderThickness, width-2*borderThickness, height-2*borderThickness);
+ //paintShape(g2d, patterns, outer, inner, borderFillType, fillType);
+ surface->frameRect(outer, kColorBlack);
+}
+
void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, bool mask,
TexturePaint *patterns, byte fillType, byte borderThickness, byte borderFillType) {
//surface->setColor(Color.BLACK);
@@ -207,7 +226,7 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, boo
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], kColorWhite);
+ surface->drawLine(xpoints[i-1], ypoints[i-1], xpoints[i], ypoints[i], kColorBlack);
// surface->setStroke(oldStroke);
// }
diff --git a/engines/wage/design.h b/engines/wage/design.h
index 294ffb1430..1c08cd9977 100644
--- a/engines/wage/design.h
+++ b/engines/wage/design.h
@@ -83,7 +83,9 @@ private:
Common::Rect *_bounds;
private:
- void drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, bool mask,
+ void drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool mask,
+ TexturePaint *patterns, byte fillType, byte borderThickness, byte borderFillType);
+ void drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, bool mask,
TexturePaint *patterns, byte fillType, byte borderThickness, byte borderFillType);
};