diff options
-rw-r--r-- | CHANGELOG.md | 7 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | source/benoit/benoit/application/handle_keys.rs | 6 | ||||
-rw-r--r-- | source/benoit/benoit/configuration/load.rs | 10 |
4 files changed, 16 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f0c396e..689d22c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 19 + +* Update controls +* Update configuration format +* Optimise renderer +* Fix thread count not being loaded + # 18 * Rename handle_key to handle_keys @@ -1,6 +1,6 @@ [package] name = "benoit" -version = "0.20.0" +version = "0.21.0" authors = ["Gabriel Bjørnager Jensen"] edition = "2021" description = "Mandelbrot renderer." diff --git a/source/benoit/benoit/application/handle_keys.rs b/source/benoit/benoit/application/handle_keys.rs index 25f3ea9..547971f 100644 --- a/source/benoit/benoit/application/handle_keys.rs +++ b/source/benoit/benoit/application/handle_keys.rs @@ -36,12 +36,12 @@ impl Application { } self.zoom = match scan_code { - Scancode::E => self.zoom * 2.0, - Scancode::Q => self.zoom / 2.0, + Scancode::E => self.zoom * 4.0, + Scancode::Q => self.zoom / 4.0, _ => self.zoom, }; - let translate_ammount: f64 = 1.0 / 16.0 / self.zoom; + let translate_ammount: f64 = 1.0 / 4.0 / self.zoom; self.position_x += match scan_code { Scancode::A => -translate_ammount, diff --git a/source/benoit/benoit/configuration/load.rs b/source/benoit/benoit/configuration/load.rs index c9b0512..1c0cfe8 100644 --- a/source/benoit/benoit/configuration/load.rs +++ b/source/benoit/benoit/configuration/load.rs @@ -29,8 +29,6 @@ use std::fs::read; use std::str::FromStr; use toml::{Table, Value}; -use std::time::Duration; - impl Configuration { pub fn load(path: &str) -> Configuration { eprintln!("loading configuration at \"{path}\""); @@ -65,13 +63,15 @@ impl Configuration { }; }; + get_integer(&mut configuration.thread_count, &configuration_table, "thread_count"); + get_integer(&mut configuration.canvas_width, &configuration_table, "canvas_width"); get_integer(&mut configuration.canvas_height, &configuration_table, "canvas_height"); get_integer(&mut configuration.scale, &configuration_table, "scale"); - get_float(&mut configuration.position_x, &configuration_table, "position_x"); - get_float(&mut configuration.position_y, &configuration_table, "position_y"); - get_float(&mut configuration.zoom, &configuration_table, "zoom"); + get_float(&mut configuration.position_x, &configuration_table, "real"); + get_float(&mut configuration.position_y, &configuration_table, "imaginary"); + get_float(&mut configuration.zoom, &configuration_table, "zoom"); get_integer(&mut configuration.maximum_iteration_count, &configuration_table, "maximum_iteration_count"); |