79 static inline RailType GetRailTypeCrossing(TileIndex t) |
79 static inline RailType GetRailTypeCrossing(TileIndex t) |
80 { |
80 { |
81 return (RailType)GB(_m[t].m4, 0, 4); |
81 return (RailType)GB(_m[t].m4, 0, 4); |
82 } |
82 } |
83 |
83 |
|
84 static inline RailType GetRailTypeOnBridge(TileIndex t) |
|
85 { |
|
86 return (RailType)GB(_m[t].m3, 4, 4); |
|
87 } |
|
88 |
84 static inline void SetRailType(TileIndex t, RailType r) |
89 static inline void SetRailType(TileIndex t, RailType r) |
85 { |
90 { |
86 SB(_m[t].m3, 0, 4, r); |
91 SB(_m[t].m3, 0, 4, r); |
87 } |
92 } |
88 |
93 |
89 // TODO remove this by moving to the same bits as SetRailType() |
94 // TODO remove this by moving to the same bits as SetRailType() |
90 static inline void SetRailTypeCrossing(TileIndex t, RailType r) |
95 static inline void SetRailTypeCrossing(TileIndex t, RailType r) |
91 { |
96 { |
92 SB(_m[t].m4, 0, 4, r); |
97 SB(_m[t].m4, 0, 4, r); |
|
98 } |
|
99 |
|
100 static inline void SetRailTypeOnBridge(TileIndex t, RailType r) |
|
101 { |
|
102 SB(_m[t].m3, 4, 4, r); |
93 } |
103 } |
94 |
104 |
95 |
105 |
96 /** These are used to specify a single track. |
106 /** These are used to specify a single track. |
97 * Can be translated to a trackbit with TrackToTrackbit */ |
107 * Can be translated to a trackbit with TrackToTrackbit */ |