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

Function GetSlopeZInCorner

src/landscape.cpp:340–344  ·  view source on GitHub ↗

* Determine the Z height of a corner relative to TileZ. * * @pre The slope must not be a halftile slope. * * @param tileh The slope. * @param corner The corner. * @return Z position of corner relative to TileZ. */

Source from the content-addressed store, hash-verified

338 * @return Z position of corner relative to TileZ.
339 */
340int GetSlopeZInCorner(Slope tileh, Corner corner)
341{
342 assert(!IsHalftileSlope(tileh));
343 return ((tileh & SlopeWithOneCornerRaised(corner)) != 0 ? 1 : 0) + (tileh == SteepSlope(corner) ? 1 : 0);
344}
345
346/**
347 * Determine the Z height of the corners of a specific tile edge

Callers 4

TestAutoslopeOnRailTileFunction · 0.85
TerraformTile_TrackFunction · 0.85
GetSlopePixelZInCornerFunction · 0.85
GetCornerHeightMethod · 0.85

Calls 3

IsHalftileSlopeFunction · 0.85
SlopeWithOneCornerRaisedFunction · 0.85
SteepSlopeFunction · 0.85

Tested by 1

TestAutoslopeOnRailTileFunction · 0.68