aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.cpp36
-rw-r--r--graphics/VectorRenderer.h7
2 files changed, 30 insertions, 13 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index aa0fad36c8..a8915eb0a6 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -53,7 +53,7 @@ VectorRenderer *createRenderer(int mode) {
/********************************************************************
* DRAWSTEP handling functions
********************************************************************/
-void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step) {
+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);
@@ -69,8 +69,10 @@ void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step) {
setGradientFactor(step.factor);
setStrokeWidth(step.stroke);
setFillMode((FillMode)step.fillMode);
+
+ _dynamicData = extra;
- (this->*(step.drawingCall))(area, step);
+ (this->*(step.drawingCall))(area, step);
}
void VectorRenderer::textStep(const Common::String &text, const Common::Rect &area, const TextStep &step) {
@@ -405,7 +407,7 @@ drawTab(int x, int y, int r, int w, int h) {
case kFillBackground:
drawTabAlg(x, y, w, h, r, (Base::_fillMode == kFillBackground) ? _bgColor : _fgColor, Base::_fillMode);
if (Base::_strokeWidth)
- drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled);
+ drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
break;
case kFillForeground:
@@ -472,7 +474,7 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
/** TAB ALGORITHM - NON AA */
template<typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
-drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m) {
+drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft, int baseRight) {
int f, ddF_x, ddF_y;
int x, y, px, py;
int pitch = Base::surfacePitch();
@@ -507,10 +509,6 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
*(ptr_tl - (y) - (px)) = color;
if (Base::_strokeWidth > 1) {
- *(ptr_tr + (y) - (px)) = color;
- *(ptr_tr + (x - 1) - (py)) = color;
- *(ptr_tl - (x - 1) - (py)) = color;
- *(ptr_tl - (y) - (px)) = color;
*(ptr_tr + (y) - (px - pitch)) = color;
*(ptr_tr + (x) - (py)) = color;
*(ptr_tl - (x) - (py)) = color;
@@ -521,10 +519,28 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
ptr_fill += pitch * real_radius;
while (short_h--) {
- colorFill(ptr_fill, ptr_fill + Base::_strokeWidth, color);
- colorFill(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color);
+ colorFill(ptr_fill, ptr_fill + Base::_strokeWidth - 1, color);
+ colorFill(ptr_fill + w - Base::_strokeWidth + 2, ptr_fill + w, color);
ptr_fill += pitch;
}
+
+ if (baseLeft) {
+ sw = 0;
+ ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1 + h);
+ while (sw++ < Base::_strokeWidth) {
+ colorFill(ptr_fill - baseLeft, ptr_fill, color);
+ ptr_fill += pitch;
+ }
+ }
+
+ if (baseRight) {
+ sw = 0;
+ ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w, y1 + h);
+ while (sw++ < Base::_strokeWidth) {
+ colorFill(ptr_fill, ptr_fill + baseRight, color);
+ ptr_fill += pitch;
+ }
+ }
} else {
__BE_RESET();
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 60cc20ac5a..e5fedd8ef5 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -78,7 +78,7 @@ struct DrawStep {
uint8 shadow, stroke, factor, radius; /** Misc options... */
uint8 fillMode; /** active fill mode */
- uint8 extraData; /** Generic parameter for extra options (orientation/bevel) */
+ uint32 extraData; /** Generic parameter for extra options (orientation/bevel) */
uint32 scale; /** scale of all the coordinates in FIXED POINT with 16 bits mantissa */
@@ -489,7 +489,7 @@ public:
* @param area Zone to paint on
* @param step Pointer to a DrawStep struct.
*/
- virtual void drawStep(const Common::Rect &area, const DrawStep &step);
+ virtual void drawStep(const Common::Rect &area, const DrawStep &step, uint32 extra = 0);
virtual void textStep(const Common::String &text, const Common::Rect &area, const TextStep &step);
/**
@@ -519,6 +519,7 @@ protected:
int _shadowOffset; /** offset for drawn shadows */
int _strokeWidth; /** Width of the stroke of all drawn shapes */
+ uint32 _dynamicData; /** Dynamic data from the GUI Theme that modifies the drawing of the current shape */
int _gradientFactor; /** Multiplication factor of the active gradient */
int _gradientBytes[3]; /** Color bytes of the active gradient, used to speed up calculation */
@@ -763,7 +764,7 @@ protected:
virtual void drawTriangleVertAlg(int x, int y, int w, int h, bool inverted, PixelType color, FillMode fill_m);
virtual void drawTriangleFast(int x, int y, int size, bool inverted, PixelType color, FillMode fill_m);
virtual void drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color);
- virtual void drawTabAlg(int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m);
+ virtual void drawTabAlg(int x, int y, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft = 0, int baseRight = 0);
/**
* SHADOW DRAWING ALGORITHMS