fn render_chunks(py: Python, generator: &Generator, level: &PyAny) -> PyResult<()> {
  let chunks_pos_list = create_chunk_list(generator);
  let chunk_count = chunks_pos_list.len();
  for (i, chunk_pos) in chunks_pos_list.into_iter().enumerate() {
    let progress = (i + 1) as f32 / chunk_count as f32 * 100.0;
    println!("rendering chunk: {:>3}, {:>3}  {:>5.2}%", chunk_pos.x, chunk_pos.y, progress);
    render_chunk(py, &generator, &level, chunk_pos)?;
  };

  println!("saving chunks...");
  level.call_method0("save")?;
  level.call_method0("close")?;

  Ok(())
}
// Steps through rings of chunks expanding out from 0,0 until a ring
// is reached where no chunks would be inside the generator's bounding box
Steps through rings of chunks expanding out from 0,0 until a ring
is reached where no chunks would be inside the generator's bounding box
Steps through rings of chunks expanding out from 0 0 until a ring is reached where no chunks would be inside the generator ' s bounding box
fn render_chunks(py: Python, generator: &Generator, level: &PyAny) -> PyResult<()> {
  let chunks_pos_list = create_chunk_list(generator);
  let chunk_count = chunks_pos_list.len();
  for (i, chunk_pos) in chunks_pos_list.into_iter().enumerate() {
    let progress = (i + 1) as f32 / chunk_count as f32 * 100.0;
    println!("rendering chunk: {:>3}, {:>3}  {:>5.2}%", chunk_pos.x, chunk_pos.y, progress);
    render_chunk(py, &generator, &level, chunk_pos)?;
  };
  println!("saving chunks...");
  level.call_method0("save")?;
  level.call_method0("close")?;
  Ok(())
}
fn render_chunks ( py : Python , generator : & Generator , level : & PyAny ) -> PyResult < ( ) > { let chunks_pos_list = create_chunk_list ( generator ) ; let chunk_count = chunks_pos_list . len ( ) ; for ( i , chunk_pos ) in chunks_pos_list . into_iter ( ) . enumerate ( ) { let progress = ( i + 1 ) as f32 / chunk_count as f32 * 100.0 ; println ! ( " " chunk_pos x chunk_pos y progress ) ; render_chunk ( py , & generator , & level , chunk_pos ) ? ; } ; println ! ( " " ) ; level . call_method0 ( " " ) ? ; level . call_method0 ( " " ) ? ; Ok ( ( ) ) }
Steps through rings of chunks expanding out from 0,0 until a ring
is reached where no chunks would be inside the generator's bounding box
Steps through rings of chunks expanding out from 0 0 until a ring is reached where no chunks would be inside the generator ' s bounding box
py
Python
generator
&Generator
level
&PyAny
py
Python
generator
&Generator
level
&PyAny