forked from mirror/OpenTTD
(svn r3698) Add GetCrossingRailBits() and ComplementRoadBits(). Simplify the code by using them
This commit is contained in:
11
road.h
11
road.h
@@ -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,
|
||||
|
Reference in New Issue
Block a user