Go to the documentation of this file.
102 return (
Slope)(1 << corner);
137 default: NOT_REACHED();
151 return (
Corner)((s >> 6) & 3);
186 return (
Corner)(corner ^ 2);
263 default: NOT_REACHED();
static Corner OppositeCorner(Corner corner)
Returns the opposite corner.
@ FOUNDATION_HALFTILE_N
Level north halftile non-continuously.
static Foundation SpecialRailFoundation(Corner corner)
Returns the special rail foundation for single horizontal/vertical track.
static Slope InclinedSlope(DiagDirection dir)
Returns the slope that is inclined in a specific direction.
@ FOUNDATION_RAIL_W
Foundation for TRACK_BIT_LEFT, but not a leveled foundation.
@ SLOPE_HALFTILE_MASK
three bits used for halftile slopes
static bool IsFoundation(Foundation f)
Tests for FOUNDATION_NONE.
static bool IsHalftileSlope(Slope s)
Checks for non-continuous slope on halftile foundations.
static Slope RemoveHalftileSlope(Slope s)
Removes a halftile slope from a slope.
@ FOUNDATION_HALFTILE_W
Level west halftile non-continuously.
@ SLOPE_STEEP_S
a steep slope falling to north (from south)
static Corner GetHighestSlopeCorner(Slope s)
Returns the highest corner of a slope (one corner raised or a steep slope).
Foundation
Enumeration for Foundations.
static Foundation FlatteningFoundation(Slope s)
Returns the foundation needed to flatten a slope.
static uint SlopeToSpriteOffset(Slope s)
Returns the Sprite offset for a given Slope.
static bool IsInsideMM(const T x, const size_t min, const size_t max)
Checks if a value is in an interval.
@ SLOPE_NW
north and west corner are raised
static int GetSlopeMaxZ(Slope s)
Returns the height of the highest corner of a slope relative to TileZ (= minimal height)
@ FOUNDATION_INCLINED_Y
The tile has an along Y-axis inclined foundation.
static Slope SteepSlope(Corner corner)
Returns a specific steep slope.
static bool IsSteepSlope(Slope s)
Checks if a slope is steep.
@ FOUNDATION_STEEP_BOTH
The tile has a steep slope. The lowest corner is raised by a foundation and the upper halftile is lev...
@ SLOPE_ELEVATED
bit mask containing all 'simple' slopes
static bool IsSlopeWithThreeCornersRaised(Slope s)
Tests if a specific slope has exactly three corners raised.
static bool IsInclinedFoundation(Foundation f)
Tests if the foundation is an inclined foundation.
static bool HasSlopeHighestCorner(Slope s)
Tests if a slope has a highest corner (i.e.
const byte _slope_to_sprite_offset[32]
landscape slope => sprite
@ FOUNDATION_INCLINED_X
The tile has an along X-axis inclined foundation.
Corner
Enumeration of tile corners.
@ SLOPE_STEEP
indicates the slope is steep
static bool IsNonContinuousFoundation(Foundation f)
Tests if a foundation is a non-continuous foundation, i.e.
static Slope SlopeWithThreeCornersRaised(Corner corner)
Returns the slope with all except one corner raised.
@ INVALID_DIAGDIR
Flag for an invalid DiagDirection.
static Corner GetHalftileSlopeCorner(Slope s)
Returns the leveled halftile of a halftile slope.
@ FOUNDATION_NONE
The tile has no foundation, the slope remains unchanged.
@ SLOPE_SW
south and west corner are raised
@ SLOPE_STEEP_E
a steep slope falling to west (from east)
Slope
Enumeration for the slope-type.
DiagDirection
Enumeration for diagonal directions.
@ SLOPE_N
the north corner of the tile is raised
static bool IsValidCorner(Corner corner)
Rangecheck for Corner enumeration.
@ FOUNDATION_RAIL_N
Foundation for TRACK_BIT_UPPER, but not a leveled foundation.
static Slope SlopeWithOneCornerRaised(Corner corner)
Returns the slope with a specific corner raised.
static bool IsSpecialRailFoundation(Foundation f)
Tests if a foundation is a special rail foundation for single horizontal/vertical track.
static bool IsSlopeWithOneCornerRaised(Slope s)
Tests if a specific slope has exactly one corner raised.
static int GetSlopeMaxPixelZ(Slope s)
Returns the height of the highest corner of a slope relative to TileZ (= minimal height)
@ SLOPE_HALFTILE
one halftile is leveled (non continuous slope)
@ FOUNDATION_LEVELED
The tile is leveled up to a flat slope.
@ SLOPE_S
the south corner of the tile is raised
static Foundation HalftileFoundation(Corner corner)
Returns the halftile foundation for single horizontal/vertical track.
static Corner GetRailFoundationCorner(Foundation f)
Returns the track corner of a special rail foundation.
@ SLOPE_W
the west corner of the tile is raised
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
Axis
Allow incrementing of DiagDirDiff variables.
@ SLOPE_STEEP_W
a steep slope falling to east (from west)
static bool IsInclinedSlope(Slope s)
Tests if a specific slope is an inclined slope.
static Foundation InclinedFoundation(Axis axis)
Returns the along a specific axis inclined foundation.
static Slope HalftileSlope(Slope s, Corner corner)
Adds a halftile slope to a slope.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
@ SLOPE_SE
south and east corner are raised
@ SLOPE_NE
north and east corner are raised
static bool IsLeveledFoundation(Foundation f)
Tests if the foundation is a leveled foundation.
static Slope ComplementSlope(Slope s)
Return the complement of a slope.
static Corner GetHalftileFoundationCorner(Foundation f)
Returns the halftile corner of a halftile-foundation.
@ SLOPE_E
the east corner of the tile is raised
static DiagDirection GetInclinedSlopeDirection(Slope s)
Returns the direction of an inclined slope.
@ SLOPE_STEEP_N
a steep slope falling to south (from north)