|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
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.
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.
Tile information, used while rendering the tile.
byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]
Height of the snow line each day of the year.
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"...
bool GenerateLandscape(byte mode)
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,...
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.
Slope
Enumeration for the slope-type.
byte GetSnowLine()
Get the current snow line, either variable or static.
Corner
Enumeration of tile corners.
byte HighestSnowLine()
Get the highest possible snow line height, either variable or static.
int GetSlopePixelZ(int x, int y, bool ground_vehicle=false)
Return world Z coordinate of a given point of a tile.
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.
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.
byte lowest_value
Lowest snow line of the year.
Point RemapCoords2(int x, int y)
Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap.
byte highest_value
Highest snow line of the year.
int GetSlopePixelZInCorner(Slope tileh, Corner corner)
Determine the Z height of a corner relative to TileZ.
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.
Point InverseRemapCoords(int x, int y)
Map 2D viewport or smallmap coordinate to 3D world or tile coordinate.
uint ApplyPixelFoundationToSlope(Foundation f, Slope *s)
Applies a foundation to a slope.
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.
static const uint SNOW_LINE_MONTHS
Number of months in the snow line table.