aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRenderer.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2019-08-27 08:07:14 +0200
committerBastien Bouclet2019-10-07 21:47:42 +0200
commit1d764bd787a20ab4b8d6edd79d3bc7db459e3eb0 (patch)
treeb6e201244aabf6c87b40905cc1097c0955c73991 /graphics/VectorRenderer.cpp
parentb87ebdce2101a9943f727168526fe89725ebe759 (diff)
downloadscummvm-rg350-1d764bd787a20ab4b8d6edd79d3bc7db459e3eb0.tar.gz
scummvm-rg350-1d764bd787a20ab4b8d6edd79d3bc7db459e3eb0.tar.bz2
scummvm-rg350-1d764bd787a20ab4b8d6edd79d3bc7db459e3eb0.zip
GRAPHICS: Vector renderer clipping rect related cleanups
Selecting whether a clipping variant of a draw call needs to be used is no longer the responsibility to the caller. The clipping rect is now part of the state of the renderer. Also fix some of the draw calls to better apply the clipping rect.
Diffstat (limited to 'graphics/VectorRenderer.cpp')
-rw-r--r--graphics/VectorRenderer.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index e92a09f8c9..e226e45475 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -32,34 +32,7 @@ namespace Graphics {
/********************************************************************
* DRAWSTEP handling functions
********************************************************************/
-void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step, uint32 extra) {
-
- if (step.bgColor.set)
- setBgColor(step.bgColor.r, step.bgColor.g, step.bgColor.b);
-
- if (step.fgColor.set)
- setFgColor(step.fgColor.r, step.fgColor.g, step.fgColor.b);
-
- if (step.bevelColor.set)
- setBevelColor(step.bevelColor.r, step.bevelColor.g, step.bevelColor.b);
-
- if (step.gradColor1.set && step.gradColor2.set)
- setGradientColors(step.gradColor1.r, step.gradColor1.g, step.gradColor1.b,
- step.gradColor2.r, step.gradColor2.g, step.gradColor2.b);
-
- setShadowOffset(_disableShadows ? 0 : step.shadow);
- setBevel(step.bevel);
- setGradientFactor(step.factor);
- setStrokeWidth(step.stroke);
- setFillMode((FillMode)step.fillMode);
-
- _dynamicData = extra;
-
- Common::Rect noClip = Common::Rect(0, 0, 0, 0);
- (this->*(step.drawingCall))(area, step, noClip);
-}
-
-void VectorRenderer::drawStepClip(const Common::Rect &area, const Common::Rect &clip, const DrawStep &step, uint32 extra) {
+void VectorRenderer::drawStep(const Common::Rect &area, const Common::Rect &clip, const DrawStep &step, uint32 extra) {
if (step.bgColor.set)
setBgColor(step.bgColor.r, step.bgColor.g, step.bgColor.b);
@@ -79,10 +52,11 @@ void VectorRenderer::drawStepClip(const Common::Rect &area, const Common::Rect &
setGradientFactor(step.factor);
setStrokeWidth(step.stroke);
setFillMode((FillMode)step.fillMode);
+ setClippingRect(clip);
_dynamicData = extra;
- (this->*(step.drawingCall))(area, step, clip);
+ (this->*(step.drawingCall))(area, step);
}
int VectorRenderer::stepGetRadius(const DrawStep &step, const Common::Rect &area) {