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

Function ComplementSlope

src/slope_func.h:76–80  ·  view source on GitHub ↗

* Return the complement of a slope. * * This method returns the complement of a slope. The complement of a * slope is a slope with raised corner which aren't raised in the given * slope. * * @pre The slope must neither be steep nor a halftile slope. * @param s The #Slope to get the complement. * @return a complement Slope of the given slope. */

Source from the content-addressed store, hash-verified

74 * @return a complement Slope of the given slope.
75 */
76inline Slope ComplementSlope(Slope s)
77{
78 assert(!IsSteepSlope(s) && !IsHalftileSlope(s));
79 return s ^ SLOPE_ELEVATED;
80}
81
82/**
83 * Tests if a specific slope has exactly one corner raised.

Callers 10

IsSlopeRefusedFunction · 0.85
RiverMakeWiderFunction · 0.85
FlowRiverFunction · 0.85
DrawTrackDetailsFunction · 0.85
DrawTrackBitsFunction · 0.85
CmdBuildTunnelFunction · 0.85
IsRoadAllowedHereFunction · 0.85
GetComplementSlopeMethod · 0.85

Calls 2

IsSteepSlopeFunction · 0.85
IsHalftileSlopeFunction · 0.85

Tested by

no test coverage detected