road_map.h
changeset 4000 4009d092b306
parent 3900 2c84ed52709d
child 4045 9eda219bc134
equal deleted inserted replaced
3999:69dfaadb5c3c 4000:4009d092b306
    16 } RoadTileType;
    16 } RoadTileType;
    17 
    17 
    18 static inline RoadTileType GetRoadTileType(TileIndex t)
    18 static inline RoadTileType GetRoadTileType(TileIndex t)
    19 {
    19 {
    20 	assert(IsTileType(t, MP_STREET));
    20 	assert(IsTileType(t, MP_STREET));
    21 	return (RoadTileType)(GB(_m[t].m5, 4, 4));
    21 	return (RoadTileType)GB(_m[t].m5, 4, 4);
    22 }
    22 }
    23 
    23 
    24 static inline bool IsLevelCrossing(TileIndex t)
    24 static inline bool IsLevelCrossing(TileIndex t)
    25 {
    25 {
    26 	return GetRoadTileType(t) == ROAD_TILE_CROSSING;
    26 	return GetRoadTileType(t) == ROAD_TILE_CROSSING;
    32 }
    32 }
    33 
    33 
    34 static inline RoadBits GetRoadBits(TileIndex t)
    34 static inline RoadBits GetRoadBits(TileIndex t)
    35 {
    35 {
    36 	assert(GetRoadTileType(t) == ROAD_TILE_NORMAL);
    36 	assert(GetRoadTileType(t) == ROAD_TILE_NORMAL);
    37 	return (RoadBits)(GB(_m[t].m5, 0, 4));
    37 	return (RoadBits)GB(_m[t].m5, 0, 4);
    38 }
    38 }
    39 
    39 
    40 static inline void SetRoadBits(TileIndex t, RoadBits r)
    40 static inline void SetRoadBits(TileIndex t, RoadBits r)
    41 {
    41 {
    42 	assert(GetRoadTileType(t) == ROAD_TILE_NORMAL); // XXX incomplete
    42 	assert(GetRoadTileType(t) == ROAD_TILE_NORMAL); // XXX incomplete