finishes decoupling map from camera
This commit is contained in:
parent
2ecfd25d95
commit
7f0465da73
13 changed files with 110 additions and 254 deletions
|
|
@ -31,7 +31,7 @@ impl WaveFunctionCollapseBuilder {
|
|||
let constraints = patterns_to_constraints(patterns, CHUNK_SIZE);
|
||||
self.render_tile_gallery(&constraints, CHUNK_SIZE, build_data);
|
||||
|
||||
build_data.map = Map::new(build_data.map.depth);
|
||||
build_data.map = Map::new(build_data.map.depth, build_data.map.width, build_data.map.height);
|
||||
loop {
|
||||
let mut solver = Solver::new(constraints.clone(), CHUNK_SIZE, &build_data.map);
|
||||
while !solver.iteration(&mut build_data.map, rng) {
|
||||
|
|
@ -46,7 +46,7 @@ impl WaveFunctionCollapseBuilder {
|
|||
}
|
||||
|
||||
fn render_tile_gallery(&mut self, constraints: &[MapChunk], chunk_size: i32, build_data: &mut BuilderMap) {
|
||||
build_data.map = Map::new(0);
|
||||
build_data.map = Map::new(0, build_data.width, build_data.height);
|
||||
let mut counter = 0;
|
||||
let mut x = 1;
|
||||
let mut y = 1;
|
||||
|
|
@ -62,7 +62,7 @@ impl WaveFunctionCollapseBuilder {
|
|||
if y + chunk_size > build_data.map.height {
|
||||
// Move to the next page
|
||||
build_data.take_snapshot();
|
||||
build_data.map = Map::new(0);
|
||||
build_data.map = Map::new(0, build_data.width, build_data.height);
|
||||
|
||||
x = 1;
|
||||
y = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue