rust/theme-editor/src/main.rs
changeset 14144 59ec51b78737
parent 14123 c6923ce139a2
equal deleted inserted replaced
14143:c27461e6a9eb 14144:59ec51b78737
    37             generator
    37             generator
    38         }
    38         }
    39     }
    39     }
    40 
    40 
    41     fn next(&mut self, parameters: LandGenerationParameters<u32>) -> Land2D<u32> {
    41     fn next(&mut self, parameters: LandGenerationParameters<u32>) -> Land2D<u32> {
    42         self.generator.generate_land(parameters, &mut self.rnd)
    42         self.generator.generate_land(&parameters, &mut self.rnd)
    43     }
    43     }
    44 }
    44 }
    45 
    45 
    46 fn fill_pixels(pixels: &mut [u8], land: &Land2D<u32>) {
    46 fn fill_pixels(pixels: &mut [u8], land: &Land2D<u32>) {
    47     for (surf_row, land_row) in pixels.chunks_mut(land.width() * 4).zip(land.rows()) {
    47     for (surf_row, land_row) in pixels.chunks_mut(land.width() * 4).zip(land.rows()) {
   162         .position_centered()
   162         .position_centered()
   163         .build().unwrap();
   163         .build().unwrap();
   164 
   164 
   165     let mut source = init_source();
   165     let mut source = init_source();
   166     let mut land = source.next(
   166     let mut land = source.next(
   167         LandGenerationParameters::new(0, u32::max_value()));
   167         LandGenerationParameters::new(0, u32::max_value(), 1, false, false));
   168     draw_center_mark(&mut land);
   168     draw_center_mark(&mut land);
   169 
   169 
   170     let mut land_surf = Surface::new(LAND_WIDTH, LAND_HEIGHT, PixelFormatEnum::ARGB8888).unwrap();
   170     let mut land_surf = Surface::new(LAND_WIDTH, LAND_HEIGHT, PixelFormatEnum::ARGB8888).unwrap();
   171 
   171 
   172     fill_texture(&mut land_surf, &land);
   172     fill_texture(&mut land_surf, &land);