aboutsummaryrefslogtreecommitdiff
path: root/engines/wage/design.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2015-12-16 21:13:48 +0100
committerEugene Sandulenko2015-12-27 15:39:52 +0100
commit327a9ec74ae7ce0e9ae100449b31df5320700d75 (patch)
tree56bedba508cf41d96f62d78ce281e752c667b986 /engines/wage/design.cpp
parent080d3827f98f47e9e712ce6790fbc567ae249e64 (diff)
downloadscummvm-rg350-327a9ec74ae7ce0e9ae100449b31df5320700d75.tar.gz
scummvm-rg350-327a9ec74ae7ce0e9ae100449b31df5320700d75.tar.bz2
scummvm-rg350-327a9ec74ae7ce0e9ae100449b31df5320700d75.zip
WAGE: Implemented stub for drawRect
Diffstat (limited to 'engines/wage/design.cpp')
-rw-r--r--engines/wage/design.cpp25
1 files changed, 22 insertions, 3 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);
// }