diff options
author | Eugene Sandulenko | 2015-12-20 00:29:26 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-27 15:40:57 +0100 |
commit | a616e9fb093bc3c0aeea8f5dbaf088f201c414c3 (patch) | |
tree | 8fb6b0c339f407624cc8027acb9152e8dd0faf45 /engines/wage | |
parent | 6c214c2c4a9d1f0047009fd5eddbcd78aaa3542f (diff) | |
download | scummvm-rg350-a616e9fb093bc3c0aeea8f5dbaf088f201c414c3.tar.gz scummvm-rg350-a616e9fb093bc3c0aeea8f5dbaf088f201c414c3.tar.bz2 scummvm-rg350-a616e9fb093bc3c0aeea8f5dbaf088f201c414c3.zip |
WAGE: More support for transparent primitives
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/design.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 9bd2fe6c4d..0c0d20506a 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -154,11 +154,18 @@ void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool m } Common::Rect inner(x1 + borderThickness, y1 + borderThickness, x2 - borderThickness, y2 - borderThickness); - drawFilledRect(outer, kColorBlack, drawPixel, &pd); + if (fillType <= patterns.size()) { + drawFilledRect(outer, kColorBlack, drawPixel, &pd); - pd.fillType = fillType; + pd.fillType = fillType; - drawFilledRect(inner, kColorBlack, drawPixel, &pd); + drawFilledRect(inner, kColorBlack, drawPixel, &pd); + } else { + drawThickLine(x1, y1, x2, y1, borderThickness, kColorBlack, drawPixel, &pd); + drawThickLine(x2, y1, x2, y2, borderThickness, kColorBlack, drawPixel, &pd); + drawThickLine(x2, y2, x1, y2, borderThickness, kColorBlack, drawPixel, &pd); + drawThickLine(x1, y2, x1, y1, borderThickness, kColorBlack, drawPixel, &pd); + } } void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, bool mask, @@ -182,6 +189,10 @@ void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, b pd.fillType = fillType; + if (fillType > patterns.size()) { + warning("Transparent roundrect"); + } + drawFilledRoundRect(inner, arc/2, kColorBlack, drawPixel, &pd); } @@ -248,10 +259,12 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, boo return; } - drawPolygonScan(xpoints, ypoints, npoints, bbox, kColorBlack, drawPixel, &pd); + if (fillType <= patterns.size()) { + drawPolygonScan(xpoints, ypoints, npoints, bbox, kColorBlack, drawPixel, &pd); + } pd.fillType = borderFillType; - if (borderThickness > 0) { + if (borderThickness > 0 && borderFillType <= patterns.size()) { for (int i = 1; i < npoints; i++) drawThickLine(xpoints[i-1], ypoints[i-1], xpoints[i], ypoints[i], borderThickness, kColorBlack, drawPixel, &pd); } @@ -274,12 +287,12 @@ void Design::drawOval(Graphics::Surface *surface, Common::ReadStream &in, bool m return; } - if (borderThickness > 0) { + if (borderThickness > 0 && borderFillType <= patterns.size()) { if (borderThickness == 1) { drawEllipse(x1, y1, x2-1, y2-1, false, drawPixel, &pd); } else { drawEllipse(x1, y1, x2-1, y2-1, true, drawPixel, &pd); - warning("Ellips thickness >1: borderThickness"); + warning("Ellipse thickness >1: borderThickness"); } } |