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