src/tunnelbridge_cmd.cpp
branchcpp_gui
changeset 6254 abc6ad7c035c
parent 6253 23983700e3d7
child 6268 4b5241e5dd10
equal deleted inserted replaced
6253:23983700e3d7 6254:abc6ad7c035c
    75 		x -= n;
    75 		x -= n;
    76 	}
    76 	}
    77 }
    77 }
    78 
    78 
    79 #define M(x) (1 << (x))
    79 #define M(x) (1 << (x))
    80 enum {
    80 typedef enum BridgeFoundations{
    81 	// foundation, whole tile is leveled up --> 3 corners raised
    81 	// foundation, whole tile is leveled up --> 3 corners raised
    82 	BRIDGE_FULL_LEVELED_FOUNDATION = M(SLOPE_WSE) | M(SLOPE_NWS) | M(SLOPE_ENW) | M(SLOPE_SEN),
    82 	BRIDGE_FULL_LEVELED_FOUNDATION = M(SLOPE_WSE) | M(SLOPE_NWS) | M(SLOPE_ENW) | M(SLOPE_SEN),
    83 	// foundation, tile is partly leveled up --> 1 corner raised
    83 	// foundation, tile is partly leveled up --> 1 corner raised
    84 	BRIDGE_PARTLY_LEVELED_FOUNDATION = M(SLOPE_W) | M(SLOPE_S) | M(SLOPE_E) | M(SLOPE_N),
    84 	BRIDGE_PARTLY_LEVELED_FOUNDATION = M(SLOPE_W) | M(SLOPE_S) | M(SLOPE_E) | M(SLOPE_N),
    85 	// no foundations (X,Y direction)
    85 	// no foundations (X,Y direction)
    86 	BRIDGE_NO_FOUNDATION = M(SLOPE_FLAT) | M(SLOPE_SW) | M(SLOPE_SE) | M(SLOPE_NW) | M(SLOPE_NE),
    86 	BRIDGE_NO_FOUNDATION = M(SLOPE_FLAT) | M(SLOPE_SW) | M(SLOPE_SE) | M(SLOPE_NW) | M(SLOPE_NE),
    87 	BRIDGE_HORZ_RAMP = (BRIDGE_PARTLY_LEVELED_FOUNDATION | BRIDGE_NO_FOUNDATION) & ~M(SLOPE_FLAT)
    87 	BRIDGE_HORZ_RAMP = (BRIDGE_PARTLY_LEVELED_FOUNDATION | BRIDGE_NO_FOUNDATION) & ~M(SLOPE_FLAT)
    88 };
    88 } BridgeFoundataion;
    89 #undef M
    89 #undef M
    90 
    90 
    91 static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table)
    91 static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table)
    92 {
    92 {
    93 	const Bridge *bridge = &_bridge[index];
    93 	const Bridge *bridge = &_bridge[index];