Merge svn r27779

Conflicts:
	src/autoreplace_gui.cpp
	src/economy.cpp
	src/fios_gui.cpp
	src/lang/spanish_MX.txt
	src/network/network_gui.cpp
	src/rev.cpp.in
	src/road_gui.cpp
	src/toolbar_gui.cpp
	src/window.cpp
This commit is contained in:
Sergii Pylypenko
2017-03-17 23:14:41 +02:00
287 changed files with 6065 additions and 4082 deletions

View File

@@ -416,26 +416,10 @@ static const byte _tiletype_importance[] = {
};
static inline TileType GetEffectiveTileType(TileIndex tile)
{
TileType t = GetTileType(tile);
if (t == MP_TUNNELBRIDGE) {
TransportType tt = GetTunnelBridgeTransportType(tile);
switch (tt) {
case TRANSPORT_RAIL: t = MP_RAILWAY; break;
case TRANSPORT_ROAD: t = MP_ROAD; break;
default: t = MP_WATER; break;
}
}
return t;
}
/**
* Return the colour a tile would be displayed with in the small map in mode "Contour".
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #GetEffectiveTileType).
* @param t Effective tile type of the tile (see #GetTileColours).
* @return The colour of tile in the small map in mode "Contour"
*/
static inline uint32 GetSmallMapContoursPixels(TileIndex tile, TileType t)
@@ -448,7 +432,7 @@ static inline uint32 GetSmallMapContoursPixels(TileIndex tile, TileType t)
* Return the colour a tile would be displayed with in the small map in mode "Vehicles".
*
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #GetEffectiveTileType).
* @param t Effective tile type of the tile (see #GetTileColours).
* @return The colour of tile in the small map in mode "Vehicles"
*/
static inline uint32 GetSmallMapVehiclesPixels(TileIndex tile, TileType t)
@@ -461,23 +445,11 @@ static inline uint32 GetSmallMapVehiclesPixels(TileIndex tile, TileType t)
* Return the colour a tile would be displayed with in the small map in mode "Industries".
*
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #GetEffectiveTileType).
* @param t Effective tile type of the tile (see #GetTileColours).
* @return The colour of tile in the small map in mode "Industries"
*/
static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile, TileType t)
{
if (t == MP_INDUSTRY) {
/* If industry is allowed to be seen, use its colour on the map */
IndustryType type = Industry::GetByTile(tile)->type;
if (_legend_from_industries[_industry_to_list_pos[type]].show_on_map &&
(_smallmap_industry_highlight_state || type != _smallmap_industry_highlight)) {
return (type == _smallmap_industry_highlight ? PC_WHITE : GetIndustrySpec(Industry::GetByTile(tile)->type)->map_colour) * 0x01010101;
} else {
/* Otherwise, return the colour which will make it disappear */
t = (IsTileOnWater(tile) ? MP_WATER : MP_CLEAR);
}
}
const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
return ApplyMask(_smallmap_show_heightmap ? cs->height_colours[TileHeight(tile)] : cs->default_colour, &_smallmap_vehicles_andor[t]);
}
@@ -486,7 +458,7 @@ static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile, TileType t)
* Return the colour a tile would be displayed with in the small map in mode "Routes".
*
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #GetEffectiveTileType).
* @param t Effective tile type of the tile (see #GetTileColours).
* @return The colour of tile in the small map in mode "Routes"
*/
static inline uint32 GetSmallMapRoutesPixels(TileIndex tile, TileType t)
@@ -519,7 +491,7 @@ static inline uint32 GetSmallMapRoutesPixels(TileIndex tile, TileType t)
* Return the colour a tile would be displayed with in the small map in mode "link stats".
*
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #GetEffectiveTileType).
* @param t Effective tile type of the tile (see #GetTileColours).
* @return The colour of tile in the small map in mode "link stats"
*/
static inline uint32 GetSmallMapLinkStatsPixels(TileIndex tile, TileType t)
@@ -542,7 +514,7 @@ static const uint32 _vegetation_clear_bits[] = {
* Return the colour a tile would be displayed with in the smallmap in mode "Vegetation".
*
* @param tile The tile of which we would like to get the colour.
* @param t Effective tile type of the tile (see #GetEffectiveTileType).
* @param t Effective tile type of the tile (see #GetTileColours).
* @return The colour of tile in the smallmap in mode "Vegetation"
*/
static inline uint32 GetSmallMapVegetationPixels(TileIndex tile, TileType t)
@@ -569,7 +541,7 @@ 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 #GetEffectiveTileType).
* @param t Effective tile type of the tile (see #GetTileColours).
* @return The colour of tile in the small map in mode "Owner"
*/
static inline uint32 GetSmallMapOwnerPixels(TileIndex tile, TileType t)
@@ -757,7 +729,42 @@ inline uint32 SmallMapWindow::GetTileColours(const TileArea &ta) const
TileType et = MP_VOID; // Effective tile type at that position.
TILE_AREA_LOOP(ti, ta) {
TileType ttype = GetEffectiveTileType(ti);
TileType ttype = GetTileType(ti);
switch (ttype) {
case MP_TUNNELBRIDGE: {
TransportType tt = GetTunnelBridgeTransportType(ti);
switch (tt) {
case TRANSPORT_RAIL: ttype = MP_RAILWAY; break;
case TRANSPORT_ROAD: ttype = MP_ROAD; break;
default: ttype = MP_WATER; break;
}
break;
}
case MP_INDUSTRY:
/* Special handling of industries while in "Industries" smallmap view. */
if (this->map_type == SMT_INDUSTRY) {
/* If industry is allowed to be seen, use its colour on the map.
* This has the highest priority above any value in _tiletype_importance. */
IndustryType type = Industry::GetByTile(ti)->type;
if (_legend_from_industries[_industry_to_list_pos[type]].show_on_map) {
if (type == _smallmap_industry_highlight) {
if (_smallmap_industry_highlight_state) return MKCOLOUR_XXXX(PC_WHITE);
} else {
return GetIndustrySpec(type)->map_colour * 0x01010101;
}
}
/* Otherwise make it disappear */
ttype = IsTileOnWater(ti) ? MP_WATER : MP_CLEAR;
}
break;
default:
break;
}
if (_tiletype_importance[ttype] > importance) {
importance = _tiletype_importance[ttype];
tile = ti;