[Scummvm-cvs-logs] SF.net SVN: scummvm:[34864] scummvm/trunk
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Wed Oct 29 20:48:15 CET 2008
Revision: 34864
http://scummvm.svn.sourceforge.net/scummvm/?rev=34864&view=rev
Author: lordhoto
Date: 2008-10-29 19:48:15 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
Committed my patch from -devel, which reintroduces DISABLE_FANCY_THEMES to strip functionallity in theme renderer uneeded by small devices.
Modified Paths:
--------------
scummvm/trunk/graphics/VectorRenderer.cpp
scummvm/trunk/graphics/VectorRenderer.h
scummvm/trunk/graphics/VectorRendererSpec.cpp
scummvm/trunk/graphics/VectorRendererSpec.h
scummvm/trunk/gui/ThemeEngine.cpp
scummvm/trunk/gui/ThemeEngine.h
scummvm/trunk/gui/newgui.cpp
Modified: scummvm/trunk/graphics/VectorRenderer.cpp
===================================================================
--- scummvm/trunk/graphics/VectorRenderer.cpp 2008-10-29 19:02:45 UTC (rev 34863)
+++ scummvm/trunk/graphics/VectorRenderer.cpp 2008-10-29 19:48:15 UTC (rev 34864)
@@ -37,6 +37,7 @@
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
@@ -45,6 +46,7 @@
{ {{-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 2008-10-29 19:02:45 UTC (rev 34863)
+++ scummvm/trunk/graphics/VectorRenderer.h 2008-10-29 19:48:15 UTC (rev 34864)
@@ -114,6 +114,7 @@
kTriangleRight
};
+#ifndef DISABLE_FANCY_THEMES
enum ConvolutionData {
kConvolutionSoftBlur,
kConvolutionHardBlur,
@@ -129,6 +130,7 @@
int divisor;
int offset;
};
+#endif
/**
* Draws a line by considering the special cases for optimization.
@@ -501,6 +503,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
@@ -526,6 +529,7 @@
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.
@@ -547,9 +551,9 @@
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];
-
- static const int _dimPercentValue = 256 * 50 / 100; /**< default value for screen dimming (50%) */
+#endif
};
} // end of namespace Graphics
Modified: scummvm/trunk/graphics/VectorRendererSpec.cpp
===================================================================
--- scummvm/trunk/graphics/VectorRendererSpec.cpp 2008-10-29 19:02:45 UTC (rev 34863)
+++ scummvm/trunk/graphics/VectorRendererSpec.cpp 2008-10-29 19:48:15 UTC (rev 34864)
@@ -159,14 +159,17 @@
case GUI::ThemeEngine::kGfxStandard16bit:
return new VectorRendererSpec<uint16, ColorMasks<565> >;
+#ifndef DISABLE_FANCY_THEMES
case GUI::ThemeEngine::kGfxAntialias16bit:
return new VectorRendererAA<uint16, ColorMasks<565> >;
+#endif
default:
return 0;
}
}
+#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) {
@@ -201,6 +204,7 @@
}
}
}
+#endif
template <typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
@@ -1409,8 +1413,8 @@
+#ifndef DISABLE_FANCY_THEMES
-
/********************************************************************
* ANTIALIASED PRIMITIVES drawing algorithms - VectorRendererAA
********************************************************************/
@@ -1587,5 +1591,6 @@
}
}
+#endif
}
Modified: scummvm/trunk/graphics/VectorRendererSpec.h
===================================================================
--- scummvm/trunk/graphics/VectorRendererSpec.h 2008-10-29 19:02:45 UTC (rev 34863)
+++ scummvm/trunk/graphics/VectorRendererSpec.h 2008-10-29 19:48:15 UTC (rev 34864)
@@ -225,7 +225,9 @@
*/
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 */
@@ -238,6 +240,7 @@
};
+#ifndef DISABLE_FANCY_THEMES
/**
* VectorRendererAA: Anti-Aliased Vector Renderer Class
*
@@ -291,6 +294,7 @@
// Common::Rect(x, y, x + w + blur * 2, y + h + blur * 2));
}
};
+#endif
}
#endif
Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp 2008-10-29 19:02:45 UTC (rev 34863)
+++ scummvm/trunk/gui/ThemeEngine.cpp 2008-10-29 19:48:15 UTC (rev 34864)
@@ -48,7 +48,9 @@
const char *ThemeEngine::rendererModeLabels[] = {
"Disabled GFX",
"Standard Renderer (16bpp)",
+#ifndef DISABLE_FANCY_THEMES
"Antialiased Renderer (16bpp)"
+#endif
};
@@ -320,7 +322,9 @@
void ThemeEngine::setGraphicsMode(GraphicsMode mode) {
switch (mode) {
case kGfxStandard16bit:
+#ifndef DISABLE_FANCY_THEMES
case kGfxAntialias16bit:
+#endif
_bytesPerPixel = sizeof(uint16);
screenInit<uint16>(kEnableBackCaching);
break;
Modified: scummvm/trunk/gui/ThemeEngine.h
===================================================================
--- scummvm/trunk/gui/ThemeEngine.h 2008-10-29 19:02:45 UTC (rev 34863)
+++ scummvm/trunk/gui/ThemeEngine.h 2008-10-29 19:48:15 UTC (rev 34864)
@@ -238,7 +238,9 @@
enum GraphicsMode {
kGfxDisabled = 0, /** No GFX */
kGfxStandard16bit, /** 2BPP with the standard (aliased) renderer. */
+#ifndef DISABLE_FANCY_THEMES
kGfxAntialias16bit, /** 2BPP with the optimized AA renderer. */
+#endif
kGfxMAX
};
Modified: scummvm/trunk/gui/newgui.cpp
===================================================================
--- scummvm/trunk/gui/newgui.cpp 2008-10-29 19:02:45 UTC (rev 34863)
+++ scummvm/trunk/gui/newgui.cpp 2008-10-29 19:48:15 UTC (rev 34864)
@@ -93,7 +93,11 @@
if (themefile.compareToIgnoreCase("default") == 0)
themefile = "builtin";
+#ifndef DISABLE_FANCY_THEMES
ConfMan.registerDefault("gui_renderer", 2);
+#else
+ ConfMan.registerDefault("gui_renderer", 1);
+#endif
ThemeEngine::GraphicsMode gfxMode = (ThemeEngine::GraphicsMode)ConfMan.getInt("gui_renderer");
loadNewTheme(themefile, gfxMode);
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