diff options
author | tron <tron@openttd.org> | 2006-03-17 10:10:31 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-17 10:10:31 +0000 |
commit | 7b1c7c31fb65c3727b85907230d02c2a0a77f405 (patch) | |
tree | 0fa3ce74d133cc13b1aaf01d162e59d16ce3371e /rail_map.h | |
parent | e1abce7082b7227c7e889c487cd559c1b4e5bf1e (diff) | |
download | openttd-7b1c7c31fb65c3727b85907230d02c2a0a77f405.tar.xz |
(svn r3916) Get/Set the rail type by [GS]etRailType{Crossing,OnBridge,}()
Diffstat (limited to 'rail_map.h')
-rw-r--r-- | rail_map.h | 28 |
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 */ |