82 pt.x = (y - x) * 2 * ZOOM_BASE;
83 pt.y = (y + x - z) * ZOOM_BASE;
111 Point pt = {(y * 2 - x) >> (2 + ZOOM_BASE_SHIFT), (y * 2 + x) >> (2 + ZOOM_BASE_SHIFT)};
132 bool HasFoundationNW(
TileIndex tile,
Slope slope_here, uint z_here);
133 bool HasFoundationNE(
TileIndex tile,
Slope slope_here, uint z_here);
138 void InitializeLandscape();
DiagDirection
Enumeration for diagonal directions.
All geometry types in OpenTTD.
void SetSnowLine(uint8_t table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS])
Set a variable snow line, as loaded from a newgrf file.
uint8_t LowestSnowLine()
Get the lowest possible snow line height, either variable or static.
uint8_t GetSnowLine()
Get the current snow line, either variable or static.
bool IsSnowLineSet()
Has a snow line table already been loaded.
void ClearSnowLine()
Clear the variable snow line table and free the memory.
uint8_t HighestSnowLine()
Get the highest possible snow line height, either variable or static.
uint GetPartialPixelZ(int x, int y, Slope corners)
Determines height at given coordinate of a slope.
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"...
std::tuple< Slope, int > GetFoundationPixelSlope(TileIndex tile)
Get slope of a tile on top of a (possible) foundation If a tile does not have a foundation,...
void RunTileLoop()
Gradually iterate over all tiles on the map, calling their TileLoopProcs once every TILE_UPDATE_FREQU...
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.
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.
uint ApplyPixelFoundationToSlope(Foundation f, Slope &s)
Applies a foundation to a slope.
void DrawFoundation(TileInfo *ti, Foundation f)
Draw foundation f at tile ti.
int GetSlopeZInCorner(Slope tileh, Corner corner)
Determine the Z height of a corner relative to TileZ.
Point RemapCoords2(int x, int y)
Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap.
int GetSlopePixelZ(int x, int y, bool ground_vehicle=false)
Return world Z coordinate of a given point of a tile.
void GetSlopePixelZOnEdge(Slope tileh, DiagDirection edge, int &z1, int &z2)
Determine the Z height of the corners of a specific tile edge.
int GetSlopePixelZInCorner(Slope tileh, Corner corner)
Determine the Z height of a corner relative to TileZ.
static const uint SNOW_LINE_DAYS
Number of days in each month in the snow line table.
std::tuple< Slope, int > GetFoundationSlope(TileIndex tile)
Get slope of a tile on top of a (possible) foundation If a tile does not have a foundation,...
Point InverseRemapCoords(int x, int y)
Map 2D viewport or smallmap coordinate to 3D world or tile coordinate.
uint ApplyFoundationToSlope(Foundation f, Slope &s)
Applies a foundation to a slope.
static const uint SNOW_LINE_MONTHS
Number of months in the snow line table.
bool GenerateLandscape(uint8_t mode)
Slope
Enumeration for the slope-type.
Foundation
Enumeration for Foundations.
Corner
Enumeration of tile corners.
Coordinates of a point in 2D.
Structure describing the height of the snow line each day of the year.
uint8_t highest_value
Highest snow line of the year.
uint8_t lowest_value
Lowest snow line of the year.
uint8_t table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]
Height of the snow line each day of the year.
Tile information, used while rendering the tile.
Generic 'commands' that can be performed on all tiles.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_BASE.