rust/theme-editor/src/main.rs
changeset 14123 c6923ce139a2
parent 14120 7845beb87cb5
child 14144 59ec51b78737
--- a/rust/theme-editor/src/main.rs	Sat Nov 03 01:47:39 2018 +0300
+++ b/rust/theme-editor/src/main.rs	Sat Nov 03 01:52:05 2018 +0300
@@ -127,13 +127,22 @@
         .add_fill_points(&[Point::new(1023, 0)])
 }
 
-
 fn init_source() -> LandSource<TemplatedLandGenerator> {
     let template = test_template();
     let generator = TemplatedLandGenerator::new(template);
     LandSource::new(generator)
 }
 
+fn draw_center_mark(land: &mut Land2D<u32>) {
+    for i in 0..32 {
+        land.draw_thick_line(Line::new(Point::new(LAND_WIDTH as i32 / 2, 0),
+                                       Point::new(LAND_WIDTH as i32 / 2, LAND_HEIGHT as i32)), 10, 128);
+        land.draw_thick_line(Line::new(Point::new(0, LAND_HEIGHT as i32 / 2),
+                                       Point::new(LAND_WIDTH as i32, LAND_HEIGHT as i32 / 2)), 10, 128);
+        land.fill_circle(Point::new(LAND_WIDTH as i32, LAND_HEIGHT as i32) / 2, 60, 128);
+    }
+}
+
 fn draw_random_lines(land: &mut Land2D<u32>) {
     for i in 0..32 {
         land.draw_thick_line(Line::new(point(), point()), rnd(5), 128);
@@ -156,8 +165,7 @@
     let mut source = init_source();
     let mut land = source.next(
         LandGenerationParameters::new(0, u32::max_value()));
-    draw_random_lines(&mut land);
-
+    draw_center_mark(&mut land);
 
     let mut land_surf = Surface::new(LAND_WIDTH, LAND_HEIGHT, PixelFormatEnum::ARGB8888).unwrap();