bridge_map.h
branchcustombridgeheads
changeset 5601 51f241d43769
parent 5600 bac9ab186cab
child 5632 025c3b25f1fd
equal deleted inserted replaced
5600:bac9ab186cab 5601:51f241d43769
    10 #include "road_map.h"
    10 #include "road_map.h"
    11 #include "tile.h"
    11 #include "tile.h"
    12 
    12 
    13 
    13 
    14 void DrawBridgeMiddle(const TileInfo* ti); // XXX
    14 void DrawBridgeMiddle(const TileInfo* ti); // XXX
       
    15 
       
    16 #define M(x) (1 << (x))
       
    17 enum {
       
    18 	// foundation, whole tile is leveled up --> 3 corners raised
       
    19 	BRIDGE_FULL_LEVELED_FOUNDATION = M(SLOPE_WSE) | M(SLOPE_NWS) | M(SLOPE_ENW) | M(SLOPE_SEN),
       
    20 	// foundation, tile is partly leveled up --> 1 corner raised
       
    21 	BRIDGE_PARTLY_LEVELED_FOUNDATION = M(SLOPE_W) | M(SLOPE_S) | M(SLOPE_E) | M(SLOPE_N),
       
    22 	// no foundations (X,Y direction)
       
    23 	BRIDGE_NO_FOUNDATION = M(SLOPE_FLAT) | M(SLOPE_SW) | M(SLOPE_SE) | M(SLOPE_NW) | M(SLOPE_NE),
       
    24 	BRIDGE_HORZ_RAMP = (BRIDGE_PARTLY_LEVELED_FOUNDATION | BRIDGE_NO_FOUNDATION) & ~M(SLOPE_FLAT)
       
    25 };
       
    26 #undef M
    15 
    27 
    16 
    28 
    17 static inline bool IsBridgeTile(TileIndex t)
    29 static inline bool IsBridgeTile(TileIndex t)
    18 {
    30 {
    19 	return IsTileType(t, MP_STREET_BRIDGE) || IsTileType(t, MP_RAILWAY_BRIDGE);
    31 	return IsTileType(t, MP_STREET_BRIDGE) || IsTileType(t, MP_RAILWAY_BRIDGE);