aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorEugene Sandulenko2015-12-19 13:16:27 +0100
committerEugene Sandulenko2015-12-27 15:40:55 +0100
commit08ffaf8055778f8b58bd630d30b782ba40dbb3a2 (patch)
tree9b3d32cad70a6974c03cf8a1889a3ed303512732 /engines/wage
parent0b79d5611e5f2fc222ea4d7f1d60ff7905d83fbe (diff)
downloadscummvm-rg350-08ffaf8055778f8b58bd630d30b782ba40dbb3a2.tar.gz
scummvm-rg350-08ffaf8055778f8b58bd630d30b782ba40dbb3a2.tar.bz2
scummvm-rg350-08ffaf8055778f8b58bd630d30b782ba40dbb3a2.zip
WAGE: Fixed rounded rect drawing
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/design.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp
index 2ed53d7989..cf06b02086 100644
--- a/engines/wage/design.cpp
+++ b/engines/wage/design.cpp
@@ -180,18 +180,19 @@ void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, b
}
Common::Rect inner(x1 + borderThickness, y1 + borderThickness, x2 - borderThickness, y2 - borderThickness);
- //drawFilledRoundRect(outer, arc, kColorBlack, drawPixel, &pd);
+ drawFilledRoundRect(outer, arc, kColorBlack, drawPixel, &pd);
pd.fillType = fillType;
- //drawFilledRoundRect(inner, arc, kColorBlack, drawPixel, &pd);
-
+ drawFilledRoundRect(inner, arc, kColorBlack, drawPixel, &pd);
+/*
Common::Rect inn(50, 50, 400, 400);
pd.fillType = 8;
pd.x0 = 50;
pd.y0 = 50;
drawFilledRect(inn, kColorBlack, drawPixel, &pd);
drawFilledRoundRect(inn, arc, kColorGray, drawPixel, &pd);
+*/
}
void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, bool mask,
@@ -357,31 +358,20 @@ void Design::drawFilledRect(Common::Rect &rect, int color, void (*plotProc)(int,
// http://members.chello.at/easyfilter/bresenham.html
void Design::drawFilledRoundRect(Common::Rect &rect, int arc, int color, void (*plotProc)(int, int, int, void *), void *data) {
- //drawFilledRect(rect, color, plotProc, data);
- //return;
int x = -arc, y = 0, err = 2-2*arc; /* II. Quadrant */
- int dx = rect.width() - arc * 2;
int dy = rect.height() - arc * 2;
int r = arc;
do {
- //drawHLine(rect.left, rect.right, y, color, plotProc, data);
-
- //drawPixelPlain(rect.left-x, rect.top-y, color, data); /* I. Quadrant */
- //drawPixelPlain(rect.left+x, rect.top-y, color, data); /* II. Quadrant */
- drawHLine(rect.left+x+r, rect.right-x-r, rect.top-y+r, color, drawPixelPlain, data);
- drawHLine(rect.left+x+r, rect.right-x-r, rect.top+y+dy+r, color, drawPixelPlain, data);
- //drawPixelPlain(rect.left-y, rect.top-x, color, data); /* II. Quadrant */
- //drawPixelPlain(rect.left+x, rect.top-y, color, data); /* III. Quadrant */
- //drawPixelPlain(rect.left+y, rect.top+x, color, data); /* IV. Quadrant */
+ drawHLine(rect.left+x+r, rect.right-x-r, rect.top-y+r, color, plotProc, data);
+ drawHLine(rect.left+x+r, rect.right-x-r, rect.top+y+dy+r, color, plotProc, data);
arc = err;
if (arc <= y) err += ++y*2+1; /* e_xy+e_y < 0 */
if (arc > x || err > y) err += ++x*2+1; /* e_xy+e_x > 0 or no 2nd y-step */
} while (x < 0);
-
for (int i = 0; i < dy; i++)
- drawHLine(rect.left, rect.right, rect.top + r + i, color, drawPixelPlain, data);
+ drawHLine(rect.left, rect.right, rect.top + r + i, color, plotProc, data);
}
// Based on public-domain code by Darel Rex Finley, 2007