Initial implementation of NewGRF custom signal styles

This commit is contained in:
Jonathan G Rennison
2022-06-18 23:37:35 +01:00
parent 098bb74ed2
commit 6e4c4b35e7
34 changed files with 536 additions and 75 deletions

View File

@@ -133,3 +133,23 @@ bool IsTunnelInWay(TileIndex tile, int z, IsTunnelInWayFlags flags)
{
return IsTunnelInWaySingleAxis(tile, z, flags, false, 1) || IsTunnelInWaySingleAxis(tile, z, flags, true, TileOffsByDiagDir(DIAGDIR_SE));
}
void SetTunnelSignalStyle(TileIndex t, TileIndex end, uint8 style)
{
if (style == 0) {
/* Style already 0 */
if (!HasBit(_m[t].m3, 7)) return;
ClrBit(_m[t].m3, 7);
ClrBit(_m[end].m3, 7);
} else {
SetBit(_m[t].m3, 7);
SetBit(_m[end].m3, 7);
}
Tunnel::GetByTile(t)->style = style;
}
uint8 GetTunnelSignalStyleExtended(TileIndex t)
{
return Tunnel::GetByTile(t)->style;
}