diff --git a/src/constants.rs b/src/constants.rs index 185a980..9b07865 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -49,6 +49,13 @@ pub const CANVAS_SIZE: UVec2 = UVec2::new( (BOARD_CELL_SIZE.y + BOARD_CELL_OFFSET.y) * CELL_SIZE, ); +pub const LARGE_SCALE: f32 = 2.6; + +pub const LARGE_CANVAS_SIZE: UVec2 = UVec2::new( + (((BOARD_CELL_SIZE.x + BOARD_CELL_OFFSET.x) * CELL_SIZE) as f32 * LARGE_SCALE) as u32, + (((BOARD_CELL_SIZE.y + BOARD_CELL_OFFSET.y) * CELL_SIZE) as f32 * LARGE_SCALE) as u32, +); + /// Collider size constants for different entity types pub mod collider { use super::CELL_SIZE; diff --git a/src/game.rs b/src/game.rs index 6863726..b27eaed 100644 --- a/src/game.rs +++ b/src/game.rs @@ -157,9 +157,9 @@ impl Game { map_texture.set_scale_mode(ScaleMode::Nearest); // Create debug texture at output resolution for crisp debug rendering - let output_size = canvas.output_size().unwrap(); + let output_size = constants::LARGE_CANVAS_SIZE; let mut debug_texture = texture_creator - .create_texture_target(Some(sdl2::pixels::PixelFormatEnum::ARGB8888), output_size.0, output_size.1) + .create_texture_target(Some(sdl2::pixels::PixelFormatEnum::ARGB8888), output_size.x, output_size.y) .map_err(|e| GameError::Sdl(e.to_string()))?; // Debug texture is copied over the backbuffer, it requires transparency abilities diff --git a/src/systems/collision.rs b/src/systems/collision.rs index c3b680d..e132a8f 100644 --- a/src/systems/collision.rs +++ b/src/systems/collision.rs @@ -142,8 +142,6 @@ pub fn ghost_collision_system( events.write(AudioEvent::PlayEat); } else { // Pac-Man dies (this would need a death system) - // For now, just log it - tracing::warn!("Pac-Man collided with ghost while not frightened!"); } } } diff --git a/src/systems/debug.rs b/src/systems/debug.rs index da1c67f..14db924 100644 --- a/src/systems/debug.rs +++ b/src/systems/debug.rs @@ -1,7 +1,7 @@ //! Debug rendering system use std::cmp::Ordering; -use crate::constants::{BOARD_PIXEL_OFFSET, CANVAS_SIZE}; +use crate::constants::{self, BOARD_PIXEL_OFFSET}; use crate::map::builder::Map; use crate::systems::{Collider, CursorPosition, NodeId, Position, SystemTimings}; use crate::texture::ttf::{TtfAtlas, TtfRenderer}; @@ -215,9 +215,7 @@ pub fn debug_render_system( if !debug_state.enabled { return; } - let output = UVec2::from(canvas.output_size().unwrap()).as_vec2(); - let logical = CANVAS_SIZE.as_vec2(); - let scale = (output / logical).min_element(); + let scale = constants::LARGE_SCALE as f32; // Create debug text renderer let text_renderer = TtfRenderer::new(1.0);