equal
deleted
inserted
replaced
2 |
2 |
3 #ifndef CLEAR_H |
3 #ifndef CLEAR_H |
4 #define CLEAR_H |
4 #define CLEAR_H |
5 |
5 |
6 #include "macros.h" |
6 #include "macros.h" |
|
7 #include "tile.h" |
7 |
8 |
8 /* ground type, m5 bits 2...4 |
9 /* ground type, m5 bits 2...4 |
9 * valid densities (bits 0...1) in comments after the enum |
10 * valid densities (bits 0...1) in comments after the enum |
10 */ |
11 */ |
11 typedef enum ClearGround { |
12 typedef enum ClearGround { |
41 static inline void SetFenceSE(TileIndex t, uint h) { SB(_m[t].m4, 2, 3, h); } |
42 static inline void SetFenceSE(TileIndex t, uint h) { SB(_m[t].m4, 2, 3, h); } |
42 |
43 |
43 static inline uint GetFenceSW(TileIndex t) { return GB(_m[t].m4, 5, 3); } |
44 static inline uint GetFenceSW(TileIndex t) { return GB(_m[t].m4, 5, 3); } |
44 static inline void SetFenceSW(TileIndex t, uint h) { SB(_m[t].m4, 5, 3, h); } |
45 static inline void SetFenceSW(TileIndex t, uint h) { SB(_m[t].m4, 5, 3, h); } |
45 |
46 |
|
47 |
|
48 static inline void MakeClear(TileIndex t, ClearGround g, uint density) |
|
49 { |
|
50 SetTileType(t, MP_CLEAR); |
|
51 SetTileOwner(t, OWNER_NONE); |
|
52 _m[t].m2 = 0; |
|
53 _m[t].m3 = 0; |
|
54 _m[t].m4 = 0 << 5 | 0 << 2; |
|
55 _m[t].m5 = 0 << 5 | g << 2 | density; |
|
56 } |
|
57 |
46 #endif |
58 #endif |