forked from mirror/OpenTTD
(svn r3898) Add functions to find a bridge end starting at a middle tile
This commit is contained in:
23
bridge_map.h
23
bridge_map.h
@@ -15,6 +15,12 @@ static inline bool IsBridgeRamp(TileIndex t)
|
||||
return !HASBIT(_m[t].m5, 6);
|
||||
}
|
||||
|
||||
static inline bool IsBridgeMiddle(TileIndex t)
|
||||
{
|
||||
return HASBIT(_m[t].m5, 6);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the direction pointing onto the bridge
|
||||
@@ -28,6 +34,12 @@ static inline DiagDirection GetBridgeRampDirection(TileIndex t)
|
||||
}
|
||||
|
||||
|
||||
static inline Axis GetBridgeAxis(TileIndex t)
|
||||
{
|
||||
return (Axis)GB(_m[t].m5, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
static inline bool IsClearUnderBridge(TileIndex t)
|
||||
{
|
||||
return GB(_m[t].m5, 3, 3) == 0;
|
||||
@@ -45,6 +57,17 @@ static inline TransportType GetTransportTypeUnderBridge(TileIndex t)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the end of a bridge in the specified direction starting at a middle tile
|
||||
*/
|
||||
TileIndex GetBridgeEnd(TileIndex, DiagDirection);
|
||||
|
||||
/**
|
||||
* Finds the southern end of a bridge starting at a middle tile
|
||||
*/
|
||||
TileIndex GetSouthernBridgeEnd(TileIndex t);
|
||||
|
||||
|
||||
/**
|
||||
* Starting at one bridge end finds the other bridge end
|
||||
*/
|
||||
|
Reference in New Issue
Block a user