1
0
Fork 0

Codechange: Simplify logic for determining road tile colour in 'Routes' mode of small map.

pull/13971/head
SamuXarick 2025-04-06 10:02:24 +01:00
parent bc78efeec1
commit c5c0e88916
1 changed files with 9 additions and 16 deletions

View File

@ -489,23 +489,16 @@ static inline uint32_t GetSmallMapRoutesPixels(TileIndex tile, TileType t)
} }
case MP_ROAD: { case MP_ROAD: {
const RoadTypeInfo *rti = nullptr; RoadType rt_road = GetRoadTypeRoad(tile);
if (GetRoadTypeRoad(tile) != INVALID_ROADTYPE) {
rti = GetRoadTypeInfo(GetRoadTypeRoad(tile));
} else {
rti = GetRoadTypeInfo(GetRoadTypeTram(tile));
}
if (rti != nullptr) {
AndOr andor = { AndOr andor = {
MKCOLOUR_0XX0(rti->map_colour), MKCOLOUR_0XX0(GetRoadTypeInfo(rt_road != INVALID_ROADTYPE ? rt_road : GetRoadTypeTram(tile))->map_colour),
_smallmap_contours_andor[t].mand _smallmap_contours_andor[t].mand
}; };
const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour]; const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
return ApplyMask(cs->default_colour, &andor); return ApplyMask(cs->default_colour, &andor);
} }
[[fallthrough]];
}
default: default:
/* Ground colour */ /* Ground colour */