maedhros@6669: /* $Id$ */ maedhros@6669: maedhros@6669: /** @file landscape.h */ maedhros@6669: maedhros@6949: #ifndef LANDSCAPE_H maedhros@6949: #define LANDSCAPE_H maedhros@6949: rubidium@8615: #include "gfx.h" rubidium@8615: maedhros@6669: enum { maedhros@6669: SNOW_LINE_MONTHS = 12, maedhros@6669: SNOW_LINE_DAYS = 32, maedhros@6669: }; maedhros@6669: maedhros@6669: struct SnowLine { maedhros@6669: byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]; maedhros@6669: byte highest_value; maedhros@6669: }; maedhros@6669: maedhros@6669: bool IsSnowLineSet(void); maedhros@6669: void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]); maedhros@6669: byte GetSnowLine(void); maedhros@6669: byte HighestSnowLine(void); maedhros@6669: void ClearSnowLine(void); maedhros@6949: maedhros@6949: bool IsValidTile(TileIndex tile); maedhros@6949: maedhros@6949: uint GetPartialZ(int x, int y, Slope corners); maedhros@6949: uint GetSlopeZ(int x, int y); rubidium@8224: void GetSlopeZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2); rubidium@8266: int GetSlopeZInCorner(Slope tileh, Corner corner); maedhros@6949: maedhros@6949: static inline Point RemapCoords(int x, int y, int z) maedhros@6949: { maedhros@6949: Point pt; maedhros@6949: pt.x = (y - x) * 2; maedhros@6949: pt.y = y + x - z; maedhros@6949: return pt; maedhros@6949: } maedhros@6949: maedhros@6949: static inline Point RemapCoords2(int x, int y) maedhros@6949: { maedhros@6949: return RemapCoords(x, y, GetSlopeZ(x, y)); maedhros@6949: } maedhros@6949: rubidium@7831: uint ApplyFoundationToSlope(Foundation f, Slope *s); rubidium@7831: void DrawFoundation(TileInfo *ti, Foundation f); maedhros@6949: maedhros@6949: void DoClearSquare(TileIndex tile); maedhros@6949: void RunTileLoop(); maedhros@6949: maedhros@6949: void InitializeLandscape(); maedhros@6949: void GenerateLandscape(byte mode); maedhros@6949: maedhros@6949: void ConvertGroundTilesIntoWaterTiles(); maedhros@6949: maedhros@6949: TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng); maedhros@6949: maedhros@6949: #endif /* LANDSCAPE_H */