Functions

# tile_map.cpp File Reference

Global tile accessors. More...

`#include "stdafx.h"`
`#include "tile_map.h"`

Go to the source code of this file.

## Functions
Slope | GetTileSlope (TileIndex tile, int *h)
| Return the slope of a given tile.
int | GetTileZ (TileIndex tile)
| Get bottom height of the tile.
int | GetTileMaxZ (TileIndex t)
| Get top height of the tile.

## Detailed Description

Global tile accessors.

Definition in file tile_map.cpp.

## Function Documentation

int GetTileMaxZ | ( | TileIndex | t | ) |

Get top height of the tile.

Parameters:

  | t | Tile to compute height of

Returns:
  Maximum height of the tile

Definition at line 87 of file tile_map.cpp.

References MapMaxX(), MapMaxY(), TileDiffXY(), TileHeight(), TileX(), and TileY().

Referenced by AutoslopeCheckForEntranceEdge(), BuildTownHouse(), CheckBuildHouseSameZ(), CmdBuildBridge(), CmdBuildObject(), DoClearBridge(), DrawCatenaryRailway(), DrawRoadBits(), DrawTramCatenary(), FindSpring(), FloodVehicleProc(), GetOtherAqueductEnd(), GetTerrainType(), and GetTileMaxPixelZ().

Slope GetTileSlope | ( | TileIndex | tile,
|  | int * | h |
| ) |  |  |

Return the slope of a given tile.

Parameters:

  | tile | Tile to compute slope of
  | h | If not `NULL`, pointer to storage of z height

Returns:
  Slope of the tile, except for the HALFTILE part

Definition at line 21 of file tile_map.cpp.

References _settings_game, GameSettings::construction, ConstructionSettings::freeform_edges, MapMaxX(), MapMaxY(), MapSize(), min(), SLOPE_N, TileDiffXY(), TileHeight(), TileX(), and TileY().

Referenced by AfterLoadGame(), BuildTownHouse(), CanBuildHouseHere(), CanPlantTreesOnTile(), CheckBuildableTile(), CheckIfIndustryTilesAreFree(), CmdBuildBridge(), CmdBuildBuoy(), CmdBuildCanal(), CmdBuildDock(), CmdBuildLock(), CmdBuildObject(), CmdBuildRoad(), CmdBuildRoadDepot(), CmdBuildShipDepot(), CmdBuildSingleRail(), CmdBuildTrainDepot(), CmdBuildTunnel(), CmdPlantTree(), CmdRemoveSingleRail(), DoBuildLock(), DoFloodTile(), DrawCatenaryRailway(), FindFurthestFromWater(), FindSpring(), FloodHalftile(), FlowRiver(), FlowsDown(), GetBridgeHeight(), GetFloodingBehaviour(), GetFoundationSlope(), GetOtherAqueductEnd(), GetTilePixelSlope(), GetTownRoadGridElement(), StationScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), GrowTown(), GrowTownWithBridge(), IsRoadAllowedHere(), IsValidTileForWaypoint(), IsWateredTile(), MakeLake(), BuildDocksToolbarWindow::OnPlaceObject(), BuildDocksToolbarWindow::OnPlacePresize(), PerformIndustryTileSlopeCheck(), PerformStationTileSlopeCheck(), RemoveRoad(), SearchTileForStatue(), SetWaterClassDependingOnSurroundings(), CYapfCostBase::stSlopeCost(), and TownCanBePlacedHere().

int GetTileZ | ( | TileIndex | tile | ) |

Get bottom height of the tile.

Parameters:

  | tile | Tile to compute height of

Returns:
  Minimum height of the tile

Definition at line 70 of file tile_map.cpp.

References MapMaxX(), MapMaxY(), min(), TileDiffXY(), TileHeight(), TileX(), and TileY().

Referenced by AmbientSoundEffectCallback(), CheckNewIndustry_BubbleGen(), CheckNewIndustry_Farm(), CheckNewIndustry_Forest(), GetOtherTunnelEnd(), GetTerrainType(), GetTilePixelZ(), IndustriesScopeResolver::GetVariable(), CanalScopeResolver::GetVariable(), IsTunnelInWayDir(), LandInfoWindow::OnInit(), PlaceTreeAtSameHeight(), PlaceTreesRandomly(), and TileLoopClearAlps().