summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/main.rs b/src/main.rs
index 81b5ee6..f896de3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -98,44 +98,6 @@ impl App {
));
}
- // --TEST DRAWING--
- if self.input_manager.lmb_held || self.input_manager.rmb_held {
- // start with the bounding box of the drawing brush circle + some margin
- // clamp the bounding box to the board sie
- let bb_xl = (self.input_manager.world_mouse_pos.x - self.config.brush_radius)
- .round() as i32;
- let bb_xu = (self.input_manager.world_mouse_pos.x + self.config.brush_radius)
- .round() as i32;
- let bb_yl = (self.input_manager.world_mouse_pos.y - self.config.brush_radius)
- .round() as i32;
- let bb_yu = (self.input_manager.world_mouse_pos.y + self.config.brush_radius)
- .round() as i32;
-
- // for each point, check if the distance is less than the brush size and write the pixel
- for x in bb_xl..bb_xu {
- for y in bb_yl..bb_yu {
- let r = random_range(0.0..1.0);
- if ((x - self.input_manager.world_mouse_pos.x.round() as i32).pow(2)
- + (y - self.input_manager.world_mouse_pos.y.round() as i32).pow(2))
- < (self.config.brush_radius as i32).pow(2)
- && r > 0.9
- {
- let cell = if self.input_manager.lmb_held {
- let mut cell = Cell::from_material(self.config.brush_material);
- // ensure we simulate on the first tick
- cell.match_parity(sim.cell_manager.seqno);
- cell
- } else {
- Cell::void()
- };
- sim.cell_manager.set_cell_from_game_position(
- x, y, cell, false, // wake the chunk
- )
- }
- }
- }
- }
-
sim.update(&self.config, &self.input_manager, delta_time);
self.input_manager.reset_for_frame();
}