(svn r3665) Add a function to turn a tile into a clear tile

This commit is contained in:
tron
2006-02-24 19:56:24 +00:00
parent f369dcef51
commit f6d48379d8
4 changed files with 18 additions and 19 deletions

12
clear.h
View File

@@ -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