MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetBridgeFoundation

Function GetBridgeFoundation

src/tunnelbridge_cmd.cpp:115–122  ·  view source on GitHub ↗

* Get the foundation for a bridge. * @param tileh The slope to build the bridge on. * @param axis The axis of the bridge entrance. * @return The foundation required. */

Source from the content-addressed store, hash-verified

113 * @return The foundation required.
114 */
115Foundation GetBridgeFoundation(Slope tileh, Axis axis)
116{
117 if (tileh == SLOPE_FLAT ||
118 ((tileh == SLOPE_NE || tileh == SLOPE_SW) && axis == AXIS_X) ||
119 ((tileh == SLOPE_NW || tileh == SLOPE_SE) && axis == AXIS_Y)) return FOUNDATION_NONE;
120
121 return (HasSlopeHighestCorner(tileh) ? InclinedFoundation(axis) : FlatteningFoundation(tileh));
122}
123
124/**
125 * Determines if the track on a bridge ramp is flat or goes up/down.

Callers 7

HasBridgeFlatRampFunction · 0.85
CheckBridgeSlopeFunction · 0.85
DrawTile_TunnelBridgeFunction · 0.85
DrawRailCatenaryRailwayFunction · 0.85
GetBridgeHeightFunction · 0.85

Calls 3

HasSlopeHighestCornerFunction · 0.85
InclinedFoundationFunction · 0.85
FlatteningFoundationFunction · 0.85

Tested by

no test coverage detected