diff options
author | Vicent Marti | 2008-06-18 00:15:21 +0000 |
---|---|---|
committer | Vicent Marti | 2008-06-18 00:15:21 +0000 |
commit | 42036e7fd332a25cb902a220aa020e82cb0794ef (patch) | |
tree | ec3300ec270aed74b7a510fee5b390aec7e4c695 /graphics | |
parent | 6932c836cfb5f02565feb4700f42633ed5c84d68 (diff) | |
download | scummvm-rg350-42036e7fd332a25cb902a220aa020e82cb0794ef.tar.gz scummvm-rg350-42036e7fd332a25cb902a220aa020e82cb0794ef.tar.bz2 scummvm-rg350-42036e7fd332a25cb902a220aa020e82cb0794ef.zip |
Expanded parser.
Added regex support for Common::String
Changed drawstep state saving.
svn-id: r32729
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/VectorRenderer.cpp | 29 | ||||
-rw-r--r-- | graphics/VectorRenderer.h | 19 |
2 files changed, 11 insertions, 37 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index 0194231427..1f8ec3c397 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -53,35 +53,20 @@ VectorRenderer *createRenderer(int mode) { ********************************************************************/ void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step) { - if (step.flags & DrawStep::kStepCallbackOnly) { - (this->*(step.drawingCall))(area, step); - return; - } - - if (step.flags & DrawStep::kStepSetBG) + if (step.bgColor.set) setBgColor(step.bgColor.r, step.bgColor.g, step.bgColor.b); - if (step.flags & DrawStep::kStepSetFG) + if (step.fgColor.set) setFgColor(step.fgColor.r, step.fgColor.g, step.fgColor.b); - if (step.flags & DrawStep::kStepSetGradient) + 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); - if (step.flags & DrawStep::kStepSetShadow) - shadowEnable(step.shadow); - - if (step.flags & DrawStep::kStepSetGradientFactor) - setGradientFactor(step.factor); - - if (step.flags & DrawStep::kStepSetStroke) - setStrokeWidth(step.stroke); - - if (step.flags & DrawStep::kStepSetFillMode) - setFillMode((FillMode)step.fillMode); - - if (step.flags & DrawStep::kStepSettingsOnly) - return; + shadowEnable(step.shadow); + setGradientFactor(step.factor); + setStrokeWidth(step.stroke); + setFillMode((FillMode)step.fillMode); (this->*(step.drawingCall))(area, step); } diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index b4c4bb656d..d989781d5c 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -40,10 +40,9 @@ class VectorRenderer; struct DrawStep; struct DrawStep { - uint32 flags; /** Step flags, see DrawStepFlags */ - struct { - uint8 r, g, b; + uint8 r, g, b; + bool set; } fgColor, /** Foreground color */ bgColor, /** backgroudn color */ @@ -68,18 +67,6 @@ struct DrawStep { uint32 scale; /** scale of all the coordinates in FIXED POINT with 16 bits mantissa */ void (VectorRenderer::*drawingCall)(const Common::Rect &, const DrawStep &); /** Pointer to drawing function */ - - enum DrawStepFlags { - kStepCallbackOnly = (1 << 0), - kStepSettingsOnly = (1 << 1), - kStepSetBG = (1 << 2), - kStepSetFG = (1 << 3), - kStepSetGradient = (1 << 4), - kStepSetShadow = (1 << 5), - kStepSetGradientFactor = (1 << 6), - kStepSetStroke = (1 << 7), - kStepSetFillMode = (1 << 8) - }; }; VectorRenderer *createRenderer(int mode); @@ -403,6 +390,8 @@ public: drawBeveledSquare(x, y, w, h, step.extraData); } + void drawCallback_VOID(const Common::Rect &area, const DrawStep &step) {} + /** * Draws the specified draw step on the screen. * |