OpenTTD
|
Map accessor functions for bridges. More...
Go to the source code of this file.
Functions | |
static bool | IsBridge (TileIndex t) |
Checks if this is a bridge, instead of a tunnel. | |
static bool | IsBridgeTile (TileIndex t) |
checks if there is a bridge on this tile | |
static bool | IsBridgeAbove (TileIndex t) |
checks if a bridge is set above the ground of this tile | |
static BridgeType | GetBridgeType (TileIndex t) |
Determines the type of bridge on a tile. | |
static Axis | GetBridgeAxis (TileIndex t) |
Get the axis of the bridge that goes over the tile. | |
TileIndex | GetNorthernBridgeEnd (TileIndex t) |
Finds the northern end of a bridge starting at a middle tile. | |
TileIndex | GetSouthernBridgeEnd (TileIndex t) |
Finds the southern end of a bridge starting at a middle tile. | |
TileIndex | GetOtherBridgeEnd (TileIndex t) |
Starting at one bridge end finds the other bridge end. | |
int | GetBridgeHeight (TileIndex tile) |
Get the height ('z') of a bridge. | |
static int | GetBridgePixelHeight (TileIndex tile) |
Get the height ('z') of a bridge in pixels. | |
static void | ClearSingleBridgeMiddle (TileIndex t, Axis a) |
Remove the bridge over the given axis. | |
static void | ClearBridgeMiddle (TileIndex t) |
Removes bridges from the given, that is bridges along the X and Y axis. | |
static void | SetBridgeMiddle (TileIndex t, Axis a) |
Set that there is a bridge over the given axis. | |
static void | MakeBridgeRamp (TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, TransportType tt, uint rt) |
Generic part to make a bridge ramp for both roads and rails. | |
static void | MakeRoadBridgeRamp (TileIndex t, Owner o, Owner owner_road, Owner owner_tram, BridgeType bridgetype, DiagDirection d, RoadTypes r) |
Make a bridge ramp for roads. | |
static void | MakeRailBridgeRamp (TileIndex t, Owner o, BridgeType bridgetype, DiagDirection d, RailType r) |
Make a bridge ramp for rails. | |
static void | MakeAqueductBridgeRamp (TileIndex t, Owner o, DiagDirection d) |
Make a bridge ramp for aqueducts. |
Map accessor functions for bridges.
Definition in file bridge_map.h.
|
inlinestatic |
Removes bridges from the given, that is bridges along the X and Y axis.
t | the tile to remove the bridge from |
Definition at line 103 of file bridge_map.h.
References AXIS_X, AXIS_Y, and ClearSingleBridgeMiddle().
Referenced by AfterLoadGame(), and DoClearBridge().
Remove the bridge over the given axis.
t | the tile to remove the bridge from |
a | the axis of the bridge to remove |
Definition at line 94 of file bridge_map.h.
Referenced by ClearBridgeMiddle().
Get the axis of the bridge that goes over the tile.
Not the axis or the ramp.
t | The tile to analyze |
Definition at line 68 of file bridge_map.h.
References _m, GB(), and IsBridgeAbove().
Referenced by CmdBuildBridge(), DrawBridgeMiddle(), DrawRailCatenaryOnBridge(), DrawRailCatenaryRailway(), GetNorthernBridgeEnd(), GetSouthernBridgeEnd(), and IsRoadAllowedHere().
int GetBridgeHeight | ( | TileIndex | t | ) |
Get the height ('z') of a bridge.
tile | the bridge ramp tile to get the bridge height from |
Definition at line 72 of file bridge_map.cpp.
References ApplyFoundationToSlope(), DiagDirToAxis(), GetBridgeFoundation(), GetTileSlope(), and GetTunnelBridgeDirection().
Referenced by CmdBuildBridge(), CmdBuildObject(), CmdTerraformLand(), DoClearBridge(), DrawRailCatenaryRailway(), DrawRoadBits(), DrawRoadCatenary(), GetBridgePixelHeight(), GetTerrainType(), and MarkBridgeDirty().
|
inlinestatic |
Get the height ('z') of a bridge in pixels.
tile | the bridge ramp tile to get the bridge height from |
Definition at line 84 of file bridge_map.h.
References GetBridgeHeight(), and TILE_HEIGHT.
Referenced by DrawBridgeMiddle(), DrawRailCatenaryOnBridge(), FloodVehicles(), and ViewportAddLandscape().
|
inlinestatic |
Determines the type of bridge on a tile.
t | The tile to analyze |
Definition at line 56 of file bridge_map.h.
References _me, GB(), and IsBridgeTile().
Referenced by CmdBuildBridge(), DrawBridgeMiddle(), DrawTile_TunnelBridge(), RoadVehicle::GetCurrentMaxSpeed(), Train::GetCurrentMaxSpeed(), and CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSpeedLimit().
Finds the northern end of a bridge starting at a middle tile.
t | the bridge tile to find the bridge ramp for |
Definition at line 41 of file bridge_map.cpp.
References AxisToDiagDir(), GetBridgeAxis(), GetBridgeEnd(), and ReverseDiagDir().
Referenced by AfterLoadGame(), CmdBuildBridge(), DrawBridgeMiddle(), DrawRailCatenaryRailway(), DrawRoadBits(), DrawRoadCatenary(), and ViewportAddLandscape().
Starting at one bridge end finds the other bridge end.
t | the bridge ramp tile to find the other bridge ramp for |
Definition at line 61 of file bridge_map.cpp.
References GetBridgeEnd(), GetTunnelBridgeDirection(), and IsBridgeTile().
Referenced by CmdBuildBridge(), DoClearBridge(), DrawRailCatenaryOnBridge(), FloodVehicles(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::FollowTileExit(), GetOtherTunnelBridgeEnd(), and GetRailTrackBitsUniversal().
Finds the southern end of a bridge starting at a middle tile.
t | the bridge tile to find the bridge ramp for |
Definition at line 51 of file bridge_map.cpp.
References AxisToDiagDir(), GetBridgeAxis(), and GetBridgeEnd().
Referenced by CmdBuildObject(), CmdTerraformLand(), DrawBridgeMiddle(), and DrawRailCatenaryOnBridge().
|
inlinestatic |
Checks if this is a bridge, instead of a tunnel.
t | The tile to analyze |
Definition at line 24 of file bridge_map.h.
References _m, HasBit(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by AfterLoadGame(), ClearPathReservation(), CmdBuildLongRoad(), CmdBuildRoad(), CmdConvertRail(), IsBridgeTile(), and RemoveRoad().
|
inlinestatic |
checks if a bridge is set above the ground of this tile
t | The tile to analyze |
Definition at line 45 of file bridge_map.h.
Referenced by CanBuildHouseHere(), CanPlantTreesOnTile(), CheckBuildableTile(), CheckIfIndustryTilesAreFree(), CmdBuildBridge(), CmdBuildBuoy(), CmdBuildDock(), CmdBuildObject(), CmdBuildRoadDepot(), CmdBuildShipDepot(), CmdBuildTrainDepot(), CmdPlantTree(), CmdTerraformLand(), DoBuildLock(), DrawBridgeMiddle(), DrawRailCatenaryRailway(), DrawRoadBits(), DrawRoadCatenary(), GetBridgeAxis(), IsRoadAllowedHere(), IsValidTileForWaypoint(), SearchTileForStatue(), Vehicle::ShowVisualEffect(), TryBuildLightHouse(), TryBuildTransmitter(), and ViewportAddLandscape().
|
inlinestatic |
checks if there is a bridge on this tile
t | The tile to analyze |
Definition at line 35 of file bridge_map.h.
References IsBridge(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by AfterLoadGame(), CmdBuildBridge(), DrawRailCatenaryRailway(), FloodVehicles(), GetBridgeEnd(), GetBridgeType(), GetOtherBridgeEnd(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSpeedLimit(), PlaceRail_Bridge(), PlaceRoad_Bridge(), ShowBuildBridgeWindow(), CYapfCostBase::stSlopeCost(), TryReserveRailTrack(), UnreserveRailTrack(), and UpdateStatusAfterSwap().
|
inlinestatic |
Make a bridge ramp for aqueducts.
t | the tile to make a bridge ramp |
o | the new owner of the bridge ramp |
d | the direction this ramp must be facing |
Definition at line 178 of file bridge_map.h.
References MakeBridgeRamp(), and TRANSPORT_WATER.
Referenced by CmdBuildBridge().
|
inlinestatic |
Generic part to make a bridge ramp for both roads and rails.
t | the tile to make a bridge ramp |
o | the new owner of the bridge ramp |
bridgetype | the type of bridge this bridge ramp belongs to |
d | the direction this ramp must be facing |
tt | the transport type of the bridge |
rt | the road or rail type |
Definition at line 129 of file bridge_map.h.
References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_TUNNELBRIDGE, SB(), SetTileOwner(), and SetTileType().
Referenced by MakeAqueductBridgeRamp(), MakeRailBridgeRamp(), and MakeRoadBridgeRamp().
|
inlinestatic |
Make a bridge ramp for rails.
t | the tile to make a bridge ramp |
o | the new owner of the bridge ramp |
bridgetype | the type of bridge this bridge ramp belongs to |
d | the direction this ramp must be facing |
r | the rail type of the bridge |
Definition at line 167 of file bridge_map.h.
References MakeBridgeRamp(), and TRANSPORT_RAIL.
Referenced by CmdBuildBridge().
|
inlinestatic |
Make a bridge ramp for roads.
t | the tile to make a bridge ramp |
o | the new owner of the bridge ramp |
owner_road | the new owner of the road on the bridge |
owner_tram | the new owner of the tram on the bridge |
bridgetype | the type of bridge this bridge ramp belongs to |
d | the direction this ramp must be facing |
r | the road type of the bridge |
Definition at line 151 of file bridge_map.h.
References MakeBridgeRamp(), OWNER_TOWN, ROADTYPE_ROAD, ROADTYPE_TRAM, SetRoadOwner(), SetRoadTypes(), and TRANSPORT_ROAD.
Referenced by CmdBuildBridge().
Set that there is a bridge over the given axis.
t | the tile to add the bridge to |
a | the axis of the bridge to add |
Definition at line 114 of file bridge_map.h.
Referenced by AfterLoadGame(), and CmdBuildBridge().