maedhros@6343: /* $Id$ */ maedhros@6343: maedhros@6343: /** @file landscape.h */ maedhros@6343: maedhros@6453: #ifndef LANDSCAPE_H maedhros@6453: #define LANDSCAPE_H maedhros@6453: maedhros@6343: enum { maedhros@6343: SNOW_LINE_MONTHS = 12, maedhros@6343: SNOW_LINE_DAYS = 32, maedhros@6343: }; maedhros@6343: maedhros@6343: struct SnowLine { maedhros@6343: byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]; maedhros@6343: byte highest_value; maedhros@6343: }; maedhros@6343: maedhros@6343: bool IsSnowLineSet(void); maedhros@6343: void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]); maedhros@6343: byte GetSnowLine(void); maedhros@6343: byte HighestSnowLine(void); maedhros@6343: void ClearSnowLine(void); maedhros@6453: maedhros@6453: bool IsValidTile(TileIndex tile); maedhros@6453: maedhros@6453: uint GetPartialZ(int x, int y, Slope corners); maedhros@6453: uint GetSlopeZ(int x, int y); maedhros@6453: maedhros@6453: static inline Point RemapCoords(int x, int y, int z) maedhros@6453: { maedhros@6453: Point pt; maedhros@6453: pt.x = (y - x) * 2; maedhros@6453: pt.y = y + x - z; maedhros@6453: return pt; maedhros@6453: } maedhros@6453: maedhros@6453: static inline Point RemapCoords2(int x, int y) maedhros@6453: { maedhros@6453: return RemapCoords(x, y, GetSlopeZ(x, y)); maedhros@6453: } maedhros@6453: maedhros@6453: void DrawFoundation(TileInfo *ti, uint f); maedhros@6453: maedhros@6453: void DoClearSquare(TileIndex tile); maedhros@6453: void RunTileLoop(); maedhros@6453: maedhros@6453: uint32 GetTileTrackStatus(TileIndex tile, TransportType mode); maedhros@6453: void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac); maedhros@6453: void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player); maedhros@6453: void AnimateTile(TileIndex tile); maedhros@6453: void ClickTile(TileIndex tile); maedhros@6453: void GetTileDesc(TileIndex tile, TileDesc *td); maedhros@6453: maedhros@6453: void InitializeLandscape(); maedhros@6453: void GenerateLandscape(byte mode); maedhros@6453: maedhros@6453: void ConvertGroundTilesIntoWaterTiles(); maedhros@6453: maedhros@6453: TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng); maedhros@6453: maedhros@6453: #endif /* LANDSCAPE_H */