summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-04 19:43:20 +0000
committerrubidium <rubidium@openttd.org>2008-09-04 19:43:20 +0000
commitd877247d40d974053c74a960c49f8c0cfc212f6b (patch)
tree0634a70eeab8c24fdfa04cfb376fb20c55a017fe /src/newgrf_config.cpp
parent113fbb8cb3b2aee0e1c3e1f6ec8fbbd900013732 (diff)
downloadopenttd-d877247d40d974053c74a960c49f8c0cfc212f6b.tar.xz
(svn r14245) -Fix: NewGRF configs loaded from the config file would always default to the DOS palette instead of the "default" palette.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index b1dd4f0a7..235e543f8 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -26,6 +26,20 @@ GRFConfig *_grfconfig_newgame;
GRFConfig *_grfconfig_static;
+/**
+ * Update the palettes of the graphics from the config file.
+ * This is needed because the config file gets read and parsed
+ * before the palette is chosen (one can configure the base
+ * graphics set governing the palette in the config after all).
+ * As a result of this we update the settings from the config
+ * once we have determined the palette.
+ */
+void UpdateNewGRFConfigPalette()
+{
+ for (GRFConfig *c = _grfconfig_newgame; c != NULL; c = c->next) c->windows_paletted = (_use_palette == PAL_WINDOWS);
+ for (GRFConfig *c = _grfconfig_static; c != NULL; c = c->next) c->windows_paletted = (_use_palette == PAL_WINDOWS);
+}
+
/* Calculate the MD5 Sum for a GRF */
static bool CalcGRFMD5Sum(GRFConfig *config)
{