diff options
author | frosch <frosch@openttd.org> | 2011-05-03 20:30:26 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-05-03 20:30:26 +0000 |
commit | bfd09004fe040c16b679637f0c2b0f6354438d9b (patch) | |
tree | 4a213a13643837f69b74afe1e2b59a83bae2f79e /src/newgrf_config.cpp | |
parent | dbfd156eb6df4648b05661beb152735ad05fb28e (diff) | |
download | openttd-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/newgrf_config.cpp')
-rw-r--r-- | src/newgrf_config.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 990cdde75..1cde3ab24 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -141,7 +141,7 @@ void GRFConfig::SetSuitablePalette() 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; + default: pal = _settings_client.gui.newgrf_default_palette == 1 ? PAL_WINDOWS : PAL_DOS; break; } SB(this->palette, GRFP_USE_BIT, 1, pal == PAL_WINDOWS ? GRFP_USE_WINDOWS : GRFP_USE_DOS); } @@ -265,16 +265,16 @@ void GRFParameterInfo::SetValue(struct GRFConfig *config, uint32 value) /** * 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. + * Called when changing the default palette in advanced settings. + * @param p1 Unused. + * @return Always true. */ -void UpdateNewGRFConfigPalette() +bool UpdateNewGRFConfigPalette(int32 p1) { for (GRFConfig *c = _grfconfig_newgame; c != NULL; c = c->next) c->SetSuitablePalette(); for (GRFConfig *c = _grfconfig_static; c != NULL; c = c->next) c->SetSuitablePalette(); + for (GRFConfig *c = _all_grfs; c != NULL; c = c->next) c->SetSuitablePalette(); + return true; } /** |