(svn r4378) -Add and make use of an accessor function two-way => one-way => one-way => two-way signal cycling
This commit is contained in:
11
rail_map.h
11
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,
|
||||
|
||||
Reference in New Issue
Block a user