1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 17:39:09 +00:00

(svn r23001) -Feature: [NewGRF] Automatically switch to a 32 bpp blitter on NewGRF indication.

This commit is contained in:
michi_cc
2011-10-04 21:35:52 +00:00
parent c575b5bbd7
commit 71bd681d87
3 changed files with 36 additions and 0 deletions

View File

@@ -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();