Merge branch 'jgrpp' into jgrpp-nrt

This commit is contained in:
Jonathan G Rennison
2019-07-29 22:50:51 +01:00
10 changed files with 26 additions and 11 deletions

View File

@@ -1110,6 +1110,7 @@ enum TileHighlightType {
THT_WHITE,
THT_BLUE,
THT_RED,
THT_LIGHT_BLUE,
};
const Station *_viewport_highlight_station; ///< Currently selected station for coverage area highlight
@@ -1123,7 +1124,7 @@ const Town *_viewport_highlight_town; ///< Currently selected town for cov
static TileHighlightType GetTileHighlightType(TileIndex t)
{
if (_viewport_highlight_station != nullptr) {
if (IsTileType(t, MP_STATION) && GetStationIndex(t) == _viewport_highlight_station->index) return THT_WHITE;
if (IsTileType(t, MP_STATION) && GetStationIndex(t) == _viewport_highlight_station->index) return THT_LIGHT_BLUE;
if (_viewport_highlight_station->TileIsInCatchment(t)) return THT_BLUE;
}
@@ -1161,6 +1162,7 @@ static void DrawTileHighlightType(const TileInfo *ti, TileHighlightType tht)
case THT_WHITE: DrawTileSelectionRect(ti, PAL_NONE); break;
case THT_BLUE: DrawTileSelectionRect(ti, PALETTE_SEL_TILE_BLUE); break;
case THT_RED: DrawTileSelectionRect(ti, PALETTE_TILE_RED_PULSATING); break;
case THT_LIGHT_BLUE: DrawTileSelectionRect(ti, SPR_ZONING_INNER_HIGHLIGHT_LIGHT_BLUE); break;
}
}