diff options
author | michi_cc <michi_cc@openttd.org> | 2011-10-04 21:35:52 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-10-04 21:35:52 +0000 |
commit | 71bd681d87065d093aa11195d3949cf7b7be4a07 (patch) | |
tree | 026cc10806c15b00c2948378b9538594db039224 /src/gfxinit.cpp | |
parent | c575b5bbd7c8a225ff5a2b1120c58edfc96f078d (diff) | |
download | openttd-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.cpp | 7 |
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(); |