summaryrefslogtreecommitdiff
path: root/clear.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-05 11:54:25 +0000
committertron <tron@openttd.org>2006-02-05 11:54:25 +0000
commit6132fcea4439d418dffde7908a5bbb128d170dba (patch)
treec7a09d7266b5f144783c8a0eda92f86dcaa8610b /clear.h
parent02c4e63fac1dd9e017d5d308527054bcd66f6f06 (diff)
downloadopenttd-6132fcea4439d418dffde7908a5bbb128d170dba.tar.xz
(svn r3554) Add accessors for the field type and fences of clear tiles
Diffstat (limited to 'clear.h')
-rw-r--r--clear.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/clear.h b/clear.h
index 4eb1c5f80..856fb6e7b 100644
--- a/clear.h
+++ b/clear.h
@@ -33,4 +33,14 @@ static inline void SetClearGroundDensity(TileIndex t, ClearGround type, uint den
_m[t].m5 = 0 << 5 | type << 2 | density;
}
+static inline uint GetFieldType(TileIndex t) { return GB(_m[t].m3, 0, 4); }
+static inline void SetFieldType(TileIndex t, uint f) { SB(_m[t].m3, 0, 4, f); }
+
+/* Is used by tree tiles, too */
+static inline uint GetFenceSE(TileIndex t) { return GB(_m[t].m4, 2, 3); }
+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); }
+
#endif