summaryrefslogtreecommitdiff
path: root/rail_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'rail_map.h')
-rw-r--r--rail_map.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/rail_map.h b/rail_map.h
index b6f9512fe..e03893470 100644
--- a/rail_map.h
+++ b/rail_map.h
@@ -36,7 +36,6 @@ typedef enum RailTypes {
RAILTYPE_MONO = 1,
RAILTYPE_MAGLEV = 2,
RAILTYPE_END,
- RAILTYPE_MASK = 0x3,
INVALID_RAILTYPE = 0xFF
} RailType;
@@ -45,6 +44,33 @@ static inline RailType GetRailType(TileIndex t)
return (RailType)GB(_m[t].m3, 0, 4);
}
+// TODO remove this by moving to the same bits as GetRailType()
+static inline RailType GetRailTypeCrossing(TileIndex t)
+{
+ return (RailType)GB(_m[t].m4, 0, 4);
+}
+
+static inline RailType GetRailTypeOnBridge(TileIndex t)
+{
+ return (RailType)GB(_m[t].m3, 4, 4);
+}
+
+static inline void SetRailType(TileIndex t, RailType r)
+{
+ SB(_m[t].m3, 0, 4, r);
+}
+
+// TODO remove this by moving to the same bits as SetRailType()
+static inline void SetRailTypeCrossing(TileIndex t, RailType r)
+{
+ SB(_m[t].m4, 0, 4, r);
+}
+
+static inline void SetRailTypeOnBridge(TileIndex t, RailType r)
+{
+ SB(_m[t].m3, 4, 4, r);
+}
+
/** These are used to specify a single track.
* Can be translated to a trackbit with TrackToTrackbit */