OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
31 int hminnw = std::min(hnorth, hwest);
32 int hmines = std::min(heast, hsouth);
33 int hmin = std::min(hminnw, hmines);
35 if (h !=
nullptr) *h = hmin;
37 int hmaxnw = std::max(hnorth, hwest);
38 int hmaxes = std::max(heast, hsouth);
39 int hmax = std::max(hmaxnw, hmaxes);
43 if (hnorth != hmin) r |=
SLOPE_N;
44 if (hwest != hmin) r |=
SLOPE_W;
45 if (heast != hmin) r |=
SLOPE_E;
46 if (hsouth != hmin) r |=
SLOPE_S;
61 uint x1 =
TileX(tile);
62 uint y1 =
TileY(tile);
63 uint x2 = std::min(x1 + 1,
MapMaxX());
64 uint y2 = std::min(y1 + 1,
MapMaxY());
102 uint x1 =
TileX(tile);
103 uint y1 =
TileY(tile);
104 uint x2 = std::min(x1 + 1,
MapMaxX());
105 uint y2 = std::min(y1 + 1,
MapMaxY());
112 if (h !=
nullptr) *h = z;
123 uint x1 =
TileX(tile);
124 uint y1 =
TileY(tile);
125 uint x2 = std::min(x1 + 1,
MapMaxX());
126 uint y2 = std::min(y1 + 1,
MapMaxY());
145 uint x2 = std::min(x1 + 1,
MapMaxX());
146 uint y2 = std::min(y1 + 1,
MapMaxY());
bool IsTileFlat(TileIndex tile, int *h)
Check if a given tile is flat.
uint32 TileIndex
The index/ID of a Tile.
int GetTileMaxZ(TileIndex t)
Get top height of the tile inside the map.
Slope GetTilePixelSlopeOutsideMap(int x, int y, int *h)
Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles).
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.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
static uint TileX(TileIndex tile)
Get the X component of a tile.
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).
@ SLOPE_STEEP
indicates the slope is steep
Slope GetTileSlope(TileIndex tile, int *h)
Return the slope of a given tile inside the map.
Slope
Enumeration for the slope-type.
@ SLOPE_N
the north corner of the tile is raised
static uint MapMaxY()
Gets the maximum Y coordinate within the map, including MP_VOID.
static TileIndex TileXY(uint x, uint y)
Returns the TileIndex of a coordinate.
@ SLOPE_S
the south corner of the tile is raised
static uint MapMaxX()
Gets the maximum X coordinate within the map, including MP_VOID.
@ SLOPE_W
the west corner of the tile is raised
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
@ SLOPE_E
the east corner of the tile is raised