summaryrefslogtreecommitdiff
path: root/src/gfxinit.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-05-03 20:30:26 +0000
committerfrosch <frosch@openttd.org>2011-05-03 20:30:26 +0000
commitbfd09004fe040c16b679637f0c2b0f6354438d9b (patch)
tree4a213a13643837f69b74afe1e2b59a83bae2f79e /src/gfxinit.cpp
parentdbfd156eb6df4648b05661beb152735ad05fb28e (diff)
downloadopenttd-bfd09004fe040c16b679637f0c2b0f6354438d9b.tar.xz
(svn r22417) -Add: an advanced setting to specify the default palette to use for NewGRFs without action 14 palette information; this makes the default choice independent from the used base graphics and '-i' option.
Diffstat (limited to 'src/gfxinit.cpp')
-rw-r--r--src/gfxinit.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 4270a102e..404f0a94f 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -181,11 +181,14 @@ static void LoadSpriteTables()
/* We know the palette of the base set, so if the base NewGRF is not
* setting one, use the palette of the base set and not the global
- * one which might be the wrong palette for this base NewGRF. */
- PaletteType old_palette_type = _use_palette;
- _use_palette = used_set->palette;
+ * one which might be the wrong palette for this base NewGRF.
+ * The value set here might be overridden via action14 later. */
+ switch (_use_palette) {
+ case PAL_DOS: master->palette |= GRFP_GRF_DOS; break;
+ case PAL_WINDOWS: master->palette |= GRFP_GRF_WINDOWS; break;
+ default: break;
+ }
FillGRFDetails(master, false);
- _use_palette = old_palette_type;
ClrBit(master->flags, GCF_INIT_ONLY);
master->next = top;
@@ -263,8 +266,6 @@ static const char * const _graphics_file_names[] = { "base", "logos", "arctic",
template <class T, size_t Tnum_files, Subdirectory Tsubdir>
/* static */ const char * const *BaseSet<T, Tnum_files, Tsubdir>::file_names = _graphics_file_names;
-extern void UpdateNewGRFConfigPalette();
-
/**
* Determine the palette that has to be used.
* - forced palette via command line -> leave it that way
@@ -289,8 +290,6 @@ extern void UpdateNewGRFConfigPalette();
default:
NOT_REACHED();
}
-
- UpdateNewGRFConfigPalette();
}
template <class Tbase_set>