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