|
OpenTTD Source
14.0-beta3
|
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();
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.
@ FOUNDATION_HALFTILE_N
Level north halftile non-continuously.
@ SLOPE_STEEP_E
a steep slope falling to west (from east)
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.
@ SLOPE_STEEP_S
a steep slope falling to north (from south)
@ 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.
Axis
Allow incrementing of DiagDirDiff variables.
@ SLOPE_NW
north and west 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.
@ SLOPE_ELEVATED
bit mask containing all 'simple' slopes
static constexpr bool IsSteepSlope(Slope s)
Checks if a slope is steep.
@ FOUNDATION_HALFTILE_W
Level west halftile non-continuously.
@ SLOPE_S
the south corner of the tile is raised
static constexpr Corner GetHalftileSlopeCorner(Slope s)
Returns the leveled halftile of a halftile slope.
@ SLOPE_E
the east corner of the tile is raised
Foundation
Enumeration for Foundations.
Slope SlopeWithThreeCornersRaised(Corner corner)
Returns the slope with all except one corner raised.
Slope ComplementSlope(Slope s)
Return the complement of a slope.
@ SLOPE_HALFTILE
one halftile is leveled (non continuous slope)
Slope
Enumeration for the slope-type.
@ 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)
@ SLOPE_NE
north and east corner are raised
static constexpr int GetSlopeMaxZ(Slope s)
Returns the height of the highest corner of a slope relative to TileZ (= minimal height)
const byte _slope_to_sprite_offset[32]
landscape slope => sprite
@ 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.
@ INVALID_DIAGDIR
Flag for an invalid DiagDirection.
@ FOUNDATION_NONE
The tile has no foundation, the slope remains unchanged.
Corner GetHalftileFoundationCorner(Foundation f)
Returns the halftile corner of a halftile-foundation.
DiagDirection
Enumeration for diagonal directions.
@ SLOPE_HALFTILE_MASK
three bits used for halftile slopes
@ SLOPE_W
the west corner of the tile is raised
@ FOUNDATION_RAIL_N
Foundation for TRACK_BIT_UPPER, but not a leveled foundation.
@ SLOPE_N
the north corner of the tile is raised
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).
@ SLOPE_SW
south and west corner are raised
bool IsLeveledFoundation(Foundation f)
Tests if the foundation is a leveled foundation.
@ FOUNDATION_LEVELED
The tile is leveled up to a flat slope.
Corner GetRailFoundationCorner(Foundation f)
Returns the track corner of a special rail foundation.
bool IsInclinedFoundation(Foundation f)
Tests if the foundation is an inclined foundation.
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_LVL_BASE.
@ SLOPE_STEEP_W
a steep slope falling to east (from west)
Slope SlopeWithOneCornerRaised(Corner corner)
Returns the slope with a specific corner raised.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
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
indicates the slope is steep
@ SLOPE_STEEP_N
a steep slope falling to south (from north)
Corner OppositeCorner(Corner corner)
Returns the opposite corner.