[Scummvm-cvs-logs] SF.net SVN: scummvm:[36148] scummvm/trunk/graphics
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Jan 30 16:43:45 CET 2009
Revision: 36148
http://scummvm.svn.sourceforge.net/scummvm/?rev=36148&view=rev
Author: fingolfin
Date: 2009-01-30 15:43:45 +0000 (Fri, 30 Jan 2009)
Log Message:
-----------
Removed unused area convolution code from VectorRenderer
Modified Paths:
--------------
scummvm/trunk/graphics/VectorRenderer.cpp
scummvm/trunk/graphics/VectorRenderer.h
scummvm/trunk/graphics/VectorRendererSpec.cpp
scummvm/trunk/graphics/VectorRendererSpec.h
Modified: scummvm/trunk/graphics/VectorRenderer.cpp
===================================================================
--- scummvm/trunk/graphics/VectorRenderer.cpp 2009-01-30 15:41:23 UTC (rev 36147)
+++ scummvm/trunk/graphics/VectorRenderer.cpp 2009-01-30 15:43:45 UTC (rev 36148)
@@ -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
********************************************************************/
Modified: scummvm/trunk/graphics/VectorRenderer.h
===================================================================
--- scummvm/trunk/graphics/VectorRenderer.h 2009-01-30 15:41:23 UTC (rev 36147)
+++ scummvm/trunk/graphics/VectorRenderer.h 2009-01-30 15:43:45 UTC (rev 36148)
@@ -128,24 +128,6 @@
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,35 +499,7 @@
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 @@
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
Modified: scummvm/trunk/graphics/VectorRendererSpec.cpp
===================================================================
--- scummvm/trunk/graphics/VectorRendererSpec.cpp 2009-01-30 15:41:23 UTC (rev 36147)
+++ scummvm/trunk/graphics/VectorRendererSpec.cpp 2009-01-30 15:43:45 UTC (rev 36148)
@@ -194,45 +194,8 @@
#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) {
_gradientEnd = RGBToColor<PixelFormat>(r2, g2, b2);
_gradientStart = RGBToColor<PixelFormat>(r1, g1, b1);
Modified: scummvm/trunk/graphics/VectorRendererSpec.h
===================================================================
--- scummvm/trunk/graphics/VectorRendererSpec.h 2009-01-30 15:41:23 UTC (rev 36147)
+++ scummvm/trunk/graphics/VectorRendererSpec.h 2009-01-30 15:43:45 UTC (rev 36148)
@@ -225,10 +225,6 @@
*/
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 */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list