bridge_cmd.c
branchcustombridgeheads
changeset 5601 51f241d43769
parent 5599 a18b0c2587f7
child 5606 a8e391b7b10a
equal deleted inserted replaced
5600:bac9ab186cab 5601:51f241d43769
    74 		r += n * n;
    74 		r += n * n;
    75 		x -= n;
    75 		x -= n;
    76 	}
    76 	}
    77 }
    77 }
    78 
    78 
    79 #define M(x) (1 << (x))
       
    80 enum {
       
    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),
       
    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),
       
    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),
       
    87 	BRIDGE_HORZ_RAMP = (BRIDGE_PARTLY_LEVELED_FOUNDATION | BRIDGE_NO_FOUNDATION) & ~M(SLOPE_FLAT)
       
    88 };
       
    89 #undef M
       
    90 
       
    91 static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table)
    79 static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table)
    92 {
    80 {
    93 	const Bridge *bridge = &_bridge[index];
    81 	const Bridge *bridge = &_bridge[index];
    94 	assert(table < 7);
    82 	assert(table < 7);
    95 	if (bridge->sprite_table == NULL || bridge->sprite_table[table] == NULL) {
    83 	if (bridge->sprite_table == NULL || bridge->sprite_table[table] == NULL) {