diff options
-rw-r--r-- | graphics/VectorRenderer.h | 1 | ||||
-rw-r--r-- | graphics/VectorRendererSpec.cpp | 12 | ||||
-rw-r--r-- | graphics/VectorRendererSpec.h | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index 87706a36f5..e98f4aa761 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -493,7 +493,6 @@ protected: 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 */ }; } // End of namespace Graphics diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 430b865a4a..e1f2ffee8a 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -229,9 +229,9 @@ setGradientColors(uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2) { _gradientEnd = _format.RGBToColor(r2, g2, b2); _gradientStart = _format.RGBToColor(r1, g1, b1); - Base::_gradientBytes[0] = (_gradientEnd & _redMask) - (_gradientStart & _redMask); - Base::_gradientBytes[1] = (_gradientEnd & _greenMask) - (_gradientStart & _greenMask); - Base::_gradientBytes[2] = (_gradientEnd & _blueMask) - (_gradientStart & _blueMask); + _gradientBytes[0] = (_gradientEnd & _redMask) - (_gradientStart & _redMask); + _gradientBytes[1] = (_gradientEnd & _greenMask) - (_gradientStart & _greenMask); + _gradientBytes[2] = (_gradientEnd & _blueMask) - (_gradientStart & _blueMask); } template<typename PixelType> @@ -471,9 +471,9 @@ calcGradient(uint32 pos, uint32 max) { PixelType output = 0; pos = (MIN(pos * Base::_gradientFactor, max) << 12) / max; - output |= ((_gradientStart & _redMask) + ((Base::_gradientBytes[0] * pos) >> 12)) & _redMask; - output |= ((_gradientStart & _greenMask) + ((Base::_gradientBytes[1] * pos) >> 12)) & _greenMask; - output |= ((_gradientStart & _blueMask) + ((Base::_gradientBytes[2] * pos) >> 12)) & _blueMask; + output |= ((_gradientStart & _redMask) + ((_gradientBytes[0] * pos) >> 12)) & _redMask; + output |= ((_gradientStart & _greenMask) + ((_gradientBytes[1] * pos) >> 12)) & _greenMask; + output |= ((_gradientStart & _blueMask) + ((_gradientBytes[2] * pos) >> 12)) & _blueMask; output |= _alphaMask; return output; diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h index 3ba7d88e4e..b0a0624aee 100644 --- a/graphics/VectorRendererSpec.h +++ b/graphics/VectorRendererSpec.h @@ -208,6 +208,8 @@ protected: PixelType _gradientStart; /**< Start color for the fill gradient */ PixelType _gradientEnd; /**< End color for the fill gradient */ + int _gradientBytes[3]; /**< Color bytes of the active gradient, used to speed up calculation */ + PixelType _bevelColor; PixelType _bitmapAlphaColor; }; |