diff --git a/src/graphics.rs b/src/graphics.rs index 493234c..d17f397 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -1,6 +1,6 @@ use bytemuck::{Pod, Zeroable}; use wgpu::{include_wgsl, util::DeviceExt, BindGroup, Buffer, Device, Queue, RenderPipeline, Surface, SurfaceConfiguration, VertexBufferLayout}; -use winit::{event::{Event, WindowEvent}, event_loop::EventLoop, window::Window}; +use winit::{event::{Event, WindowEvent}, window::Window}; use crate::{state::State, App}; diff --git a/src/state.rs b/src/state.rs index f03ce6c..8aebafe 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,5 +1,5 @@ use std::{collections::{BTreeMap, HashMap}, time::Instant}; -use log::info; +use log::trace; use map::{CellKind, Map}; use rand::prelude::*; use voronoice::Point; @@ -127,7 +127,7 @@ impl State { } } pub fn render(&mut self) { - info!("render"); + trace!("render"); self.vertices = Vec::new(); self.indices = Vec::new(); @@ -179,8 +179,7 @@ impl State { } } pub fn update(&mut self) { - dbg!(self.framerate); - info!("update"); + trace!("update"); self.last_frame = Instant::now(); let mut rng = thread_rng(); @@ -216,7 +215,7 @@ impl State { // if Option is None remove the entity let mut entities_to_move: Vec<(usize, Option)> = Vec::new(); for (eid, e) in self.entities.iter_mut() { - match dbg!(e.update(&mut self.map, self.t, &mut rng)) { + match e.update(&mut self.map, self.t, &mut rng) { Some(ExternOp::Move(cid)) => { entities_to_move.push((*eid, Some(cid))); }, diff --git a/src/state/entity.rs b/src/state/entity.rs index c5d230a..70e606f 100644 --- a/src/state/entity.rs +++ b/src/state/entity.rs @@ -1,11 +1,10 @@ use std::time::Instant; use rand::{rngs::ThreadRng, seq::IteratorRandom, Rng}; -use voronoice::Point; use crate::graphics::Vertex; -use super::{map::{CellData, CellKind}, Map}; +use super::{map::CellKind, Map}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum EntityKind { @@ -182,7 +181,7 @@ impl Entity { } } - if dbg!(self.health) == 0. { + if self.health == 0. { return Some(ExternOp::Remove); } diff --git a/src/state/map.rs b/src/state/map.rs index 77d8bb0..87930c3 100644 --- a/src/state/map.rs +++ b/src/state/map.rs @@ -1,11 +1,7 @@ -use std::collections::HashMap; - use noise::{Fbm, MultiFractal, NoiseFn, Perlin}; use rand::{Rng, SeedableRng}; use voronoice::{BoundingBox, Point, Voronoi, VoronoiBuilder}; -use super::entity::Entity; - #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum CellKind { Void,