author | rubidium |
Sun, 03 Feb 2008 20:17:54 +0000 | |
branch | noai |
changeset 9724 | b39bc69bb2f2 |
parent 9723 | eee46cb39750 |
child 9800 | ab08ca2a2018 |
permissions | -rw-r--r-- |
9505 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file landscape.h */ |
|
4 |
||
9599 | 5 |
#ifndef LANDSCAPE_H |
6 |
#define LANDSCAPE_H |
|
7 |
||
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
8 |
#include "core/geometry_type.hpp" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
9 |
#include "tile_cmd.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
10 |
#include "slope_type.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
11 |
#include "direction_type.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9722
diff
changeset
|
12 |
|
9505 | 13 |
enum { |
14 |
SNOW_LINE_MONTHS = 12, |
|
15 |
SNOW_LINE_DAYS = 32, |
|
16 |
}; |
|
17 |
||
18 |
struct SnowLine { |
|
19 |
byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]; |
|
20 |
byte highest_value; |
|
21 |
}; |
|
22 |
||
23 |
bool IsSnowLineSet(void); |
|
24 |
void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]); |
|
25 |
byte GetSnowLine(void); |
|
26 |
byte HighestSnowLine(void); |
|
27 |
void ClearSnowLine(void); |
|
9599 | 28 |
|
29 |
bool IsValidTile(TileIndex tile); |
|
30 |
||
31 |
uint GetPartialZ(int x, int y, Slope corners); |
|
32 |
uint GetSlopeZ(int x, int y); |
|
9718
f82a4facea8b
(svn r11309) [NoAI] -Sync: with trunk r11145:11308.
truelight
parents:
9694
diff
changeset
|
33 |
void GetSlopeZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2); |
9722
ebf0ece7d8f6
(svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents:
9718
diff
changeset
|
34 |
int GetSlopeZInCorner(Slope tileh, Corner corner); |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
35 |
Slope GetFoundationSlope(TileIndex tile, uint* z); |
9599 | 36 |
|
37 |
static inline Point RemapCoords(int x, int y, int z) |
|
38 |
{ |
|
39 |
Point pt; |
|
40 |
pt.x = (y - x) * 2; |
|
41 |
pt.y = y + x - z; |
|
42 |
return pt; |
|
43 |
} |
|
44 |
||
45 |
static inline Point RemapCoords2(int x, int y) |
|
46 |
{ |
|
47 |
return RemapCoords(x, y, GetSlopeZ(x, y)); |
|
48 |
} |
|
49 |
||
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9624
diff
changeset
|
50 |
uint ApplyFoundationToSlope(Foundation f, Slope *s); |
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9624
diff
changeset
|
51 |
void DrawFoundation(TileInfo *ti, Foundation f); |
9599 | 52 |
|
53 |
void DoClearSquare(TileIndex tile); |
|
54 |
void RunTileLoop(); |
|
55 |
||
56 |
void InitializeLandscape(); |
|
57 |
void GenerateLandscape(byte mode); |
|
58 |
||
59 |
TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng); |
|
60 |
||
61 |
#endif /* LANDSCAPE_H */ |