Initial support for NewGRF road stops (bus and lorry stops)

This commit is contained in:
Jonathan G Rennison
2022-02-09 02:11:55 +00:00
parent a3c003546b
commit 1084bb8566
28 changed files with 1592 additions and 119 deletions

View File

@@ -605,6 +605,42 @@ static inline uint GetCustomStationSpecIndex(TileIndex t)
return _m[t].m4;
}
/**
* Is there a custom road stop spec on this tile?
* @param t Tile to query
* @pre IsAnyRoadStopTile(t)
* @return True if this station is part of a newgrf station.
*/
static inline bool IsCustomRoadStopSpecIndex(TileIndex t)
{
assert_tile(IsAnyRoadStopTile(t), t);
return GB(_me[t].m8, 0, 6) != 0;
}
/**
* Set the custom road stop spec for this tile.
* @param t Tile to set the stationspec of.
* @param specindex The new spec.
* @pre IsAnyRoadStopTile(t)
*/
static inline void SetCustomRoadStopSpecIndex(TileIndex t, byte specindex)
{
assert_tile(IsAnyRoadStopTile(t), t);
SB(_me[t].m8, 0, 6, specindex);
}
/**
* Get the custom road stop spec for this tile.
* @param t Tile to query
* @pre IsAnyRoadStopTile(t)
* @return The custom station spec of this tile.
*/
static inline uint GetCustomRoadStopSpecIndex(TileIndex t)
{
assert_tile(IsAnyRoadStopTile(t), t);
return GB(_me[t].m8, 0, 6);
}
/**
* Set the random bits for a station tile.
* @param t Tile to set random bits for.