From 4db22fd16eac7da73eac71173ac7fc3b55497229 Mon Sep 17 00:00:00 2001 From: Andrey Lesnikov Date: Tue, 31 Mar 2020 09:40:59 +0300 Subject: [PATCH] nalgebra -> cgmath --- Cargo.lock | 104 +++++---------------- Cargo.toml | 2 +- ggwp-zgui/Cargo.toml | 2 +- ggwp-zgui/examples/absolute_coordinates.rs | 4 +- ggwp-zgui/examples/layers_layout.rs | 4 +- ggwp-zgui/examples/nested.rs | 4 +- ggwp-zgui/examples/pixel_coordinates.rs | 4 +- ggwp-zgui/examples/remove.rs | 4 +- ggwp-zgui/examples/text_button.rs | 4 +- ggwp-zgui/examples/vertical_layout.rs | 4 +- ggwp-zgui/src/lib.rs | 2 +- ggwp-zscene/Cargo.toml | 2 +- ggwp-zscene/examples/action.rs | 2 +- ggwp-zscene/src/action/move_by.rs | 2 +- ggwp-zscene/src/sprite.rs | 2 +- src/geom.rs | 2 +- src/main.rs | 2 +- src/screen.rs | 2 +- src/screen/ability_info.rs | 2 +- src/screen/agent_info.rs | 2 +- src/screen/battle.rs | 2 +- src/screen/battle/view.rs | 2 +- src/screen/battle/visualize.rs | 8 +- src/screen/campaign.rs | 2 +- src/screen/confirm.rs | 2 +- src/screen/main_menu.rs | 2 +- 26 files changed, 60 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a860ff46..48053a7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,17 +15,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alga" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" -dependencies = [ - "approx 0.3.2", - "num-complex", - "num-traits 0.2.11", -] - [[package]] name = "ansi_term" version = "0.11.0" @@ -133,6 +122,18 @@ dependencies = [ "rand 0.4.6", ] +[[package]] +name = "cgmath" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "283944cdecc44bf0b8dd010ec9af888d3b4f142844fdbe026c20ef68148d6fe7" +dependencies = [ + "approx 0.3.2", + "mint", + "num-traits 0.2.11", + "rand 0.6.5", +] + [[package]] name = "cloudabi" version = "0.0.3" @@ -173,9 +174,9 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.3" +version = "0.99.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a806e96c59a76a5ba6e18735b6cf833344671e61e7863f2edb5c518ea2cac95c" +checksum = "e2323f3f47db9a0e77ce7a300605d8d2098597fc451ed1a97bb1f6411bb550a7" dependencies = [ "proc-macro2", "quote", @@ -228,15 +229,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -dependencies = [ - "typenum", -] - [[package]] name = "getrandom" version = "0.1.14" @@ -252,17 +244,17 @@ dependencies = [ name = "ggwp-zgui" version = "0.1.0" dependencies = [ + "cgmath 0.17.0", "good-web-game", "log", - "nalgebra", ] [[package]] name = "ggwp-zscene" version = "0.1.0" dependencies = [ + "cgmath 0.17.0", "good-web-game", - "nalgebra", ] [[package]] @@ -271,7 +263,7 @@ version = "0.2.5" source = "git+https://github.com/not-fl3/good-web-game#c475573fb0e7619896652e3a6344140243239e96" dependencies = [ "bitflags", - "cgmath", + "cgmath 0.16.1", "image", "lazy_static", "lyon", @@ -284,9 +276,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +checksum = "725cf19794cf90aa94e65050cb4191ff5d8fa87a498383774c47b332e3af952e" dependencies = [ "libc", ] @@ -334,12 +326,6 @@ version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" -[[package]] -name = "libm" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" - [[package]] name = "log" version = "0.4.8" @@ -398,15 +384,6 @@ dependencies = [ "sid", ] -[[package]] -name = "matrixmultiply" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4f7ec66360130972f34830bfad9ef05c6610a43938a467bcc9ab9369ab3478f" -dependencies = [ - "rawpointer", -] - [[package]] name = "memchr" version = "2.3.3" @@ -430,7 +407,7 @@ dependencies = [ [[package]] name = "miniquad_text_rusttype" version = "0.1.0" -source = "git+https://github.com/not-fl3/miniquad_text_rusttype#e5a6c0dc705e8dcdd80ff77b4f76683609c23603" +source = "git+https://github.com/not-fl3/miniquad_text_rusttype#8b14f834083829b06ad594be5fdb322fccbe232e" dependencies = [ "miniquad", "rusttype 0.7.9", @@ -442,24 +419,6 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d80717448454e312cb3148adab19943f1553a8fbc828a39b0e91911f488130" -[[package]] -name = "nalgebra" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa9fddbc34c8c35dd2108515587b8ce0cab396f17977b8c738568e4edb521a2" -dependencies = [ - "alga", - "approx 0.3.2", - "generic-array", - "matrixmultiply", - "mint", - "num-complex", - "num-rational", - "num-traits 0.2.11", - "rand 0.6.5", - "typenum", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -537,7 +496,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" dependencies = [ "autocfg 1.0.0", - "libm", ] [[package]] @@ -590,9 +548,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" dependencies = [ "unicode-xid", ] @@ -780,12 +738,6 @@ dependencies = [ "rand_core 0.3.1", ] -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "rdrand" version = "0.4.0" @@ -989,12 +941,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "typenum" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" - [[package]] name = "unicode-xid" version = "0.2.0" @@ -1025,9 +971,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" +checksum = "fa515c5163a99cc82bab70fd3bfdd36d827be85de63737b40fcef2ce084a436e" dependencies = [ "winapi", ] @@ -1046,13 +992,13 @@ version = "0.1.1" name = "zemeroth" version = "0.7.0-snapshot" dependencies = [ + "cgmath 0.17.0", "derive_more", "env_logger", "ggwp-zgui", "ggwp-zscene", "good-web-game", "log", - "nalgebra", "num", "pretty_assertions", "quad-rand", diff --git a/Cargo.toml b/Cargo.toml index 23343f2e..927a32f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ ui = { path = "ggwp-zgui", package = "ggwp-zgui" } scene = { path = "ggwp-zscene", package = "ggwp-zscene" } zcomponents = { path = "zcomponents" } rand = { version = "0.7", features = [] } -nalgebra = { version = "0.18", features = ["mint"] } # TODO: update (or replace with cgmath) +cgmath = { version = "0.17", features = ["mint"] } qrand = { git = "https://github.com/not-fl3/quad-rand", package = "quad-rand", features = ['rand'] } gwg = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" } diff --git a/ggwp-zgui/Cargo.toml b/ggwp-zgui/Cargo.toml index 01a4ce32..6b9038cb 100644 --- a/ggwp-zgui/Cargo.toml +++ b/ggwp-zgui/Cargo.toml @@ -9,5 +9,5 @@ keywords = ["gamedev", "gui"] [dependencies] log = "0.4" -nalgebra = { version = "0.18", features = ["mint"] } +cgmath = { version = "0.17", features = ["mint"] } gwg = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" } diff --git a/ggwp-zgui/examples/absolute_coordinates.rs b/ggwp-zgui/examples/absolute_coordinates.rs index d2add460..ac27c445 100644 --- a/ggwp-zgui/examples/absolute_coordinates.rs +++ b/ggwp-zgui/examples/absolute_coordinates.rs @@ -1,10 +1,10 @@ +use cgmath::Point2; use ggwp_zgui as ui; use gwg::{ conf, event, graphics::{self, Font, Rect, Text}, Context, GameResult, }; -use nalgebra::Point2; #[derive(Clone, Copy, Debug)] enum Message { @@ -90,7 +90,7 @@ impl event::EventHandler for State { let window_pos = Point2::new(x, y); let pos = ui::window_to_screen(context, window_pos); let message = self.gui.click(pos); - println!("[{},{}] -> {}: {:?}", x, y, pos, message); + println!("[{},{}] -> {:?}: {:?}", x, y, pos, message); } } diff --git a/ggwp-zgui/examples/layers_layout.rs b/ggwp-zgui/examples/layers_layout.rs index e55ca95a..54aff741 100644 --- a/ggwp-zgui/examples/layers_layout.rs +++ b/ggwp-zgui/examples/layers_layout.rs @@ -1,10 +1,10 @@ +use cgmath::Point2; use ggwp_zgui as ui; use gwg::{ conf, event, graphics::{self, Font, Image, Text}, Context, GameResult, }; -use nalgebra::Point2; #[derive(Clone, Copy, Debug)] enum Message { @@ -65,7 +65,7 @@ impl event::EventHandler for State { let window_pos = Point2::new(x, y); let pos = ui::window_to_screen(context, window_pos); let message = self.gui.click(pos); - println!("[{},{}] -> {}: {:?}", x, y, pos, message); + println!("[{},{}] -> {:?}: {:?}", x, y, pos, message); } fn resize_event(&mut self, context: &mut Context, w: f32, h: f32) { diff --git a/ggwp-zgui/examples/nested.rs b/ggwp-zgui/examples/nested.rs index d5cb0074..d4f64c1b 100644 --- a/ggwp-zgui/examples/nested.rs +++ b/ggwp-zgui/examples/nested.rs @@ -1,10 +1,10 @@ +use cgmath::Point2; use ggwp_zgui as ui; use gwg::{ conf, event, graphics::{self, Font, Image, Rect, Text}, Context, GameResult, }; -use nalgebra::Point2; #[derive(Clone, Copy, Debug)] enum Message { @@ -127,7 +127,7 @@ impl event::EventHandler for State { let window_pos = Point2::new(x, y); let pos = ui::window_to_screen(context, window_pos); let message = self.gui.click(pos); - println!("[{},{}] -> {}: {:?}", x, y, pos, message); + println!("[{},{}] -> {:?}: {:?}", x, y, pos, message); } } diff --git a/ggwp-zgui/examples/pixel_coordinates.rs b/ggwp-zgui/examples/pixel_coordinates.rs index 4e758002..226516c0 100644 --- a/ggwp-zgui/examples/pixel_coordinates.rs +++ b/ggwp-zgui/examples/pixel_coordinates.rs @@ -1,10 +1,10 @@ +use cgmath::Point2; use ggwp_zgui as ui; use gwg::{ conf, event, graphics::{self, Font, Text}, Context, GameResult, }; -use nalgebra::Point2; #[derive(Clone, Copy, Debug)] enum Message { @@ -90,7 +90,7 @@ impl event::EventHandler for State { let window_pos = Point2::new(x, y); let pos = ui::window_to_screen(context, window_pos); let message = self.gui.click(pos); - println!("[{},{}] -> {}: {:?}", x, y, pos, message); + println!("[{},{}] -> {:?}: {:?}", x, y, pos, message); } } diff --git a/ggwp-zgui/examples/remove.rs b/ggwp-zgui/examples/remove.rs index 3815c720..bc29a337 100644 --- a/ggwp-zgui/examples/remove.rs +++ b/ggwp-zgui/examples/remove.rs @@ -1,10 +1,10 @@ +use cgmath::Point2; use ggwp_zgui as ui; use gwg::{ conf, event, graphics::{self, Font, Image, Text}, Context, GameResult, }; -use nalgebra::Point2; #[derive(Clone, Copy, Debug)] enum Message { @@ -89,7 +89,7 @@ impl event::EventHandler for State { let window_pos = Point2::new(x, y); let pos = ui::window_to_screen(context, window_pos); let message = self.gui.click(pos); - println!("[{},{}] -> {}: {:?}", x, y, pos, message); + println!("[{},{}] -> {:?}: {:?}", x, y, pos, message); if let Some(Message::AddOrRemove) = message { if self.label.is_some() { self.remove_label(); diff --git a/ggwp-zgui/examples/text_button.rs b/ggwp-zgui/examples/text_button.rs index b80e5b90..44b4b988 100644 --- a/ggwp-zgui/examples/text_button.rs +++ b/ggwp-zgui/examples/text_button.rs @@ -1,10 +1,10 @@ +use cgmath::Point2; use ggwp_zgui as ui; use gwg::{ conf, event, graphics::{self, Font, Text}, Context, GameResult, }; -use nalgebra::Point2; #[derive(Clone, Copy, Debug)] enum Message { @@ -64,7 +64,7 @@ impl event::EventHandler for State { let window_pos = Point2::new(x, y); let pos = ui::window_to_screen(context, window_pos); let message = self.gui.click(pos); - println!("[{},{}] -> {}: {:?}", x, y, pos, message); + println!("[{},{}] -> {:?}: {:?}", x, y, pos, message); } } diff --git a/ggwp-zgui/examples/vertical_layout.rs b/ggwp-zgui/examples/vertical_layout.rs index 009e58bf..49a38405 100644 --- a/ggwp-zgui/examples/vertical_layout.rs +++ b/ggwp-zgui/examples/vertical_layout.rs @@ -1,10 +1,10 @@ +use cgmath::Point2; use ggwp_zgui as ui; use gwg::{ conf, event, graphics::{self, Font, Text}, Context, GameResult, }; -use nalgebra::Point2; #[derive(Clone, Copy, Debug)] enum Message { @@ -70,7 +70,7 @@ impl event::EventHandler for State { let window_pos = Point2::new(x, y); let pos = ui::window_to_screen(context, window_pos); let message = self.gui.click(pos); - println!("[{},{}] -> {}: {:?}", x, y, pos, message); + println!("[{},{}] -> {:?}: {:?}", x, y, pos, message); } } diff --git a/ggwp-zgui/src/lib.rs b/ggwp-zgui/src/lib.rs index 18b23b94..e2a6eb79 100644 --- a/ggwp-zgui/src/lib.rs +++ b/ggwp-zgui/src/lib.rs @@ -7,12 +7,12 @@ use std::{ sync::mpsc::{channel, Receiver, Sender}, }; +use cgmath::{Point2, Vector2}; use gwg::{ graphics::{self, Color, Drawable, Rect}, Context, GameResult, }; use log::{debug, info}; -use nalgebra::{Point2, Vector2}; pub use error::Error; diff --git a/ggwp-zscene/Cargo.toml b/ggwp-zscene/Cargo.toml index 25bc79fa..5b71f848 100644 --- a/ggwp-zscene/Cargo.toml +++ b/ggwp-zscene/Cargo.toml @@ -8,5 +8,5 @@ description = "Scene and Actions for gwg" keywords = ["gamedev", "2D"] [dependencies] -nalgebra = { version = "0.18", features = ["mint"] } +cgmath = { version = "0.17", features = ["mint"] } gwg = { git = "https://github.com/not-fl3/good-web-game", package = "good-web-game" } diff --git a/ggwp-zscene/examples/action.rs b/ggwp-zscene/examples/action.rs index a16703cb..449d4d4f 100644 --- a/ggwp-zscene/examples/action.rs +++ b/ggwp-zscene/examples/action.rs @@ -1,12 +1,12 @@ use std::time::Duration; +use cgmath::{Point2, Vector2}; use ggwp_zscene::{self as zscene, action, Boxed, Layer, Scene, Sprite}; use gwg::{ conf, event, graphics::{self, Font, Rect, Text}, Context, GameResult, }; -use nalgebra::{Point2, Vector2}; #[derive(Debug, Clone, Default)] pub struct Layers { diff --git a/ggwp-zscene/src/action/move_by.rs b/ggwp-zscene/src/action/move_by.rs index ea03d417..35baddd8 100644 --- a/ggwp-zscene/src/action/move_by.rs +++ b/ggwp-zscene/src/action/move_by.rs @@ -1,7 +1,7 @@ use std::time::Duration; +use cgmath::Vector2; use gwg::timer; -use nalgebra::Vector2; use crate::{Action, Sprite}; diff --git a/ggwp-zscene/src/sprite.rs b/ggwp-zscene/src/sprite.rs index 27a9b63d..ab9b9985 100644 --- a/ggwp-zscene/src/sprite.rs +++ b/ggwp-zscene/src/sprite.rs @@ -1,10 +1,10 @@ use std::{cell::RefCell, collections::HashMap, fmt, hash::Hash, path::Path, rc::Rc}; +use cgmath::{Point2, Vector2}; use gwg::{ graphics::{self, Drawable, Rect}, Context, GameResult, }; -use nalgebra::{Point2, Vector2}; use crate::{Error, Result}; diff --git a/src/geom.rs b/src/geom.rs index 06e6a396..6787cb80 100644 --- a/src/geom.rs +++ b/src/geom.rs @@ -1,4 +1,4 @@ -use nalgebra::{Point2, Vector2}; +use cgmath::{Point2, Vector2}; use rand::Rng; use crate::core::{ diff --git a/src/main.rs b/src/main.rs index abf496e6..28317dad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,12 @@ #![windows_subsystem = "windows"] +use cgmath::Point2; use gwg::{ conf::Conf, event, graphics::{self, Rect}, Context, GameResult, }; -use nalgebra::Point2; mod core; mod error; diff --git a/src/screen.rs b/src/screen.rs index 35161002..ba9d94d7 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -1,12 +1,12 @@ use log::info; use std::{fmt::Debug, time::Duration}; +use cgmath::Point2; use gwg::{ self, graphics::{self, Color}, Context, }; -use nalgebra::Point2; use crate::ZResult; diff --git a/src/screen/ability_info.rs b/src/screen/ability_info.rs index 97f71249..6b476276 100644 --- a/src/screen/ability_info.rs +++ b/src/screen/ability_info.rs @@ -1,10 +1,10 @@ use std::time::Duration; +use cgmath::Point2; use gwg::{ graphics::{self, Text}, Context, }; -use nalgebra::Point2; use ui::{self, Gui}; use crate::{ diff --git a/src/screen/agent_info.rs b/src/screen/agent_info.rs index 2e3aeb5e..fd5523f9 100644 --- a/src/screen/agent_info.rs +++ b/src/screen/agent_info.rs @@ -1,10 +1,10 @@ use std::{collections::HashMap, time::Duration}; +use cgmath::Point2; use gwg::{ graphics::{self, Text}, Context, }; -use nalgebra::Point2; use scene::Sprite; use ui::{self, Gui}; diff --git a/src/screen/battle.rs b/src/screen/battle.rs index ddba6a98..d3251ad9 100644 --- a/src/screen/battle.rs +++ b/src/screen/battle.rs @@ -3,12 +3,12 @@ use std::{ time::Duration, }; +use cgmath::Point2; use gwg::{ graphics::{self, Font, Text}, Context, }; use log::{debug, info}; -use nalgebra::Point2; use scene::{action, Action, Boxed}; use ui::{self, Gui}; diff --git a/src/screen/battle/view.rs b/src/screen/battle/view.rs index 83471845..de0e1321 100644 --- a/src/screen/battle/view.rs +++ b/src/screen/battle/view.rs @@ -1,10 +1,10 @@ use std::{collections::HashMap, default::Default, time::Duration}; +use cgmath::Point2; use gwg::{ graphics::{Color, Font, Image, Text}, Context, }; -use nalgebra::Point2; use rand::Rng; use scene::{action, Action, Boxed, Layer, Scene, Sprite}; diff --git a/src/screen/battle/visualize.rs b/src/screen/battle/visualize.rs index 70ec7e24..ce6aaeb3 100644 --- a/src/screen/battle/visualize.rs +++ b/src/screen/battle/visualize.rs @@ -1,11 +1,11 @@ use std::time::Duration; +use cgmath::{self, InnerSpace, Point2, Rad, Rotation, Rotation2, Vector2}; use gwg::{ graphics::{Color, Text}, Context, }; use log::{debug, info}; -use nalgebra::{self, Point2, Vector2}; use rand::Rng; use scene::{action, Action, Boxed, Facing, Sprite}; @@ -227,9 +227,9 @@ fn show_dust( let size = view.tile_size() * 2.0 * scale; let vector = { let max = std::f32::consts::PI * 2.0; - let rot = nalgebra::Rotation2::new((max / count as f32) * i as f32); + let rot = cgmath::Basis2::from_angle(Rad((max / count as f32) * i as f32)); let n = zrng().gen_range(0.4, 0.6); - let mut vector = rot * Vector2::new(view.tile_size() * n, 0.0); + let mut vector = rot.rotate_vector(Vector2::new(view.tile_size() * n, 0.0)); vector.y *= geom::FLATNESS_COEFFICIENT; vector }; @@ -355,7 +355,7 @@ fn move_object_with_shadow( } fn arc_move(view: &mut BattleView, sprite: &Sprite, diff: Vector2) -> Box { - let len = nalgebra::Matrix::norm(&diff); + let len = diff.magnitude(); let min_height = view.tile_size() * 0.5; let base_height = view.tile_size() * 2.0; let min_time = 0.25; diff --git a/src/screen/campaign.rs b/src/screen/campaign.rs index 083db033..342b36ec 100644 --- a/src/screen/campaign.rs +++ b/src/screen/campaign.rs @@ -3,12 +3,12 @@ use std::{ time::Duration, }; +use cgmath::Point2; use gwg::{ graphics::{self, Font, Text}, Context, }; use log::info; -use nalgebra::Point2; use ui::{self, Gui}; use crate::{ diff --git a/src/screen/confirm.rs b/src/screen/confirm.rs index f90775b0..0ba7bd7a 100644 --- a/src/screen/confirm.rs +++ b/src/screen/confirm.rs @@ -3,11 +3,11 @@ use std::{ time::Duration, }; +use cgmath::Point2; use gwg::{ graphics::{self, Text}, Context, }; -use nalgebra::Point2; use ui::{self, Gui, Widget}; use crate::{ diff --git a/src/screen/main_menu.rs b/src/screen/main_menu.rs index b24d4da5..1f63732c 100644 --- a/src/screen/main_menu.rs +++ b/src/screen/main_menu.rs @@ -3,12 +3,12 @@ use std::{ time::Duration, }; +use cgmath::Point2; use gwg::{ graphics::{Font, Text}, Context, }; use log::debug; -use nalgebra::Point2; use scene::Sprite; use ui::{self, Gui};