# landscape.h

Go to the documentation of this file.

    00001 /* $Id: landscape.h 14949 2009-01-10 00:31:47Z rubidium $ */
    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 };
    00024
    00025 bool IsSnowLineSet(void);
    00026 void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]);
    00027 byte GetSnowLine(void);
    00028 byte HighestSnowLine(void);
    00029 void ClearSnowLine(void);
    00030
    00031 uint GetPartialZ(int x, int y, Slope corners);
    00032 uint GetSlopeZ(int x, int y);
    00033 void GetSlopeZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2);
    00034 int GetSlopeZInCorner(Slope tileh, Corner corner);
    00035 Slope GetFoundationSlope(TileIndex tile, uint *z);
    00036
    00037 static inline Point RemapCoords(int x, int y, int z)
    00038 {
    00039   Point pt;
    00040   pt.x = (y - x) * 2;
    00041   pt.y = y + x - z;
    00042   return pt;
    00043 }
    00044
    00045 static inline Point RemapCoords2(int x, int y)
    00046 {
    00047   return RemapCoords(x, y, GetSlopeZ(x, y));
    00048 }
    00049
    00050 uint ApplyFoundationToSlope(Foundation f, Slope *s);
    00051 void DrawFoundation(TileInfo *ti, Foundation f);
    00052
    00053 void DoClearSquare(TileIndex tile);
    00054 void RunTileLoop();
    00055
    00056 void InitializeLandscape();
    00057 void GenerateLandscape(byte mode);
    00058
    00059 TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng);
    00060
    00061 #endif /* LANDSCAPE_H */