Merge remote-tracking branch 'upstream/master' into 13.0

This commit is contained in:
Pavel Stupnikov
2022-11-26 22:16:25 +04:00
508 changed files with 14617 additions and 9750 deletions

View File

@@ -225,7 +225,7 @@ void BuildLinkStatsLegend()
for (; i < _smallmap_cargo_count + lengthof(_linkstat_colours_in_legenda); ++i) {
_legend_linkstats[i].legend = STR_EMPTY;
_legend_linkstats[i].colour = LinkGraphOverlay::LINK_COLOURS[_linkstat_colours_in_legenda[i - _smallmap_cargo_count]];
_legend_linkstats[i].colour = LinkGraphOverlay::LINK_COLOURS[_settings_client.gui.linkgraph_colours][_linkstat_colours_in_legenda[i - _smallmap_cargo_count]];
_legend_linkstats[i].show_on_map = true;
}
@@ -573,15 +573,18 @@ static inline uint32 GetSmallMapVegetationPixels(TileIndex tile, TileType t)
/**
* Return the colour a tile would be displayed with in the small map in mode "Owner".
*
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @note If include_heightmap is IH_NEVER, the return value can safely be used as a palette colour (by masking it to a uint8)
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #SmallMapWindow::GetTileColours).
* @param include_heightmap Whether to return the heightmap/contour colour of this tile (instead of the default land tile colour)
* @return The colour of tile in the small map in mode "Owner"
*/
static inline uint32 GetSmallMapOwnerPixels(TileIndex tile, TileType t)
uint32 GetSmallMapOwnerPixels(TileIndex tile, TileType t, IncludeHeightmap include_heightmap)
{
Owner o;
switch (t) {
case MP_VOID: return MKCOLOUR_XXXX(PC_BLACK);
case MP_INDUSTRY: return MKCOLOUR_XXXX(PC_DARK_GREY);
case MP_HOUSE: return MKCOLOUR_XXXX(PC_DARK_RED);
default: o = GetTileOwner(tile); break;
@@ -594,7 +597,8 @@ static inline uint32 GetSmallMapOwnerPixels(TileIndex tile, TileType t)
if ((o < MAX_COMPANIES && !_legend_land_owners[_company_to_list_pos[o]].show_on_map) || o == OWNER_NONE || o == OWNER_WATER) {
if (t == MP_WATER) return MKCOLOUR_XXXX(PC_WATER);
const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
return _smallmap_show_heightmap ? cs->height_colours[TileHeight(tile)] : cs->default_colour;
return ((include_heightmap == IncludeHeightmap::IfEnabled && _smallmap_show_heightmap) || include_heightmap == IncludeHeightmap::Always)
? cs->height_colours[TileHeight(tile)] : cs->default_colour;
} else if (o == OWNER_TOWN) {
return MKCOLOUR_XXXX(PC_DARK_RED);
}
@@ -856,7 +860,7 @@ inline uint32 SmallMapWindow::GetTileColours(const TileArea &ta) const
return GetSmallMapVegetationPixels(tile, et);
case SMT_OWNER:
return GetSmallMapOwnerPixels(tile, et);
return GetSmallMapOwnerPixels(tile, et, IncludeHeightmap::IfEnabled);
case CM_SMT_IMBA:
return CM_GetSmallMapIMBAPixels(tile, et);