104 return (
Slope)(1 << corner);
139 default: NOT_REACHED();
153 return (
Corner)((s >> 6) & 3);
188 return (
Corner)(corner ^ 2);
265 default: NOT_REACHED();
420 return _slope_to_sprite_offset[s];
static bool HasSlopeHighestCorner(Slope s)
Tests if a slope has a highest corner (i.e.
static bool IsHalftileSlope(Slope s)
Checks for non-continuous slope on halftile foundations.
the north corner of the tile is raised
Corner
Enumeration of tile corners.
Different types to 'show' directions.
south and east corner are raised
the west corner of the tile is raised
Flag for an invalid DiagDirection.
static Corner GetHalftileFoundationCorner(Foundation f)
Returns the halftile corner of a halftile-foundation.
static bool IsInsideMM(const T x, const uint min, const uint max)
Checks if a value is in an interval.
const byte _slope_to_sprite_offset[32]
landscape slope => sprite
static Foundation HalftileFoundation(Corner corner)
Returns the halftile foundation for single horizontal/vertical track.
static bool IsValidCorner(Corner corner)
Rangecheck for Corner enumeration.
static bool IsFoundation(Foundation f)
Tests for FOUNDATION_NONE.
static int GetSlopeMaxZ(Slope s)
Returns the height of the highest corner of a slope relative to TileZ (= minimal height) ...
the east corner of the tile is raised
Northeast, upper right on your monitor.
static bool IsSteepSlope(Slope s)
Checks if a slope is steep.
static Corner GetHalftileSlopeCorner(Slope s)
Returns the leveled halftile of a halftile slope.
south and west corner are raised
static Slope SlopeWithOneCornerRaised(Corner corner)
Returns the slope with a specific corner raised.
static bool IsInclinedSlope(Slope s)
Tests if a specific slope is an inclined slope.
static Corner GetHighestSlopeCorner(Slope s)
Returns the highest corner of a slope (one corner raised or a steep slope).
north and east corner are raised
static Foundation SpecialRailFoundation(Corner corner)
Returns the special rail foundation for single horizontal/vertical track.
static Slope SteepSlope(Corner corner)
Returns a specific steep slope.
indicates the slope is steep
static Slope ComplementSlope(Slope s)
Return the complement of a slope.
Foundation
Enumeration for Foundations.
Foundation for TRACK_BIT_UPPER, but not a leveled foundation.
The tile is leveled up to a flat slope.
Level north halftile non-continuously.
Foundation for TRACK_BIT_LEFT, but not a leveled foundation.
one halftile is leveled (non continuous slope)
The tile has an along Y-axis inclined foundation.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
static bool IsSlopeWithOneCornerRaised(Slope s)
Tests if a specific slope has exactly one corner raised.
static Slope SlopeWithThreeCornersRaised(Corner corner)
Returns the slope with all except one corner raised.
DiagDirection
Enumeration for diagonal directions.
bit mask containing all 'simple' slopes
static Foundation FlatteningFoundation(Slope s)
Returns the foundation needed to flatten a slope.
The tile has a steep slope. The lowest corner is raised by a foundation and the upper halftile is lev...
static DiagDirection GetInclinedSlopeDirection(Slope s)
Returns the direction of an inclined slope.
a steep slope falling to east (from west)
static Slope RemoveHalftileSlope(Slope s)
Removes a halftile slope from a slope.
static int GetSlopeMaxPixelZ(Slope s)
Returns the height of the highest corner of a slope relative to TileZ (= minimal height) ...
static Slope InclinedSlope(DiagDirection dir)
Returns the slope that is inclined in a specific direction.
static bool IsSlopeWithThreeCornersRaised(Slope s)
Tests if a specific slope has exactly three corners raised.
static Corner GetRailFoundationCorner(Foundation f)
Returns the track corner of a special rail foundation.
north and west corner are raised
The tile has no foundation, the slope remains unchanged.
The tile has an along X-axis inclined foundation.
static bool IsLeveledFoundation(Foundation f)
Tests if the foundation is a leveled foundation.
Slope
Enumeration for the slope-type.
a steep slope falling to south (from north)
static uint SlopeToSpriteOffset(Slope s)
Returns the Sprite offset for a given 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.
static bool IsInclinedFoundation(Foundation f)
Tests if the foundation is an inclined foundation.
a steep slope falling to west (from east)
static bool IsNonContinuousFoundation(Foundation f)
Tests if a foundation is a non-continuous foundation, i.e.
three bits used for halftile slopes
the south corner of the tile is raised
Level west halftile non-continuously.
static bool IsSpecialRailFoundation(Foundation f)
Tests if a foundation is a special rail foundation for single horizontal/vertical track...
Axis
Allow incrementing of DiagDirDiff variables.
static Corner OppositeCorner(Corner corner)
Returns the opposite corner.
a steep slope falling to north (from south)