(svn r3912) Move the signal type enum and GetSignalType() to rail_map.h; also add SetSignalType() and use the functions

This commit is contained in:
tron
2006-03-17 06:26:37 +00:00
parent 0e3699bd5c
commit 4fb11f23ad
4 changed files with 25 additions and 27 deletions

View File

@@ -20,6 +20,26 @@ static inline TrackBits GetRailWaypointBits(TileIndex t)
}
typedef enum SignalType {
SIGTYPE_NORMAL = 0, // normal signal
SIGTYPE_ENTRY = 1, // presignal block entry
SIGTYPE_EXIT = 2, // presignal block exit
SIGTYPE_COMBO = 3 // presignal inter-block
} SignalType;
static inline SignalType GetSignalType(TileIndex t)
{
assert(GetRailTileType(t) == RAIL_TYPE_SIGNALS);
return (SignalType)GB(_m[t].m4, 0, 2);
}
static inline void SetSignalType(TileIndex t, SignalType s)
{
assert(GetRailTileType(t) == RAIL_TYPE_SIGNALS);
SB(_m[t].m4, 0, 2, s);
}
typedef enum SignalVariant {
SIG_ELECTRIC = 0,
SIG_SEMAPHORE = 1