fix rule rotation for copy-cells

This commit is contained in:
Crispy 2024-05-17 18:06:12 +02:00
parent da69daa219
commit fd2bf46b19
2 changed files with 4 additions and 3 deletions

View file

@ -307,7 +307,7 @@ impl Rule {
for x in 0..new.width { for x in 0..new.width {
let mut cell = base.get(y, new.width - x - 1); let mut cell = base.get(y, new.width - x - 1);
if let (_, RuleCellTo::Copy(cx, cy)) = &mut cell { if let (_, RuleCellTo::Copy(cx, cy)) = &mut cell {
let new_x = new.height - *cy - 1; let new_x = base.height - *cy - 1;
let new_y = *cx; let new_y = *cx;
(*cx, *cy) = (new_x, new_y); (*cx, *cy) = (new_x, new_y);
} }

View file

@ -81,9 +81,10 @@ impl eframe::App for UScope {
for _ in 0..self.speed { for _ in 0..self.speed {
// benchmarks made with sand_stress_test at 50000 speed in a release build // benchmarks made with sand_stress_test at 50000 speed in a release build
// ~50ms // ~50ms
// self.dish.try_one_position_overlapped(); self.dish.try_one_position_overlapped();
// ~35ms // ~35ms
self.dish.fire_blindly_cached(); // TODO: has directional bias, figure out why and fix it
// self.dish.fire_blindly_cached();
} }
let sim_time = sim_frame.elapsed(); let sim_time = sim_frame.elapsed();
// self.sim_times.push(sim_time.as_micros()); // self.sim_times.push(sim_time.as_micros());