forked from mirror/OpenTTD
(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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user