Zoning: Add mode to show restricted signals.

This commit is contained in:
Jonathan G Rennison
2015-10-15 00:23:46 +01:00
parent a1b60bcc85
commit 34ce418b63
4 changed files with 22 additions and 0 deletions

View File

@@ -23,6 +23,7 @@
#include "station_func.h"
#include "station_map.h"
#include "town.h"
#include "tracerestrict.h"
#include "zoning.h"
Zoning _zoning;
@@ -286,6 +287,22 @@ SpriteID TileZoneCheckUnservedIndustriesEvaluation(TileIndex tile, Owner owner)
return ZONING_INVALID_SPRITE_ID;
}
/**
* Detect whether a tile is a restricted signal tile
*
* @param TileIndex tile
* @param Owner owner
* @return red if a restricted signal, nothing otherwise
*/
SpriteID TileZoneCheckTraceRestrictEvaluation(TileIndex tile, Owner owner)
{
if (IsTileType(tile, MP_RAILWAY) && HasSignals(tile) && IsRestrictedSignal(tile)) {
return SPR_ZONING_INNER_HIGHLIGHT_RED;
}
return ZONING_INVALID_SPRITE_ID;
}
/**
* General evaluation function; calls all the other functions depending on
* evaluation mode.
@@ -306,6 +323,7 @@ SpriteID TileZoningSpriteEvaluation(TileIndex tile, Owner owner, ZoningEvaluatio
case ZEM_STA_CATCH: return TileZoneCheckStationCatchmentEvaluation(tile, owner);
case ZEM_BUL_UNSER: return TileZoneCheckUnservedBuildingsEvaluation(tile, owner);
case ZEM_IND_UNSER: return TileZoneCheckUnservedIndustriesEvaluation(tile, owner);
case ZEM_TRACERESTRICT: return TileZoneCheckTraceRestrictEvaluation(tile, owner);
default: return ZONING_INVALID_SPRITE_ID;
}
}