#ifndef TILE_H
#define TILE_H
#include "macros.h"
#include "map.h"
typedef enum TileType {
MP_CLEAR,
MP_RAILWAY,
MP_STREET,
@@ -20,12 +21,19 @@ typedef enum TileType {
void SetMapExtraBits(TileIndex tile, byte flags);
uint GetMapExtraBits(TileIndex tile);
uint GetTileSlope(TileIndex tile, uint *h);
uint GetTileZ(TileIndex tile);
static inline bool CorrectZ(uint tileh)
{
/* tile height must be corrected if the north corner is not raised, but
* any other corner is. These are the cases 1 till 7 */
return IS_INT_INSIDE(tileh, 1, 8);
}
static inline uint TileHeight(TileIndex tile)
assert(tile < MapSize());
return _map_type_and_height[tile] & 0xf;