From 0034aa3b9c7a1f0123df9e809a6a5d0d58bd9bd1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 22 Jan 2009 04:59:09 +0000 Subject: Got rid of several occurrences of gBitFormat svn-id: r35995 --- graphics/VectorRendererSpec.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'graphics/VectorRendererSpec.cpp') diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 46c0ec6a67..055a51a4a1 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -151,8 +151,6 @@ inline uint32 fp_sqroot(uint32 x) { } -extern int gBitFormat; - namespace Graphics { VectorRenderer *createRenderer(int mode) { @@ -172,21 +170,27 @@ VectorRenderer *createRenderer(int mode) { return 0; \ } + // 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) { + PixelFormat format = g_system->getOverlayFormat(); + if (format == createPixelFormat<1555>()) { CREATE_RENDERER_16(1555) - } else if (gBitFormat == 4444) { + } + if (format == createPixelFormat<4444>()) { CREATE_RENDERER_16(4444) - } else if (gBitFormat == 555) { + } + if (format == createPixelFormat<555>()) { CREATE_RENDERER_16(555) - } else if (gBitFormat == 565) { + } + if (format == createPixelFormat<565>()) { CREATE_RENDERER_16(565) - } else { - return 0; } + + return 0; + #undef CREATE_RENDERER_16 #endif } -- cgit v1.2.3