summaryrefslogtreecommitdiff
path: root/src/gfxinit.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-10-04 21:35:52 +0000
committermichi_cc <michi_cc@openttd.org>2011-10-04 21:35:52 +0000
commit71bd681d87065d093aa11195d3949cf7b7be4a07 (patch)
tree026cc10806c15b00c2948378b9538594db039224 /src/gfxinit.cpp
parentc575b5bbd7c8a225ff5a2b1120c58edfc96f078d (diff)
downloadopenttd-71bd681d87065d093aa11195d3949cf7b7be4a07.tar.xz
(svn r23001) -Feature: [NewGRF] Automatically switch to a 32 bpp blitter on NewGRF indication.
Diffstat (limited to 'src/gfxinit.cpp')
-rw-r--r--src/gfxinit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index b941a53dd..9edaadc39 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -214,6 +214,13 @@ static void SwitchNewGRFBlitter()
/* Get blitter of base set. */
bool is_32bpp = BaseGraphics::GetUsedSet()->blitter == BLT_32BPP;
+ /* Get combined blitter mode of all NewGRFs. */
+ for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
+ if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND || HasBit(c->flags, GCF_INIT_ONLY)) continue;
+
+ if (c->palette & GRFP_BLT_32BPP) is_32bpp = true;
+ }
+
/* A GRF would like a 32 bpp blitter, switch blitter if needed. Never switch if the blitter was specified by the user. */
if (_blitter_autodetected && is_32bpp && BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() != 0 && BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() < 16) {
const char *cur_blitter = BlitterFactoryBase::GetCurrentBlitter()->GetName();