diff options
author | tron <tron@openttd.org> | 2006-03-01 12:31:39 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-01 12:31:39 +0000 |
commit | 5d6ec6b4f06e9f4885ccd6db105c5978000032fb (patch) | |
tree | ed7c0e1028b849d33aeafacda8264ad370b8cbd3 /road.h | |
parent | 7b106a3d8f2840dc9b2fc4fb9a945d4c8834046a (diff) | |
download | openttd-5d6ec6b4f06e9f4885ccd6db105c5978000032fb.tar.xz |
(svn r3698) Add GetCrossingRailBits() and ComplementRoadBits(). Simplify the code by using them
Diffstat (limited to 'road.h')
-rw-r--r-- | road.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -17,6 +17,11 @@ typedef enum RoadBits { ROAD_ALL = ROAD_X | ROAD_Y } RoadBits; +static inline RoadBits ComplementRoadBits(RoadBits r) +{ + return ROAD_ALL ^ r; +} + static inline RoadBits GetRoadBits(TileIndex tile) { return GB(_m[tile].m5, 0, 4); @@ -27,6 +32,12 @@ static inline RoadBits GetCrossingRoadBits(TileIndex tile) return _m[tile].m5 & 8 ? ROAD_Y : ROAD_X; } +static inline TrackBits GetCrossingRailBits(TileIndex tile) +{ + return _m[tile].m5 & 8 ? TRACK_BIT_X : TRACK_BIT_Y; +} + + typedef enum RoadType { ROAD_NORMAL, ROAD_CROSSING, |