Go to the documentation of this file.
40 int GetSlopePixelZ(
int x,
int y);
85 pt.x = (y - x) * 2 * ZOOM_LVL_BASE;
86 pt.y = (y + x - z) * ZOOM_LVL_BASE;
114 Point pt = {(y * 2 - x) >> (2 + ZOOM_LVL_SHIFT), (y * 2 + x) >> (2 + ZOOM_LVL_SHIFT)};
135 bool HasFoundationNW(
TileIndex tile,
Slope slope_here, uint z_here);
136 bool HasFoundationNE(
TileIndex tile,
Slope slope_here, uint z_here);
141 void InitializeLandscape();
Point InverseRemapCoords2(int x, int y, bool clamp_to_map=false, bool *clamped=nullptr)
Map 2D viewport or smallmap coordinate to 3D world or tile coordinate.
void DrawFoundation(TileInfo *ti, Foundation f)
Draw foundation f at tile ti.
uint32 TileIndex
The index/ID of a Tile.
uint ApplyFoundationToSlope(Foundation f, Slope *s)
Applies a foundation to a slope.
static const uint SNOW_LINE_DAYS
Number of days in each month in the snow line table.
void GenerateLandscape(byte mode)
Tile information, used while rendering the tile.
static Slope GetFoundationPixelSlope(TileIndex tile, int *z)
Get slope of a tile on top of a (possible) foundation If a tile does not have a foundation,...
byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]
Height of the snow line each day of the year.
static Point RemapCoords(int x, int y, int z)
Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap.
int GetSlopePixelZOutsideMap(int x, int y)
Return world z coordinate of a given point of a tile, also for tiles outside the map (virtual "black"...
static int GetSlopePixelZInCorner(Slope tileh, Corner corner)
Determine the Z height of a corner relative to TileZ.
Foundation
Enumeration for Foundations.
void GetSlopePixelZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2)
Determine the Z height of the corners of a specific tile edge.
byte GetSnowLine()
Get the current snow line, either variable or static.
static Point InverseRemapCoords(int x, int y)
Map 2D viewport or smallmap coordinate to 3D world or tile coordinate.
Corner
Enumeration of tile corners.
byte HighestSnowLine()
Get the highest possible snow line height, either variable or static.
Slope GetFoundationSlope(TileIndex tile, int *z=nullptr)
Get slope of a tile on top of a (possible) foundation If a tile does not have a foundation,...
byte LowestSnowLine()
Get the lowest possible snow line height, either variable or static.
uint GetPartialPixelZ(int x, int y, Slope corners)
Determines height at given coordinate of a slope.
Coordinates of a point in 2D.
Slope
Enumeration for the slope-type.
DiagDirection
Enumeration for diagonal directions.
Structure describing the height of the snow line each day of the year.
int GetSlopeZInCorner(Slope tileh, Corner corner)
Determine the Z height of a corner relative to TileZ.
void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS])
Set a variable snow line, as loaded from a newgrf file.
static uint ApplyPixelFoundationToSlope(Foundation f, Slope *s)
Applies a foundation to a slope.
byte lowest_value
Lowest snow line of the year.
byte highest_value
Highest snow line of the year.
bool IsSnowLineSet()
Has a snow line table already been loaded.
void RunTileLoop()
Gradually iterate over all tiles on the map, calling their TileLoopProcs once every 256 ticks.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
void ClearSnowLine()
Clear the variable snow line table and free the memory.
static Point RemapCoords2(int x, int y)
Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap.
static const uint SNOW_LINE_MONTHS
Number of months in the snow line table.