(svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces

This commit is contained in:
tron
2006-02-23 08:20:28 +00:00
parent d239ec0e96
commit 2f8e3dcc05
5 changed files with 108 additions and 80 deletions

34
road.h Normal file
View File

@@ -0,0 +1,34 @@
/* $Id$ */
#ifndef ROAD_H
#define ROAD_H
#include "macros.h"
typedef enum RoadBits {
ROAD_NW = 1,
ROAD_SW = 2,
ROAD_SE = 4,
ROAD_NE = 8,
ROAD_X = ROAD_SW | ROAD_NE,
ROAD_Y = ROAD_NW | ROAD_SE,
ROAD_ALL = ROAD_X | ROAD_Y
} RoadBits;
static inline RoadBits GetRoadBits(TileIndex tile)
{
return GB(_m[tile].m5, 0, 4);
}
typedef enum RoadType {
ROAD_NORMAL,
ROAD_CROSSING,
ROAD_DEPOT
} RoadType;
static inline RoadType GetRoadType(TileIndex tile)
{
return GB(_m[tile].m5, 4, 4);
}
#endif