summaryrefslogtreecommitdiff
path: root/clear.h
diff options
context:
space:
mode:
Diffstat (limited to 'clear.h')
-rw-r--r--clear.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/clear.h b/clear.h
index 856fb6e7b..819527d95 100644
--- a/clear.h
+++ b/clear.h
@@ -4,6 +4,7 @@
#define CLEAR_H
#include "macros.h"
+#include "tile.h"
/* ground type, m5 bits 2...4
* valid densities (bits 0...1) in comments after the enum
@@ -43,4 +44,15 @@ static inline void SetFenceSE(TileIndex t, uint h) { SB(_m[t].m4, 2, 3, h); }
static inline uint GetFenceSW(TileIndex t) { return GB(_m[t].m4, 5, 3); }
static inline void SetFenceSW(TileIndex t, uint h) { SB(_m[t].m4, 5, 3, h); }
+
+static inline void MakeClear(TileIndex t, ClearGround g, uint density)
+{
+ SetTileType(t, MP_CLEAR);
+ SetTileOwner(t, OWNER_NONE);
+ _m[t].m2 = 0;
+ _m[t].m3 = 0;
+ _m[t].m4 = 0 << 5 | 0 << 2;
+ _m[t].m5 = 0 << 5 | g << 2 | density;
+}
+
#endif