aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/VectorRenderer.cpp2
-rw-r--r--graphics/VectorRenderer.h8
-rw-r--r--graphics/VectorRendererSpec.cpp7
-rw-r--r--graphics/VectorRendererSpec.h4
-rw-r--r--gui/ThemeEngine.cpp4
-rw-r--r--gui/ThemeEngine.h2
-rw-r--r--gui/newgui.cpp4
7 files changed, 28 insertions, 3 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 4f9bd48334..8c7f9662cf 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -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 @@ const VectorRenderer::ConvolutionDataSet VectorRenderer::_convolutionData[Vector
{ {{-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 377933e890..b5fa4cb6cf 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -114,6 +114,7 @@ public:
kTriangleRight
};
+#ifndef DISABLE_FANCY_THEMES
enum ConvolutionData {
kConvolutionSoftBlur,
kConvolutionHardBlur,
@@ -129,6 +130,7 @@ public:
int divisor;
int offset;
};
+#endif
/**
* Draws a line by considering the special cases for optimization.
@@ -501,6 +503,7 @@ 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
@@ -526,6 +529,7 @@ public:
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 @@ 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];
-
- static const int _dimPercentValue = 256 * 50 / 100; /**< default value for screen dimming (50%) */
+#endif
};
} // end of namespace Graphics
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index e9a8e15566..4aa5d320e0 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -159,14 +159,17 @@ VectorRenderer *createRenderer(int mode) {
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 @@ areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv,
}
}
}
+#endif
template <typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
@@ -1409,7 +1413,7 @@ drawRoundedSquareFakeBevel(int x1, int y1, int r, int w, int h, int amount) {
-
+#ifndef DISABLE_FANCY_THEMES
/********************************************************************
* ANTIALIASED PRIMITIVES drawing algorithms - VectorRendererAA
@@ -1587,5 +1591,6 @@ drawCircleAlg(int x1, int y1, int r, PixelType color, VectorRenderer::FillMode f
}
}
+#endif
}
diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h
index ce78c8a557..c0d3b3e00f 100644
--- a/graphics/VectorRendererSpec.h
+++ b/graphics/VectorRendererSpec.h
@@ -225,7 +225,9 @@ 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 */
@@ -238,6 +240,7 @@ protected:
};
+#ifndef DISABLE_FANCY_THEMES
/**
* VectorRendererAA: Anti-Aliased Vector Renderer Class
*
@@ -291,6 +294,7 @@ protected:
// Common::Rect(x, y, x + w + blur * 2, y + h + blur * 2));
}
};
+#endif
}
#endif
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 2df6b5ec47..9cecefc6cd 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -48,7 +48,9 @@ using namespace Graphics;
const char *ThemeEngine::rendererModeLabels[] = {
"Disabled GFX",
"Standard Renderer (16bpp)",
+#ifndef DISABLE_FANCY_THEMES
"Antialiased Renderer (16bpp)"
+#endif
};
@@ -320,7 +322,9 @@ void ThemeEngine::screenInit(bool backBuffer) {
void ThemeEngine::setGraphicsMode(GraphicsMode mode) {
switch (mode) {
case kGfxStandard16bit:
+#ifndef DISABLE_FANCY_THEMES
case kGfxAntialias16bit:
+#endif
_bytesPerPixel = sizeof(uint16);
screenInit<uint16>(kEnableBackCaching);
break;
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 67b07b71f6..f5173c015b 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -238,7 +238,9 @@ public:
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
};
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 4aaf65bcab..6f3b2e28fd 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -93,7 +93,11 @@ NewGui::NewGui() : _redrawStatus(kRedrawDisabled),
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);