landscape.h

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

Generated on Sun Sep 13 08:19:16 2009 for OpenTTD by  doxygen 1.5.6