diff options
author | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 15:31:09 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2021-10-27 15:31:26 +0300 |
commit | b3bef1bdddb73e386e6f54635d6bcc39efd1b911 (patch) | |
tree | 505f11d6fe9f524e4a4166503cfc4e59902f5e18 /src/main.rs | |
parent | e444b6784e9e6867df3622ee986b4adbb7bcc685 (diff) | |
download | pistol-b3bef1bdddb73e386e6f54635d6bcc39efd1b911.tar.gz |
refactor: define WIDTH & HEIGHT in one place
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index ae1fafb..243ee2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ mod canvas; use std::f32::consts::PI; use cgmath::Vector3; -use crate::camera::{Buffer, Camera}; +use crate::camera::{Buffer, Camera, WIDTH, HEIGHT}; fn main() { let mut cam = Camera { @@ -11,9 +11,9 @@ fn main() { direction: Vector3 { x: 1.0, y: 0.0, z: 0.0 }, angle: PI / 2.0, distance: 1.0, - aspect_ratio: 2.0 / 3.0, + aspect_ratio: 2.0 * HEIGHT as f32 / WIDTH as f32, brightness: 5.0, - buffer: Buffer([['.'; 180]; 60]), + buffer: Buffer([[' '; WIDTH as usize]; HEIGHT as usize]), time: 0.0, }; |