aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2008-10-29 20:02:56 +0000
committerJohannes Schickel2008-10-29 20:02:56 +0000
commitebcb4861917ee43bebbaf11513afabef64d13221 (patch)
tree5f08f9546656ed84996e09facfe0f1bd707eeb04 /graphics
parent98b0c4b33cd2a994be2f0756ac5ab1421b223269 (diff)
downloadscummvm-rg350-ebcb4861917ee43bebbaf11513afabef64d13221.tar.gz
scummvm-rg350-ebcb4861917ee43bebbaf11513afabef64d13221.tar.bz2
scummvm-rg350-ebcb4861917ee43bebbaf11513afabef64d13221.zip
Enable gui renderer for all bit depths we support currently.
svn-id: r34865
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.h14
-rw-r--r--graphics/VectorRendererSpec.cpp40
2 files changed, 45 insertions, 9 deletions
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index b5fa4cb6cf..17303c3c9d 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -34,6 +34,12 @@
#include "gui/ThemeEngine.h"
+// To assure we have VECTOR_RENDERER_FORMAT specified when
+// DISABLE_FANCY_THEMES is defined, we error out elsewise
+#if defined(DISABLE_FANCY_THEMES) && !defined(VECTOR_RENDERER_FORMAT)
+#error "You need to specify a fixed overlay format via VECTOR_RENDERER_FORMAT"
+#endif
+
namespace Graphics {
class VectorRenderer;
@@ -84,6 +90,14 @@ VectorRenderer *createRenderer(int mode);
* the actual rendering functionality for each Byte Depth / Byte Format
* combination, and may also contain platform specific code.
*
+ * When specifing define DISABLE_FANCY_THEMES some eye candy related code
+ * gets stripped of. This is especially useful for small devices like NDS.
+ * Also note that if you specify DISABLE_FANCY_THEMES, you'll need to
+ * specify a forced overlay bit format via VECTOR_RENDERER_FORMAT define.
+ * The value looks like 'XYZ' for RXGYBZ mode, so R5G5B5 would be specified
+ * via:
+ * #define VECTOR_RENDERER_FORMAT 565
+ *
* TODO: Expand documentation.
*
* @see VectorRendererSpec
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 4aa5d320e0..5f299814e4 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -151,22 +151,44 @@ inline uint32 fp_sqroot(uint32 x) {
}
+extern int gBitFormat;
namespace Graphics {
VectorRenderer *createRenderer(int mode) {
- switch (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
+#ifdef DISABLE_FANCY_THEMES
+ assert(mode == GUI::ThemeEngine::kGfxStandard16bit);
+ return new VectorRendererSpec<uint16, ColorMasks<VECTOR_RENDERER_FORMAT> >;
+#else
+#define CREATE_RENDERER_16(bitFormat) \
+ switch (mode) { \
+ case GUI::ThemeEngine::kGfxStandard16bit: \
+ return new VectorRendererSpec<uint16, ColorMasks<bitFormat> >; \
+ \
+ case GUI::ThemeEngine::kGfxAntialias16bit: \
+ return new VectorRendererAA<uint16, ColorMasks<bitFormat> >; \
+ \
+ default: \
+ return 0; \
+ }
- default:
+ // FIXME/TODO: This looks like a real gross hack.
+ // It might be fine to assume that '1555' only happens for PSP
+ // so it could maybe be handled via DISABLE_FANCY_THEMES,
+ // same goes for 4444, which is only used by DC port.
+ if (gBitFormat == 1555) {
+ CREATE_RENDERER_16(1555)
+ } else if (gBitFormat == 4444) {
+ CREATE_RENDERER_16(4444)
+ } else if (gBitFormat == 555) {
+ CREATE_RENDERER_16(555)
+ } else if (gBitFormat == 565) {
+ CREATE_RENDERER_16(565)
+ } else {
return 0;
}
+#undef CREATE_RENDERER_16
+#endif
}
#ifndef DISABLE_FANCY_THEMES