rust/land_dump/src/main.rs
changeset 14130 376a0551b00a
parent 14126 69db1d2e4cec
child 14133 b04dac00e8e2
--- a/rust/land_dump/src/main.rs	Sun Nov 04 00:25:27 2018 +0300
+++ b/rust/land_dump/src/main.rs	Sun Nov 04 00:20:27 2018 +0100
@@ -27,6 +27,8 @@
     dump_before_distort: bool,
     #[structopt(short = "b", long = "dump-before-bezierize")]
     dump_before_bezierize: bool,
+    #[structopt(short = "f", long = "distance-divisor", default_value = "100")]
+    distance_divisor: u32,
 }
 
 fn template() -> OutlineTemplate {
@@ -44,11 +46,12 @@
 
 fn dump(
     seed: &[u8],
+    distance_divisor: u32,
     skip_distort: bool,
     skip_bezier: bool,
     file_name: &Path,
 ) -> std::io::Result<()> {
-    let params = LandGenerationParameters::new(0 as u8, 255, 100, skip_distort, skip_bezier);
+    let params = LandGenerationParameters::new(0 as u8, 255, distance_divisor, skip_distort, skip_bezier);
     let landgen = TemplatedLandGenerator::new(template());
     let mut prng = LaggedFibonacciPRNG::new(seed);
     let land = landgen.generate_land(&params, &mut prng);
@@ -74,6 +77,7 @@
     if opt.dump_before_distort {
         dump(
             opt.seed.as_str().as_bytes(),
+            opt.distance_divisor,
             true,
             true,
             Path::new("out.before_distort.png"),
@@ -83,6 +87,7 @@
     if opt.dump_before_bezierize {
         dump(
             opt.seed.as_str().as_bytes(),
+            opt.distance_divisor,
             false,
             true,
             Path::new("out.before_bezier.png"),
@@ -91,6 +96,7 @@
     }
     dump(
         opt.seed.as_str().as_bytes(),
+        opt.distance_divisor,
         false,
         true,
         Path::new("out.full.png"),