From 4248dade115c89910233959f64034ad5d04c371f Mon Sep 17 00:00:00 2001 From: vE5li Date: Mon, 15 Apr 2024 22:09:36 +0200 Subject: [PATCH] Fix release build --- korangar/src/interface/theme/mod.rs | 1 + korangar/src/main.rs | 4 +- korangar_interface/src/lib.rs | 57 +++++++++++++++-------------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/korangar/src/interface/theme/mod.rs b/korangar/src/interface/theme/mod.rs index ed5786923..9613b70a4 100644 --- a/korangar/src/interface/theme/mod.rs +++ b/korangar/src/interface/theme/mod.rs @@ -1186,6 +1186,7 @@ pub struct Themes { impl Themes { pub fn new(menu: InterfaceTheme, main: InterfaceTheme, game: GameTheme) -> Self { Self { + #[cfg(feature = "debug")] theme_actions: Default::default(), menu, main, diff --git a/korangar/src/main.rs b/korangar/src/main.rs index 6a9e193b2..5184046d7 100644 --- a/korangar/src/main.rs +++ b/korangar/src/main.rs @@ -40,9 +40,7 @@ use cgmath::{Vector2, Vector3, Zero}; use image::io::Reader as ImageReader; use image::{EncodableLayout, ImageFormat}; use korangar_interface::application::{Application, FocusState, FontSizeTrait, FontSizeTraitExt, PositionTraitExt}; -use korangar_interface::state::{ - PlainTrackedState, Remote, RemoteClone, TrackedState, TrackedStateBinary, TrackedStateClone, TrackedStateVec, -}; +use korangar_interface::state::{PlainTrackedState, Remote, RemoteClone, TrackedState, TrackedStateVec}; use korangar_interface::Interface; use korangar_procedural::debug_condition; use network::SkillType; diff --git a/korangar_interface/src/lib.rs b/korangar_interface/src/lib.rs index cd289a8ae..2c438c655 100644 --- a/korangar_interface/src/lib.rs +++ b/korangar_interface/src/lib.rs @@ -170,11 +170,11 @@ where } } - #[cfg_attr(feature = "debug", procedural::profile("update user interface"))] + // #[cfg_attr(feature = "debug", procedural::profile("update user interface"))] pub fn update(&mut self, application: &App, font_loader: App::FontLoader, focus_state: &mut FocusState) -> (bool, bool) { for (window, post_update) in &mut self.windows { - #[cfg(feature = "debug")] - profile_block!("update window"); + // #[cfg(feature = "debug")] + // profile_block!("update window"); if let Some(change_event) = window.update() { Self::handle_change_event(&mut self.post_update, post_update, change_event); @@ -185,8 +185,8 @@ where for (window_index, (window, post_update)) in self.windows.iter_mut().enumerate() { if self.post_update.needs_resolve() || post_update.take_resolve() { - #[cfg(feature = "debug")] - profile_block!("resolve window"); + // #[cfg(feature = "debug")] + // profile_block!("resolve window"); let (_position, previous_size) = window.get_area(); let kind = window.get_theme_kind(); @@ -225,8 +225,8 @@ where if !self.post_update.needs_render() { // We profile this block rather than the flag function itself because it calls // itself recursively - #[cfg(feature = "debug")] - profile_block!("flag render windows"); + // #[cfg(feature = "debug")] + // profile_block!("flag render windows"); self.flag_render_windows(application, 0, None); } @@ -242,7 +242,7 @@ where self.post_update.resolve(); } - #[cfg_attr(feature = "debug", procedural::profile("get hovered element"))] + // #[cfg_attr(feature = "debug", procedural::profile("get hovered element"))] pub fn hovered_element( &self, mouse_position: App::Position, @@ -259,7 +259,7 @@ where (None, None) } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn move_window_to_top(&mut self, window_index: usize) -> usize { let (window, post_update) = self.windows.remove(window_index); let new_window_index = self.windows.len(); @@ -269,7 +269,7 @@ where new_window_index } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn left_click_element(&mut self, hovered_element: &ElementCell, window_index: usize) -> Vec> { let (_, post_update) = &mut self.windows[window_index]; let mut resolve = false; @@ -283,7 +283,7 @@ where action } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn right_click_element(&mut self, hovered_element: &ElementCell, window_index: usize) -> Vec> { let (_, post_update) = &mut self.windows[window_index]; let mut resolve = false; @@ -297,7 +297,7 @@ where action } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn drag_element(&mut self, element: &ElementCell, _window_index: usize, mouse_delta: App::Position) { //let (_window, post_update) = &mut self.windows[window_index]; @@ -307,7 +307,7 @@ where } } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn scroll_element(&mut self, element: &ElementCell, window_index: usize, scroll_delta: f32) { let (_, post_update) = &mut self.windows[window_index]; @@ -316,7 +316,7 @@ where } } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn input_character_element(&mut self, element: &ElementCell, window_index: usize, character: char) -> Vec> { let (_, post_update) = &mut self.windows[window_index]; let mut propagated_actions = Vec::new(); @@ -331,7 +331,7 @@ where propagated_actions } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn move_window(&mut self, window_index: usize, offset: App::Position) { if let Some((window_class, position)) = self.windows[window_index].0.offset(self.available_space, offset) { self.window_cache.update_position(window_class, position); @@ -340,7 +340,7 @@ where self.post_update.render(); } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn resize_window(&mut self, application: &App, window_index: usize, growth: App::Size) { let (window, post_update) = &mut self.windows[window_index]; @@ -390,7 +390,7 @@ where } } - #[cfg_attr(feature = "debug", procedural::profile("render user interface"))] + // #[cfg_attr(feature = "debug", procedural::profile("render user interface"))] pub fn render( &mut self, render_target: &mut >::Target, @@ -405,8 +405,8 @@ where for (window, post_update) in &mut self.windows { if post_update.take_render() || self.post_update.needs_render() { - #[cfg(feature = "debug")] - profile_block!("render window"); + // #[cfg(feature = "debug")] + // profile_block!("render window"); let kind = window.get_theme_kind(); let theme = application.get_theme(kind); @@ -426,7 +426,7 @@ where self.post_update.take_render(); } - #[cfg_attr(feature = "debug", procedural::profile("check window exists"))] + // #[cfg_attr(feature = "debug", procedural::profile("check window exists"))] fn window_exists(&self, window_class: Option<&str>) -> bool { match window_class { Some(window_class) => self.windows.iter().any(|window| { @@ -444,7 +444,7 @@ where focus_state.set_focused_window(self.windows.len() - 1); } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn open_window(&mut self, application: &App, focus_state: &mut FocusState, prototype_window: &dyn PrototypeWindow) { if !self.window_exists(prototype_window.window_class()) { let window = prototype_window.to_window(&self.window_cache, application, self.available_space); @@ -452,7 +452,7 @@ where } } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn open_popup( &mut self, element: ElementCell, @@ -465,14 +465,14 @@ where entry.1.resolve(); } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn close_popup(&mut self, window_index: usize) { let entry = &mut self.windows[window_index]; entry.0.close_popup(); entry.1.render(); } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn close_window(&mut self, focus_state: &mut FocusState, window_index: usize) { let (window, ..) = self.windows.remove(window_index); self.post_update.render(); @@ -489,7 +489,7 @@ where &self.windows[window_index].0 } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn close_window_with_class(&mut self, focus_state: &mut FocusState, window_class: &str) { let index_from_back = self .windows @@ -503,7 +503,7 @@ where self.close_window(focus_state, index); } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn close_all_windows_except(&mut self, focus_state: &mut FocusState) { for index in (0..self.windows.len()).rev() { if self.windows[index] @@ -517,7 +517,8 @@ where } } - #[cfg_attr(feature = "debug", procedural::profile("get first focused element"))] + // #[cfg_attr(feature = "debug", procedural::profile("get first focused + // element"))] pub fn first_focused_element(&self, focus_state: &mut FocusState) { if self.windows.is_empty() { return; @@ -529,7 +530,7 @@ where focus_state.set_focused_element(element, window_index); } - #[cfg_attr(feature = "debug", procedural::profile)] + // #[cfg_attr(feature = "debug", procedural::profile)] pub fn restore_focus(&self, focus_state: &mut FocusState) { if self.windows.is_empty() { return;