OpenTTD Source
20241120-master-g6d3adc6169
|
Global tile accessors. More...
Go to the source code of this file.
Functions | |
static std::tuple< Slope, int > | GetTileSlopeGivenHeight (int hnorth, int hwest, int heast, int hsouth) |
Get a tile's slope given the heigh of its four corners. More... | |
std::tuple< Slope, int > | GetTileSlopeZ (TileIndex tile) |
Return the slope of a given tile inside the map. More... | |
std::tuple< Slope, int > | GetTilePixelSlopeOutsideMap (int x, int y) |
Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles). More... | |
bool | IsTileFlat (TileIndex tile, int *h) |
Check if a given tile is flat. More... | |
int | GetTileZ (TileIndex tile) |
Get bottom height of the tile. More... | |
int | GetTileMaxZ (TileIndex t) |
Get top height of the tile inside the map. More... | |
Global tile accessors.
Definition in file tile_map.cpp.
int GetTileMaxZ | ( | TileIndex | t | ) |
Get top height of the tile inside the map.
t | Tile to compute height of |
Definition at line 136 of file tile_map.cpp.
References Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by AutoslopeCheckForEntranceEdge(), CheckBuildHouseSameZ(), DrawRoadTypeCatenary(), FloodVehicleProc(), GetOtherAqueductEnd(), GetTileMaxPixelZ(), RiverMakeWider(), ShipTestUpDownOnLock(), and TryBuildTownHouse().
std::tuple<Slope, int> GetTilePixelSlopeOutsideMap | ( | int | x, |
int | y | ||
) |
Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles).
x | X coordinate of the tile to compute slope of, may be outside the map. |
y | Y coordinate of the tile to compute slope of, may be outside the map. |
h | If not nullptr , pointer to storage of z height. |
Definition at line 78 of file tile_map.cpp.
|
static |
Get a tile's slope given the heigh of its four corners.
hnorth | The height at the northern corner in the same unit as TileHeight. |
hwest | The height at the western corner in the same unit as TileHeight. |
heast | The height at the eastern corner in the same unit as TileHeight. |
hsouth | The height at the southern corner in the same unit as TileHeight. |
Definition at line 23 of file tile_map.cpp.
References SLOPE_E, SLOPE_FLAT, SLOPE_N, SLOPE_S, SLOPE_STEEP, and SLOPE_W.
Referenced by GetTileSlopeZ().
Return the slope of a given tile inside the map.
tile | Tile to compute slope of |
Definition at line 55 of file tile_map.cpp.
References GetTileSlopeGivenHeight(), Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by CheckBuildableTile(), FlowsDown(), GetBridgeHeight(), GetFoundationSlope(), GetOtherAqueductEnd(), GetTilePixelSlope(), and GetTileSlope().
int GetTileZ | ( | TileIndex | tile | ) |
Get bottom height of the tile.
tile | Tile to compute height of |
Definition at line 116 of file tile_map.cpp.
References Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by CheckNewIndustry_BubbleGen(), FlowRiver(), GetOtherTunnelEnd(), GetTilePixelZ(), CanalScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), GrowTownWithTunnel(), IsTunnelInWayDir(), RiverMakeWider(), ShipTestUpDownOnLock(), and TileLoopClearAlps().
bool IsTileFlat | ( | TileIndex | tile, |
int * | h | ||
) |
Check if a given tile is flat.
tile | Tile to check |
h | If not nullptr , pointer to storage of z height (only if tile is flat) |
Definition at line 95 of file tile_map.cpp.
References Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by CheckIfIndustryTilesAreFree(), CmdBuildBuoy(), CmdBuildShipDepot(), FindFurthestFromWater(), FindSpring(), GrowTown(), MakeLake(), RiverMakeWider(), SetWaterClassDependingOnSurroundings(), TownCanBePlacedHere(), and TryBuildTransmitter().