diff options
author | tron <tron@openttd.org> | 2006-02-24 19:56:24 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-24 19:56:24 +0000 |
commit | 3cde68077ef40b62836f005c618ab58576206fed (patch) | |
tree | 37affcfcf1a07542085a0de7a63ee252119bb0fb /clear.h | |
parent | 6b7d4721bd3e769ae27efc569eadf72ad5212d59 (diff) | |
download | openttd-3cde68077ef40b62836f005c618ab58576206fed.tar.xz |
(svn r3665) Add a function to turn a tile into a clear tile
Diffstat (limited to 'clear.h')
-rw-r--r-- | clear.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |