♻️ Refactor how rebuild_tiles works

This commit is contained in:
Aitor Moreno 2025-04-22 11:18:19 +02:00 committed by Alejandro Alonso
parent fef342b489
commit caf13eb774
8 changed files with 63 additions and 15 deletions

View file

@ -1,15 +1,15 @@
use crate::debug;
use crate::options;
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct RenderOptions {
pub debug_flags: u32,
pub flags: u32,
pub dpr: Option<f32>,
}
impl Default for RenderOptions {
fn default() -> Self {
Self {
debug_flags: 0x00,
flags: 0x00,
dpr: None,
}
}
@ -17,7 +17,11 @@ impl Default for RenderOptions {
impl RenderOptions {
pub fn is_debug_visible(&self) -> bool {
self.debug_flags & debug::DEBUG_VISIBLE == debug::DEBUG_VISIBLE
self.flags & options::DEBUG_VISIBLE == options::DEBUG_VISIBLE
}
pub fn is_profile_rebuild_tiles(&self) -> bool {
self.flags & options::PROFILE_REBUILD_TILES == options::PROFILE_REBUILD_TILES
}
pub fn dpr(&self) -> f32 {