X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fcore%2Flevel%2Flvlgen.rs;h=d2a389e7292b898fb94c4272efe8de9d4f31e35f;hb=e570927ad1703298a2c85599c7e25475c60b33d4;hp=3dcc3a75ed7d5bb95f3ada92d515fccba1f7b031;hpb=f3fe1a328df7ca0db89ddb14b7d45c3f16cea7fa;p=kaka%2Frust-sdl-test.git diff --git a/src/core/level/lvlgen.rs b/src/core/level/lvlgen.rs index 3dcc3a7..d2a389e 100644 --- a/src/core/level/lvlgen.rs +++ b/src/core/level/lvlgen.rs @@ -1,5 +1,5 @@ use {point, time_scope}; -use common::Point2D; +use common::Point; use super::{Grid, Level}; use noise::{NoiseFn, OpenSimplex, Seedable}; use rand::Rng; @@ -220,7 +220,7 @@ impl LevelGenerator { } } - fn find_walls(&self, grid: &Grid) -> Vec>> { + fn find_walls(&self, grid: &Grid) -> Vec>> { let mut walls = vec!(); for r in self.find_regions(&grid) { if r.value { @@ -256,7 +256,7 @@ impl Region { (min.0, min.1, 1 + max.0 - min.0, 1 + max.1 - min.1) } - pub fn outline(&self, scale: usize) -> Vec> { + pub fn outline(&self, scale: usize) -> Vec> { let rect = self.enclosing_rect(); let (ox, oy, w, h) = rect; let grid = self.grid(&rect); @@ -313,7 +313,7 @@ impl Region { grid } - fn find_first_point_of_outline(&self, rect: &(usize, usize, usize, usize), grid: &Vec>) -> Point2D { + fn find_first_point_of_outline(&self, rect: &(usize, usize, usize, usize), grid: &Vec>) -> Point { let (ox, oy, w, h) = rect; let is_outer_wall = (ox, oy) == (&0, &0); // we know this is always the outer wall of the level for x in 0..*w { @@ -329,7 +329,7 @@ impl Region { panic!("no wall found!"); } - fn find_next_point_of_outline(&self, grid: &Vec>, p: &mut Point2D, directions: &mut Vec<(isize, isize)>) { + fn find_next_point_of_outline(&self, grid: &Vec>, p: &mut Point, directions: &mut Vec<(isize, isize)>) { directions.rotate_left(2); loop { let d = directions[0]; @@ -341,7 +341,7 @@ impl Region { } } - fn check(&self, p: Point2D, grid: &Vec>) -> bool { + fn check(&self, p: Point, grid: &Vec>) -> bool { if p.x < 0 || p.x >= grid.len() as isize || p.y < 0 || p.y >= grid[0].len() as isize { false } else {