|
@@ -120,96 +120,101 @@ static inline bool IsRoadStopTile(TileIn
|
|
|
|
|
|
static inline bool IsStandardRoadStopTile(TileIndex t)
|
|
|
{
|
|
|
return IsRoadStopTile(t) && GetStationGfx(t) < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET;
|
|
|
}
|
|
|
|
|
|
static inline bool IsDriveThroughStopTile(TileIndex t)
|
|
|
{
|
|
|
return IsRoadStopTile(t) && GetStationGfx(t) >= GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET;
|
|
|
}
|
|
|
|
|
|
static inline bool GetStopBuiltOnTownRoad(TileIndex t)
|
|
|
{
|
|
|
assert(IsDriveThroughStopTile(t));
|
|
|
return HasBit(_m[t].m6, 2);
|
|
|
}
|
|
|
|
|
|
static inline void SetStopBuiltOnTownRoad(TileIndex t, bool on_town_road)
|
|
|
{
|
|
|
assert(IsDriveThroughStopTile(t));
|
|
|
SB(_m[t].m6, 2, 1, on_town_road);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Gets the direction the road stop entrance points towards.
|
|
|
*/
|
|
|
static inline DiagDirection GetRoadStopDir(TileIndex t)
|
|
|
{
|
|
|
StationGfx gfx = GetStationGfx(t);
|
|
|
assert(IsRoadStopTile(t));
|
|
|
if (gfx < GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET) {
|
|
|
return (DiagDirection)(gfx);
|
|
|
} else {
|
|
|
return (DiagDirection)(gfx - GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
static inline bool IsOilRig(TileIndex t)
|
|
|
{
|
|
|
return GetStationType(t) == STATION_OILRIG;
|
|
|
}
|
|
|
|
|
|
static inline bool IsDock(TileIndex t)
|
|
|
{
|
|
|
return GetStationType(t) == STATION_DOCK;
|
|
|
}
|
|
|
|
|
|
static inline bool IsDockTile(TileIndex t)
|
|
|
{
|
|
|
return IsTileType(t, MP_STATION) && GetStationType(t) == STATION_DOCK;
|
|
|
}
|
|
|
|
|
|
static inline bool IsBuoy(TileIndex t)
|
|
|
{
|
|
|
return GetStationType(t) == STATION_BUOY;
|
|
|
}
|
|
|
|
|
|
static inline bool IsBuoyTile(TileIndex t)
|
|
|
{
|
|
|
return IsTileType(t, MP_STATION) && IsBuoy(t);
|
|
|
}
|
|
|
|
|
|
static inline bool IsHangarTile(TileIndex t)
|
|
|
{
|
|
|
return IsTileType(t, MP_STATION) && IsHangar(t);
|
|
|
}
|
|
|
|
|
|
|
|
|
static inline Axis GetRailStationAxis(TileIndex t)
|
|
|
{
|
|
|
assert(IsRailwayStation(t));
|
|
|
return HasBit(GetStationGfx(t), 0) ? AXIS_Y : AXIS_X;
|
|
|
}
|
|
|
|
|
|
|
|
|
static inline Track GetRailStationTrack(TileIndex t)
|
|
|
{
|
|
|
return AxisToTrack(GetRailStationAxis(t));
|
|
|
}
|
|
|
|
|
|
static inline bool IsCompatibleTrainStationTile(TileIndex t1, TileIndex t2)
|
|
|
{
|
|
|
assert(IsRailwayStationTile(t2));
|
|
|
return
|
|
|
IsRailwayStationTile(t1) &&
|
|
|
IsCompatibleRail(GetRailType(t1), GetRailType(t2)) &&
|
|
|
GetRailStationAxis(t1) == GetRailStationAxis(t2) &&
|
|
|
GetStationIndex(t1) == GetStationIndex(t2) &&
|
|
|
!IsStationTileBlocked(t1);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Get the reservation state of the rail station
|
|
|
* @pre IsRailwayStationTile(t)
|
|
|
* @param t the station tile
|
|
|
* @return reservation state
|
|
|
*/
|
|
|
static inline bool GetRailwayStationReservation(TileIndex t)
|
|
|
{
|
|
|
assert(IsRailwayStationTile(t));
|