aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/VectorRenderer.h4
-rw-r--r--graphics/VectorRendererSpec.cpp9
-rw-r--r--graphics/VectorRendererSpec.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index af275c59fd..9346ce63d2 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -176,7 +176,7 @@ public:
* @param r Radius of the corners.
*/
virtual void drawRoundedSquare(int x, int y, int r, int w, int h) = 0;
- virtual void drawRoundedSquareClip(int x, int y, int r, int w, int h, int cx, int cy, int cw, int ch) = 0;
+ virtual void drawRoundedSquareClip(int x, int y, int r, int w, int h, Common::Rect clipping) = 0;
/**
* Draws a triangle starting at (x,y) with the given base and height.
@@ -386,7 +386,7 @@ public:
void drawCallback_ROUNDSQ(const Common::Rect &area, const DrawStep &step, const Common::Rect &clip) { //TODO
uint16 x, y, w, h;
stepGetPositions(step, area, x, y, w, h);
- drawRoundedSquareClip(x, y, stepGetRadius(step, area), w, h, clip.left, clip.top, clip.right-clip.left, clip.bottom-clip.top);
+ drawRoundedSquareClip(x, y, stepGetRadius(step, area), w, h, clip);
}
void drawCallback_FILLSURFACE(const Common::Rect &area, const DrawStep &step, const Common::Rect &clip) { //TODO
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 672ca3416b..9260728478 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -1355,7 +1355,7 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
template<typename PixelType>
void VectorRendererSpec<PixelType>::
-drawRoundedSquareClip(int x, int y, int r, int w, int h, int cx, int cy, int cw, int ch) {
+drawRoundedSquareClip(int x, int y, int r, int w, int h, Common::Rect clipping) {
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
w <= 0 || h <= 0 || x < 0 || y < 0 || r <= 0)
return;
@@ -1367,20 +1367,21 @@ drawRoundedSquareClip(int x, int y, int r, int w, int h, int cx, int cy, int cw,
return;
Common::Rect backup = _clippingArea;
- _clippingArea = Common::Rect(cx, cy, cx + cw, cy + ch);
+ _clippingArea = clipping;
+ bool useOriginal = (_clippingArea.isEmpty() || _clippingArea.contains(Common::Rect(x, y, x + w, y + h)));
if (Base::_fillMode != kFillDisabled && Base::_shadowOffset
&& x + w + Base::_shadowOffset + 1 < Base::_activeSurface->w
&& y + h + Base::_shadowOffset + 1 < Base::_activeSurface->h
&& h > (Base::_shadowOffset + 1) * 2) {
- if (_clippingArea.isEmpty() || _clippingArea.contains(Common::Rect(x, y, x + w, y + h))) {
+ if (useOriginal) {
drawRoundedSquareShadow(x, y, r, w, h, Base::_shadowOffset);
} else {
drawRoundedSquareShadowClip(x, y, r, w, h, Base::_shadowOffset);
}
}
- if (_clippingArea.isEmpty() || _clippingArea.contains(Common::Rect(x, y, x + w, y + h))) {
+ if (useOriginal) {
drawRoundedSquareAlg(x, y, r, w, h, _fgColor, Base::_fillMode);
} else {
drawRoundedSquareAlgClip(x, y, r, w, h, _fgColor, Base::_fillMode);
diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h
index 7b2c2730df..f084816660 100644
--- a/graphics/VectorRendererSpec.h
+++ b/graphics/VectorRendererSpec.h
@@ -57,7 +57,7 @@ public:
void drawSquare(int x, int y, int w, int h);
void drawSquareClip(int x, int y, int w, int h, Common::Rect clipping);
void drawRoundedSquare(int x, int y, int r, int w, int h);
- void drawRoundedSquareClip(int x, int y, int r, int w, int h, int cx, int cy, int cw, int ch);
+ void drawRoundedSquareClip(int x, int y, int r, int w, int h, Common::Rect clipping);
void drawTriangle(int x, int y, int base, int height, TriangleOrientation orient);
void drawTriangleClip(int x, int y, int base, int height, TriangleOrientation orient, Common::Rect clipping);
void drawTab(int x, int y, int r, int w, int h);