landscape.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef LANDSCAPE_H
00013 #define LANDSCAPE_H
00014
00015 #include "core/geometry_type.hpp"
00016 #include "tile_cmd.h"
00017
00018 enum {
00019 SNOW_LINE_MONTHS = 12,
00020 SNOW_LINE_DAYS = 32,
00021 };
00022
00025 struct SnowLine {
00026 byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS];
00027 byte highest_value;
00028 byte lowest_value;
00029 };
00030
00031 bool IsSnowLineSet();
00032 void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]);
00033 byte GetSnowLine();
00034 byte HighestSnowLine();
00035 byte LowestSnowLine();
00036 void ClearSnowLine();
00037
00038 uint GetPartialZ(int x, int y, Slope corners);
00039 uint GetSlopeZ(int x, int y);
00040 void GetSlopeZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2);
00041 int GetSlopeZInCorner(Slope tileh, Corner corner);
00042 Slope GetFoundationSlope(TileIndex tile, uint *z);
00043
00044 static inline Point RemapCoords(int x, int y, int z)
00045 {
00046 Point pt;
00047 pt.x = (y - x) * 2;
00048 pt.y = y + x - z;
00049 return pt;
00050 }
00051
00052 static inline Point RemapCoords2(int x, int y)
00053 {
00054 return RemapCoords(x, y, GetSlopeZ(x, y));
00055 }
00056
00057 uint ApplyFoundationToSlope(Foundation f, Slope *s);
00058 void DrawFoundation(TileInfo *ti, Foundation f);
00059 bool HasFoundationNW(TileIndex tile, Slope slope_here, uint z_here);
00060 bool HasFoundationNE(TileIndex tile, Slope slope_here, uint z_here);
00061
00062 void DoClearSquare(TileIndex tile);
00063 void RunTileLoop();
00064
00065 void InitializeLandscape();
00066 void GenerateLandscape(byte mode);
00067
00068 #endif