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