(svn r20254) -Add: allow NewGRFs to specify their palette

This commit is contained in:
rubidium
2010-07-31 09:44:38 +00:00
parent d9393035ea
commit f03106db1c
3 changed files with 36 additions and 1 deletions

View File

@@ -92,7 +92,12 @@ const char *GRFConfig::GetDescription() const
*/
void GRFConfig::SetSuitablePalette()
{
PaletteType pal = _use_palette;
PaletteType pal;
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;
}
SB(this->palette, GRFP_USE_BIT, 1, pal == PAL_WINDOWS ? GRFP_USE_WINDOWS : GRFP_USE_DOS);
}