int GetBridgeHeight(typename TileIndexT<Tgeneric>::T t) { int h; Slope tileh = GetTileSlope(t, &h); Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(t))); /* one height level extra for the ramp */ return h + 1 + ApplyFoundationToSlope(f, &tileh); }
/** * Get the height ('z') of a bridge in pixels. * @param tile the bridge ramp tile to get the bridge height from * @return the height of the bridge in pixels */ uint GetBridgeHeight(TileIndex t) { uint h; Slope tileh = GetTileSlope(t, &h); Foundation f = GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(t))); /* one height level extra for the ramp */ return h + TILE_HEIGHT + ApplyFoundationToSlope(f, &tileh); }