pub fn smooth (width : usize, height : usize, tiles : &mut Vec<TileType>, wall : TileType, floor : TileType) {
	info!("Smoothing...");

	for x in 1..width-1 {
		for y in 1..height-1 {
			let surrounding_wall_count = get_surrounding_neighbor_count(width, height, tiles, wall, x as i32, y as i32);

			if surrounding_wall_count > 4 {
				tiles[x+y*width] = wall;
			} else if surrounding_wall_count < 4 {
				tiles[x+y*width] = floor;
			}
		}
	}
}
/// Applies a different cellular ruleset to smooth out jagged edges.
Applies a different cellular ruleset to smooth out jagged edges.
Applies a different cellular ruleset to smooth out jagged edges .
pub fn smooth (width : usize, height : usize, tiles : &mut Vec<TileType>, wall : TileType, floor : TileType) {
	info!("Smoothing...");
	for x in 1..width-1 {
		for y in 1..height-1 {
			let surrounding_wall_count = get_surrounding_neighbor_count(width, height, tiles, wall, x as i32, y as i32);
			if surrounding_wall_count > 4 {
				tiles[x+y*width] = wall;
			} else if surrounding_wall_count < 4 {
				tiles[x+y*width] = floor;
			}
		}
	}
}
pub fn smooth ( width : usize , height : usize , tiles : & mut Vec < TileType > , wall : TileType , floor : TileType ) { info ! ( " " ) ; for x in 1 .. width - 1 { for y in 1 .. height - 1 { let surrounding_wall_count = get_surrounding_neighbor_count ( width , height , tiles , wall , x as i32 , y as i32 ) ; if surrounding_wall_count > 4 { tiles [ x + y * width ] = wall ; } else if surrounding_wall_count < 4 { tiles [ x + y * width ] = floor ; } } } }
Applies a different cellular ruleset to smooth out jagged edges.
Applies a different cellular ruleset to smooth out jagged edges .
width
usize
height
usize
tiles
&mut Vec<TileType>
wall
TileType
floor
TileType
width
usize
height
usize
tiles
&mut Vec<TileType>
wall
TileType
floor
TileType