aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRendererSpec.h
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-22 14:29:02 +0600
committerEugene Sandulenko2016-07-03 12:16:26 +0200
commit8f2d35b0b89c4b8912df96ec3c403e00c85c5875 (patch)
tree52aebe7c6afdfbe28c57f231fd6c083e60329962 /graphics/VectorRendererSpec.h
parent3d2730a0ddd1e1e33e6639775727beb954d7bfc0 (diff)
downloadscummvm-rg350-8f2d35b0b89c4b8912df96ec3c403e00c85c5875.tar.gz
scummvm-rg350-8f2d35b0b89c4b8912df96ec3c403e00c85c5875.tar.bz2
scummvm-rg350-8f2d35b0b89c4b8912df96ec3c403e00c85c5875.zip
GUI: drawRoundedSquareClip()
Diffstat (limited to 'graphics/VectorRendererSpec.h')
-rw-r--r--graphics/VectorRendererSpec.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h
index 13377d80e8..8a101b8e5a 100644
--- a/graphics/VectorRendererSpec.h
+++ b/graphics/VectorRendererSpec.h
@@ -81,6 +81,8 @@ public:
protected:
+ Common::Rect _clippingArea;
+
/**
* Draws a single pixel on the surface with the given coordinates and
* the given color.
@@ -159,12 +161,21 @@ protected:
virtual void drawRoundedSquareAlg(int x1, int y1, int r, int w, int h,
PixelType color, FillMode fill_m);
+ virtual void drawRoundedSquareAlgClip(int x1, int y1, int r, int w, int h,
+ PixelType color, FillMode fill_m);
+
virtual void drawBorderRoundedSquareAlg(int x1, int y1, int r, int w, int h,
PixelType color, FillMode fill_m, uint8 alpha_t, uint8 alpha_r, uint8 alpha_b, uint8 alpha_l);
+ virtual void drawBorderRoundedSquareAlgClip(int x1, int y1, int r, int w, int h,
+ PixelType color, FillMode fill_m, uint8 alpha_t, uint8 alpha_r, uint8 alpha_b, uint8 alpha_l);
+
virtual void drawInteriorRoundedSquareAlg(int x1, int y1, int r, int w, int h,
PixelType color, FillMode fill_m);
+ virtual void drawInteriorRoundedSquareAlgClip(int x1, int y1, int r, int w, int h,
+ PixelType color, FillMode fill_m);
+
virtual void drawSquareAlg(int x, int y, int w, int h,
PixelType color, FillMode fill_m);
@@ -213,6 +224,7 @@ protected:
void precalcGradient(int h);
void gradientFill(PixelType *first, int width, int x, int y);
+ void gradientFillClip(PixelType *first, int width, int x, int y, int realX, int realY);
/**
* Fills several pixels in a row with a given color and the specified alpha blending.
@@ -228,6 +240,28 @@ protected:
while (first != last) blendPixelPtr(first++, color, alpha);
}
+ inline void blendFillClip(PixelType *first, PixelType *last, PixelType color, uint8 alpha, int realX, int realY) {
+ if (_clippingArea.top <= realY && realY < _clippingArea.bottom) {
+ while (first != last) {
+ if (_clippingArea.left <= realX && realX < _clippingArea.right)
+ blendPixelPtr(first++, color, alpha);
+ else
+ ++first;
+ ++realX;
+ }
+ }
+ }
+
+ inline void blendFillClip(int x, PixelType *first, PixelType *last, PixelType color, uint8 alpha) {
+ while (first != last) {
+ if (x >= _clippingArea.left && x <= _clippingArea.right)
+ blendPixelPtr(first++, color, alpha);
+ else
+ ++first;
+ ++x;
+ }
+ }
+
void darkenFill(PixelType *first, PixelType *last);
const PixelFormat _format;