diff options
author | rubidium <rubidium@openttd.org> | 2010-07-31 09:44:38 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-07-31 09:44:38 +0000 |
commit | 4a4f02dc81083b9de6665018ffb06d87b3bfd35e (patch) | |
tree | 5e5614bfdda7371550c1f53f908b327113b51b91 /src/newgrf_config.cpp | |
parent | e469a94a2df943c5595e91b2752782cfa4b2ff3f (diff) | |
download | openttd-4a4f02dc81083b9de6665018ffb06d87b3bfd35e.tar.xz |
(svn r20254) -Add: allow NewGRFs to specify their palette
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r-- | src/newgrf_config.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index c7a4f01b0..6bdf5117d 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -92,7 +92,12 @@ const char *GRFConfig::GetDescription() const */ void GRFConfig::SetSuitablePalette() { - PaletteType pal = _use_palette; + PaletteType pal; + switch (this->palette & GRFP_GRF_MASK) { + case GRFP_GRF_DOS: pal = PAL_DOS; break; + case GRFP_GRF_WINDOWS: pal = PAL_WINDOWS; break; + default: pal = _use_palette; break; + } SB(this->palette, GRFP_USE_BIT, 1, pal == PAL_WINDOWS ? GRFP_USE_WINDOWS : GRFP_USE_DOS); } |