diff options
author | Max Horn | 2009-01-30 15:43:45 +0000 |
---|---|---|
committer | Max Horn | 2009-01-30 15:43:45 +0000 |
commit | f465abb75d81a248e3c553aa5706031b52c7189d (patch) | |
tree | 5d4f56d4ecd57d3bb5246387998b93293583223a /graphics | |
parent | e21f5febdc66ae796a57bdd70fbea2eaf26e1f56 (diff) | |
download | scummvm-rg350-f465abb75d81a248e3c553aa5706031b52c7189d.tar.gz scummvm-rg350-f465abb75d81a248e3c553aa5706031b52c7189d.tar.bz2 scummvm-rg350-f465abb75d81a248e3c553aa5706031b52c7189d.zip |
Removed unused area convolution code from VectorRenderer
svn-id: r36148
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/VectorRenderer.cpp | 11 | ||||
-rw-r--r-- | graphics/VectorRenderer.h | 50 | ||||
-rw-r--r-- | graphics/VectorRendererSpec.cpp | 37 | ||||
-rw-r--r-- | graphics/VectorRendererSpec.h | 4 |
4 files changed, 0 insertions, 102 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp index e67f81a363..2616664841 100644 --- a/graphics/VectorRenderer.cpp +++ b/graphics/VectorRenderer.cpp @@ -37,17 +37,6 @@ namespace Graphics { -#ifndef DISABLE_FANCY_THEMES -const VectorRenderer::ConvolutionDataSet VectorRenderer::_convolutionData[VectorRenderer::kConvolutionMAX] = { - { {{1, 1, 1}, {1, 8, 1}, {1, 1, 1}}, 16, 0 }, // soft blur matrix - { {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}}, 18, 0 }, // hard blur matrix - { {{1, 2, 1}, {2, 4, 2}, {1, 2, 1}}, 16, 0 }, // gaussian blur matrix - { {{2, 0, 0}, {0, -1, 0}, {0, 0, -1}}, 1, 127}, // emboss matrix - { {{-1, -1, -1}, {-1, 9, -1}, {-1, -1, -1}}, 1, 0}, // sharpen matrix - { {{1, 1, 1}, {1, -7, 1}, {1, 1, 1}}, 1, 0} // edge find matrix -}; -#endif - /******************************************************************** * DRAWSTEP handling functions ********************************************************************/ diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h index ca61720d06..9d5453aa57 100644 --- a/graphics/VectorRenderer.h +++ b/graphics/VectorRenderer.h @@ -128,24 +128,6 @@ public: kTriangleRight }; -#ifndef DISABLE_FANCY_THEMES - enum ConvolutionData { - kConvolutionSoftBlur, - kConvolutionHardBlur, - kConvolutionGaussianBlur, - kConvolutionEmboss, - kConvolutionSharpen, - kConvolutionEdgeDetect, - kConvolutionMAX - }; - - struct ConvolutionDataSet { - int matrix[3][3]; - int divisor; - int offset; - }; -#endif - /** * Draws a line by considering the special cases for optimization. * @@ -517,34 +499,6 @@ public: virtual void disableShadows() { _disableShadows = true; } virtual void enableShadows() { _disableShadows = false; } -#ifndef DISABLE_FANCY_THEMES - /** - * Applies a convolution matrix on the given surface area. - * Call applyConvolutionMatrix() instead if you want to use - * the embedded matrixes (blur/sharpen masks, bevels, etc). - * - * @param area Area in which the convolution matrix will be applied. - * @param filter Convolution matrix (3X3) - * @param filterDiv Divisor for the convolution matrix. - * Make sure this equals the total sum of the elements - * of the matrix or brightness data will be distorted. - * @param offset Offset on the convolution area. - */ - virtual void areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv, int offset) = 0; - - /** - * Applies one of the predefined convolution effects on the given area. - * - * WARNING: Because of performance issues, this is currently disabled on all renderers. - * - * @param id Id of the convolution data set (see VectorRenderer::ConvolutionData) - * @param area Area in which the convolution effect will be applied. - */ - virtual void applyConvolutionMatrix(const ConvolutionData id, const Common::Rect &area) { - areaConvolution(area, _convolutionData[id].matrix, _convolutionData[id].divisor, _convolutionData[id].offset); - } -#endif - /** * Applies a whole-screen shading effect, used before opening a new dialog. * Currently supports screen dimmings and luminance (b&w). @@ -564,10 +518,6 @@ protected: int _gradientFactor; /**< Multiplication factor of the active gradient */ int _gradientBytes[3]; /**< Color bytes of the active gradient, used to speed up calculation */ - -#ifndef DISABLE_FANCY_THEMES - static const ConvolutionDataSet _convolutionData[kConvolutionMAX]; -#endif }; } // end of namespace Graphics diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 7ae9bb69ff..e8d9eec301 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -194,43 +194,6 @@ VectorRenderer *createRenderer(int mode) { #endif } -#ifndef DISABLE_FANCY_THEMES -template <typename PixelType, typename PixelFormat> -void VectorRendererSpec<PixelType, PixelFormat>:: -areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv, int offset) { - PixelType *ptr = 0; - int newR, newG, newB; - uint8 r, g, b; - int yVal; - - for (int y = area.top; y < area.bottom; ++y) { - for (int x = area.left; x < area.right; ++x) { - newR = newG = newB = 0; - - for (int j = 0; j < 3; ++j) { - yVal = MIN(MAX(y - 1 + j, 0), area.bottom - 1); - - for (int i = 0; i < 3; ++i) { - ptr = (PixelType *)Base::_activeSurface->getBasePtr(MIN(MAX(x - 1 + j, 0), area.right - 1), yVal); - colorToRGB<PixelFormat>((uint32)*ptr, r, g, b); - - newR += r * filter[j][i]; - newG += g * filter[j][i]; - newB += b * filter[j][i]; - } - } - - newR = (newR / filterDiv) + offset; - newG = (newG / filterDiv) + offset; - newB = (newB / filterDiv) + offset; - - ptr = (PixelType *)Base::_activeSurface->getBasePtr(x, y); - *ptr = RGBToColor<PixelFormat>(CLIP(newR, 0, 255), CLIP(newG, 0, 255), CLIP(newB, 0, 255)); - } - } -} -#endif - template <typename PixelType, typename PixelFormat> void VectorRendererSpec<PixelType, PixelFormat>:: setGradientColors(uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2) { diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h index f1bcd1854e..90adb77759 100644 --- a/graphics/VectorRendererSpec.h +++ b/graphics/VectorRendererSpec.h @@ -225,10 +225,6 @@ protected: */ inline void colorFill(PixelType *first, PixelType *last, PixelType color); -#ifndef DISABLE_FANCY_THEMES - void areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv, int offset); -#endif - PixelType _fgColor; /**< Foreground color currently being used to draw on the renderer */ PixelType _bgColor; /**< Background color currently being used to draw on the renderer */ |