summaryrefslogtreecommitdiff
path: root/clear.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-24 19:56:24 +0000
committertron <tron@openttd.org>2006-02-24 19:56:24 +0000
commitf6d48379d81925b45ea897cb2b05f65ac58e8a70 (patch)
tree37affcfcf1a07542085a0de7a63ee252119bb0fb /clear.h
parentf369dcef51e0cac4eacc4dcf9ec645ebfe5c5fd3 (diff)
downloadopenttd-f6d48379d81925b45ea897cb2b05f65ac58e8a70.tar.xz
(svn r3665) Add a function to turn a tile into a clear tile
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