summaryrefslogtreecommitdiff
path: root/src/gfxinit.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-04-27 12:15:14 +0000
committerfrosch <frosch@openttd.org>2014-04-27 12:15:14 +0000
commit631e8b45fd7bbd95766ee294304fad38dda946dc (patch)
tree67a68a8e68f7c7f05dd17d86071391e4fb778a37 /src/gfxinit.cpp
parent77889ab8e80653cb09cfc25b1d918b3562f1eab9 (diff)
downloadopenttd-631e8b45fd7bbd95766ee294304fad38dda946dc.tar.xz
(svn r26522) -Add: A config-file-only setting to disable usage of 8bpp video modes.
-Remove: [win32] fullscreen_bpp setting, which is replaced by above setting. -Change: Disable usage of 8bpp blitters and video modes by default. Many modern OS and hardware cause issues with those.
Diffstat (limited to 'src/gfxinit.cpp')
-rw-r--r--src/gfxinit.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 30ff37998..ac116bf4a 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -238,16 +238,21 @@ static bool SwitchNewGRFBlitter()
/* Null driver => dedicated server => do nothing. */
if (BlitterFactory::GetCurrentBlitter()->GetScreenDepth() == 0) return false;
- /* Get preferred depth. */
+ /* Get preferred depth.
+ * - depth_wanted_by_base: Depth required by the baseset, i.e. the majority of the sprites.
+ * - depth_wanted_by_grf: Depth required by some NewGRF.
+ * Both can force using a 32bpp blitter. depth_wanted_by_base is used to select
+ * between multiple 32bpp blitters, which perform differently with 8bpp sprites.
+ */
uint depth_wanted_by_base = BaseGraphics::GetUsedSet()->blitter == BLT_32BPP ? 32 : 8;
- uint depth_wanted_by_grf = 8;
+ uint depth_wanted_by_grf = _support8bpp == S8BPP_NONE ? 32 : 8;
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) depth_wanted_by_grf = 32;
}
/* Search the best blitter. */
- struct {
+ static const struct {
const char *name;
uint animation; ///< 0: no support, 1: do support, 2: both
uint min_base_depth, max_base_depth, min_grf_depth, max_grf_depth;