(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:
celestar
2006-04-12 09:36:27 +00:00
parent 3207d63244
commit ce320ceb55
2 changed files with 12 additions and 20 deletions

View File

@@ -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,