Zoning: Cache expensive zoning overlay values
This commit is contained in:
22
src/zoning.h
22
src/zoning.h
@@ -29,6 +29,17 @@ enum ZoningEvaluationMode {
|
||||
ZEM_TRACERESTRICT, ///< Check for restricted signals
|
||||
};
|
||||
|
||||
/**
|
||||
* Zoning evaluation modes
|
||||
*/
|
||||
enum ZoningModeMask {
|
||||
ZMM_NOTHING = 0, ///< No zoning mask
|
||||
ZMM_INNER, ///< Inner
|
||||
ZMM_OUTER, ///< Outer
|
||||
ZMM_ALL = ZMM_INNER | ZMM_OUTER,
|
||||
};
|
||||
DECLARE_ENUM_AS_BIT_SET(ZoningModeMask)
|
||||
|
||||
/**
|
||||
* Global Zoning state structure
|
||||
*/
|
||||
@@ -47,12 +58,13 @@ void DrawTileZoning(const TileInfo *ti);
|
||||
|
||||
void ShowZoningToolbar();
|
||||
|
||||
void ZoningMarkDirtyStationCoverageArea(const Station *st);
|
||||
void ZoningMarkDirtyStationCoverageArea(const Station *st, ZoningModeMask mask = ZMM_ALL);
|
||||
inline void ZoningMarkDirtyStationCoverageArea(const Waypoint *st) { } // no-op
|
||||
|
||||
inline void ZoningStationWindowOpenClose(const Station *st)
|
||||
{
|
||||
if (_zoning.inner == ZEM_STA_CATCH_WIN || _zoning.outer == ZEM_STA_CATCH_WIN) ZoningMarkDirtyStationCoverageArea(st);
|
||||
}
|
||||
void ZoningStationWindowOpenClose(const Station *st);
|
||||
|
||||
void SetZoningMode(bool inner, ZoningEvaluationMode mode);
|
||||
|
||||
void ClearZoningCaches();
|
||||
|
||||
#endif /* ZONING_H */
|
||||
|
Reference in New Issue
Block a user