summaryrefslogtreecommitdiff
path: root/rail_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-17 06:26:37 +0000
committertron <tron@openttd.org>2006-03-17 06:26:37 +0000
commit41ee22ed999362ce5a8f9f5713207da2049145c5 (patch)
tree2070ee15ae157b6739ca7446e9e5e6bf73385c65 /rail_map.h
parent2232412f598d0c046dff9168467efcdee7dcbbf2 (diff)
downloadopenttd-41ee22ed999362ce5a8f9f5713207da2049145c5.tar.xz
(svn r3912) Move the signal type enum and GetSignalType() to rail_map.h; also add SetSignalType() and use the functions
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