mirror of https://github.com/OpenTTD/OpenTTD
(svn r14245) -Fix: NewGRF configs loaded from the config file would always default to the DOS palette instead of the "default" palette.
parent
2f350316b6
commit
72b72bb368
|
@ -195,6 +195,8 @@ static bool DetermineGraphicsPack()
|
||||||
return _used_graphics_set != NULL;
|
return _used_graphics_set != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern void UpdateNewGRFConfigPalette();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the palette that has to be used.
|
* Determine the palette that has to be used.
|
||||||
* - forced palette via command line -> leave it that way
|
* - forced palette via command line -> leave it that way
|
||||||
|
@ -219,6 +221,8 @@ static void DeterminePalette()
|
||||||
default:
|
default:
|
||||||
NOT_REACHED();
|
NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateNewGRFConfigPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,6 +26,20 @@ GRFConfig *_grfconfig_newgame;
|
||||||
GRFConfig *_grfconfig_static;
|
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 */
|
/* Calculate the MD5 Sum for a GRF */
|
||||||
static bool CalcGRFMD5Sum(GRFConfig *config)
|
static bool CalcGRFMD5Sum(GRFConfig *config)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue