From ceb3eff116f9ddf8dcb71a0a77efb63531f75ab2 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Wed, 2 Feb 2022 19:08:44 +0100 Subject: 2022 update --- src/camera.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/camera.rs') diff --git a/src/camera.rs b/src/camera.rs index bcb8f69..3461df1 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -1,10 +1,10 @@ use ggez::conf::Conf; -use ggez::nalgebra::Point2; +use glam::*; use crate::constants; pub struct Camera { - pub draw: Point2, + pub draw: glam::Vec2, window_dimensions: (f32, f32), map_dimensions: (f32, f32), } @@ -13,13 +13,13 @@ impl Camera { pub fn new(map_dimensions: (f32, f32)) -> Camera { let conf = Conf::new(); Camera { - draw: Point2::new(0.0, 0.0), + draw: glam::Vec2::new(0.0, 0.0), window_dimensions: (conf.window_mode.width, conf.window_mode.height), map_dimensions, } } - pub fn give_center(&mut self, center: Point2) { + pub fn give_center(&mut self, center: glam::Vec2) { self.draw.x = ((self.window_dimensions.0 / 2.0) - center.x) - (constants::TILE_WIDTH); self.draw.y = ((self.window_dimensions.1 / 2.0) - center.y) - (constants::TILE_HEIGHT); -- cgit v1.2.3