summaryrefslogtreecommitdiff
path: root/rail_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'rail_map.h')
-rw-r--r--rail_map.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/rail_map.h b/rail_map.h
index 0ad224131..ab09db4ed 100644
--- a/rail_map.h
+++ b/rail_map.h
@@ -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