24 TROPICZONE_INVALID = 0, |
25 TROPICZONE_INVALID = 0, |
25 TROPICZONE_DESERT = 1, |
26 TROPICZONE_DESERT = 1, |
26 TROPICZONE_RAINFOREST = 2, |
27 TROPICZONE_RAINFOREST = 2, |
27 } TropicZone; |
28 } TropicZone; |
28 |
29 |
29 uint GetTileh(uint n, uint w, uint e, uint s, uint *h); |
30 Slope GetTileh(uint n, uint w, uint e, uint s, uint *h); |
30 uint GetTileSlope(TileIndex tile, uint *h); |
31 Slope GetTileSlope(TileIndex tile, uint *h); |
31 uint GetTileZ(TileIndex tile); |
32 uint GetTileZ(TileIndex tile); |
32 |
33 |
33 static inline bool CorrectZ(uint tileh) |
34 static inline bool CorrectZ(Slope tileh) |
34 { |
35 { |
35 /* tile height must be corrected if the north corner is not raised, but |
36 /* tile height must be corrected if the north corner is not raised, but |
36 * any other corner is. These are the cases 1 till 7 */ |
37 * any other corner is. These are the cases 1 till 7 */ |
37 return IS_INT_INSIDE(tileh, 1, 8); |
38 return IS_INT_INSIDE(tileh, 1, 8); |
38 } |
39 } |
39 |
40 |
40 static inline uint TileHeight(TileIndex tile) |
41 static inline uint TileHeight(TileIndex tile) |
41 { |
42 { |
42 assert(tile < MapSize()); |
43 assert(tile < MapSize()); |
43 return GB(_m[tile].type_height, 0, 4); |
44 return GB(_m[tile].type_height, 0, 4); |
44 } |
|
45 |
|
46 static inline bool IsSteepTileh(uint tileh) |
|
47 { |
|
48 return (tileh & 0x10); |
|
49 } |
45 } |
50 |
46 |
51 static inline void SetTileHeight(TileIndex tile, uint height) |
47 static inline void SetTileHeight(TileIndex tile, uint height) |
52 { |
48 { |
53 assert(tile < MapSize()); |
49 assert(tile < MapSize()); |