diff options
author | Bastien Bouclet | 2019-08-27 08:07:14 +0200 |
---|---|---|
committer | Bastien Bouclet | 2019-10-07 21:47:42 +0200 |
commit | 1d764bd787a20ab4b8d6edd79d3bc7db459e3eb0 (patch) | |
tree | b6e201244aabf6c87b40905cc1097c0955c73991 /graphics/VectorRenderer.cpp | |
parent | b87ebdce2101a9943f727168526fe89725ebe759 (diff) | |
download | scummvm-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.cpp | 32 |
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) { |