pub struct TilingSet {
pub tile_size: u32,
pub cols: u32,
pub rows: u32,
pub surface_width: u32,
pub surface_height: u32,
pub tiles: Vec<Tile>,
}Expand description
A regular 2D grid partitioning of a presentation surface into fixed-size tiles.
Fields§
§tile_size: u32§cols: u32§rows: u32§surface_width: u32§surface_height: u32§tiles: Vec<Tile>Implementations§
Source§impl TilingSet
impl TilingSet
Sourcepub fn new(surface_width: u32, surface_height: u32, tile_size: u32) -> Self
pub fn new(surface_width: u32, surface_height: u32, tile_size: u32) -> Self
Constructs a tiling grid covering the specified surface dimensions.
Sourcepub fn with_default_size(surface_width: u32, surface_height: u32) -> Self
pub fn with_default_size(surface_width: u32, surface_height: u32) -> Self
Default 256x256 grid constructor.
pub fn total_tiles(&self) -> usize
pub fn tile_index(&self, col: u32, row: u32) -> Option<usize>
pub fn tile_at(&self, col: u32, row: u32) -> Option<&Tile>
pub fn tile_at_mut(&mut self, col: u32, row: u32) -> Option<&mut Tile>
Sourcepub fn mark_damage(&mut self, damage: Rect)
pub fn mark_damage(&mut self, damage: Rect)
Marks all tiles intersecting the damage rectangle as dirty.
Sourcepub fn dirty_tiles(&self) -> impl Iterator<Item = &Tile>
pub fn dirty_tiles(&self) -> impl Iterator<Item = &Tile>
Returns an iterator over all dirty tiles.
Sourcepub fn active_render_tiles(&self) -> impl Iterator<Item = &Tile>
pub fn active_render_tiles(&self) -> impl Iterator<Item = &Tile>
Returns an iterator over dirty tiles that are not occluded.
pub fn dirty_count(&self) -> usize
pub fn occluded_count(&self) -> usize
pub fn reset_dirty(&mut self)
pub fn reset_occlusion(&mut self)
pub fn reset_all(&mut self)
Trait Implementations§
impl StructuralPartialEq for TilingSet
Auto Trait Implementations§
impl Forget for TilingSet
impl Freeze for TilingSet
impl Move for TilingSet
impl RefUnwindSafe for TilingSet
impl Send for TilingSet
impl Sync for TilingSet
impl Unpin for TilingSet
impl UnsafeUnpin for TilingSet
impl UnwindSafe for TilingSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more