Add: NewGRF road stops

This commit is contained in:
Jonathan G Rennison
2022-11-06 15:01:27 +00:00
committed by rubidium42
parent a18182e24b
commit 4c1406a4b5
33 changed files with 2086 additions and 132 deletions

View File

@@ -497,6 +497,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 IsRoadStopTile(t)
* @return True if this station is part of a newgrf station.
*/
static inline bool IsCustomRoadStopSpecIndex(TileIndex t)
{
assert(IsRoadStopTile(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 IsRoadStopTile(t)
*/
static inline void SetCustomRoadStopSpecIndex(TileIndex t, byte specindex)
{
assert(IsRoadStopTile(t));
SB(_me[t].m8, 0, 6, specindex);
}
/**
* Get the custom road stop spec for this tile.
* @param t Tile to query
* @pre IsRoadStopTile(t)
* @return The custom station spec of this tile.
*/
static inline uint GetCustomRoadStopSpecIndex(TileIndex t)
{
assert(IsRoadStopTile(t));
return GB(_me[t].m8, 0, 6);
}
/**
* Set the random bits for a station tile.
* @param t Tile to set random bits for.