2007-03-20 13:47:00 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file landscape.h Functions related to OTTD's landscape. */
|
2007-03-20 13:47:00 +00:00
|
|
|
|
2007-04-12 13:07:15 +00:00
|
|
|
#ifndef LANDSCAPE_H
|
|
|
|
#define LANDSCAPE_H
|
|
|
|
|
2007-12-22 23:30:28 +00:00
|
|
|
#include "core/geometry_type.hpp"
|
2007-12-25 23:42:52 +00:00
|
|
|
#include "tile_cmd.h"
|
|
|
|
#include "slope_type.h"
|
|
|
|
#include "direction_type.h"
|
2007-12-21 22:50:51 +00:00
|
|
|
|
2007-03-20 13:47:00 +00:00
|
|
|
enum {
|
2008-10-19 15:39:12 +00:00
|
|
|
SNOW_LINE_MONTHS = 12, ///< Number of months in the snow line table.
|
|
|
|
SNOW_LINE_DAYS = 32, ///< Number of days in each month in the snow line table.
|
2007-03-20 13:47:00 +00:00
|
|
|
};
|
|
|
|
|
2008-10-19 15:39:12 +00:00
|
|
|
/** Structure describing the height of the snow line each day of the year
|
|
|
|
* @ingroup SnowLineGroup */
|
2007-03-20 13:47:00 +00:00
|
|
|
struct SnowLine {
|
2008-10-19 15:39:12 +00:00
|
|
|
byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]; ///< Height of the snow line each day of the year
|
|
|
|
byte highest_value; ///< Highest snow line of the year
|
2007-03-20 13:47:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
bool IsSnowLineSet(void);
|
|
|
|
void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]);
|
|
|
|
byte GetSnowLine(void);
|
|
|
|
byte HighestSnowLine(void);
|
|
|
|
void ClearSnowLine(void);
|
2007-04-12 13:07:15 +00:00
|
|
|
|
|
|
|
uint GetPartialZ(int x, int y, Slope corners);
|
|
|
|
uint GetSlopeZ(int x, int y);
|
2007-10-14 20:16:44 +00:00
|
|
|
void GetSlopeZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2);
|
2007-10-20 21:04:14 +00:00
|
|
|
int GetSlopeZInCorner(Slope tileh, Corner corner);
|
2008-01-22 17:48:08 +00:00
|
|
|
Slope GetFoundationSlope(TileIndex tile, uint* z);
|
2007-04-12 13:07:15 +00:00
|
|
|
|
|
|
|
static inline Point RemapCoords(int x, int y, int z)
|
|
|
|
{
|
|
|
|
Point pt;
|
|
|
|
pt.x = (y - x) * 2;
|
|
|
|
pt.y = y + x - z;
|
|
|
|
return pt;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline Point RemapCoords2(int x, int y)
|
|
|
|
{
|
|
|
|
return RemapCoords(x, y, GetSlopeZ(x, y));
|
|
|
|
}
|
|
|
|
|
2007-07-26 16:51:10 +00:00
|
|
|
uint ApplyFoundationToSlope(Foundation f, Slope *s);
|
|
|
|
void DrawFoundation(TileInfo *ti, Foundation f);
|
2007-04-12 13:07:15 +00:00
|
|
|
|
|
|
|
void DoClearSquare(TileIndex tile);
|
|
|
|
void RunTileLoop();
|
|
|
|
|
|
|
|
void InitializeLandscape();
|
|
|
|
void GenerateLandscape(byte mode);
|
|
|
|
|
|
|
|
TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng);
|
|
|
|
|
|
|
|
#endif /* LANDSCAPE_H */
|