33 int hminnw =
min(hnorth, hwest);
34 int hmines =
min(heast, hsouth);
35 int hmin =
min(hminnw, hmines);
37 if (h != NULL) *h = hmin;
39 int hmaxnw =
max(hnorth, hwest);
40 int hmaxes =
max(heast, hsouth);
41 int hmax =
max(hmaxnw, hmaxes);
45 if (hnorth != hmin) r |=
SLOPE_N;
46 if (hwest != hmin) r |=
SLOPE_W;
47 if (heast != hmin) r |=
SLOPE_E;
48 if (hsouth != hmin) r |=
SLOPE_S;
63 uint x1 =
TileX(tile);
64 uint y1 =
TileY(tile);
104 uint x1 =
TileX(tile);
105 uint y1 =
TileY(tile);
114 if (h != NULL) *h = z;
125 uint x1 =
TileX(tile);
126 uint y1 =
TileY(tile);
the north corner of the tile is raised
the west corner of the tile is raised
Slope GetTilePixelSlopeOutsideMap(int x, int y, int *h)
Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles)...
static uint TileX(TileIndex tile)
Get the X component of a tile.
the east corner of the tile is raised
static T max(const T a, const T b)
Returns the maximum of two values.
bool IsTileFlat(TileIndex tile, int *h)
Check if a given tile is flat.
int GetTileZ(TileIndex tile)
Get bottom height of the tile.
static Slope GetTileSlopeGivenHeight(int hnorth, int hwest, int heast, int hsouth, int *h)
Get a tile's slope given the heigh of its four corners.
Slope GetTileSlope(TileIndex tile, int *h)
Return the slope of a given tile inside the map.
indicates the slope is steep
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
static T min(const T a, const T b)
Returns the minimum of two values.
int GetTileMaxZ(TileIndex t)
Get top height of the tile inside the map.
uint32 TileIndex
The index/ID of a Tile.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
Slope
Enumeration for the slope-type.
static uint MapMaxY()
Gets the maximum Y coordinate within the map, including MP_VOID.
static uint TileHeight(TileIndex tile)
Returns the height of a tile.
static uint TileHeightOutsideMap(int x, int y)
Returns the height of a tile, also for tiles outside the map (virtual "black" tiles).
static uint MapMaxX()
Gets the maximum X coordinate within the map, including MP_VOID.
Map writing/reading functions for tiles.
the south corner of the tile is raised
static TileIndex TileXY(uint x, uint y)
Returns the TileIndex of a coordinate.