diff options
author | tron <tron@openttd.org> | 2006-02-23 08:20:28 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-23 08:20:28 +0000 |
commit | df156dacb21b1a1ae09bf498340358cbe5de33fa (patch) | |
tree | 902fe3272275a4a3b554d21b247e7f5811687ebe /road.h | |
parent | b79872366debb336f43621f4d00d72d3fa3ac889 (diff) | |
download | openttd-df156dacb21b1a1ae09bf498340358cbe5de33fa.tar.xz |
(svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
Diffstat (limited to 'road.h')
-rw-r--r-- | road.h | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -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 |