diff options
Diffstat (limited to 'rail_map.h')
-rw-r--r-- | rail_map.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rail_map.h b/rail_map.h index da72d0250..f3a7a4626 100644 --- a/rail_map.h +++ b/rail_map.h @@ -174,6 +174,17 @@ static inline bool IsPresignalExit(TileIndex t) return GetSignalType(t) == SIGTYPE_EXIT || GetSignalType(t) == SIGTYPE_COMBO; } +static inline void CycleSignalSide(TileIndex t, Track track) +{ + byte sig; + byte pos = 6; + if (track == TRACK_LOWER || track == TRACK_RIGHT) pos = 4; + + sig = GB(_m[t].m3, pos, 2); + if (--sig == 0) sig = 3; + SB(_m[t].m3, pos, 2, sig); +} + typedef enum SignalVariant { SIG_ELECTRIC = 0, |