mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
background id exposed
This commit is contained in:
parent
15cfc5196b
commit
10423d0752
|
@ -1,6 +1,6 @@
|
|||
use alloc::boxed::Box;
|
||||
|
||||
use super::{MapLoan, RegularMap, TileSet, TileSetting, VRamManager};
|
||||
use super::{BackgroundID, MapLoan, RegularMap, TileSet, TileSetting, VRamManager};
|
||||
|
||||
use crate::{
|
||||
display,
|
||||
|
@ -414,6 +414,11 @@ impl<'a> InfiniteScrolledMap<'a> {
|
|||
pub fn clear(&mut self, vram: &mut VRamManager) {
|
||||
self.map.clear(vram);
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub const fn background(&self) -> BackgroundID {
|
||||
self.map.background()
|
||||
}
|
||||
}
|
||||
|
||||
fn div_floor(x: i32, y: i32) -> i32 {
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::dma::dma_copy16;
|
|||
use crate::fixnum::Vector2D;
|
||||
use crate::memory_mapped::MemoryMapped;
|
||||
|
||||
use super::{RegularBackgroundSize, Tile, TileSet, TileSetting, VRamManager};
|
||||
use super::{BackgroundID, RegularBackgroundSize, Tile, TileSet, TileSetting, VRamManager};
|
||||
|
||||
use alloc::{vec, vec::Vec};
|
||||
|
||||
|
@ -201,6 +201,11 @@ impl<'a, T> MapLoan<'a, T> {
|
|||
screenblock_list,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub const fn background(&self) -> BackgroundID {
|
||||
BackgroundID(self.background_id)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> Drop for MapLoan<'a, T> {
|
||||
|
|
|
@ -17,6 +17,9 @@ pub enum RegularBackgroundSize {
|
|||
Background64x64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct BackgroundID(pub(crate) u8);
|
||||
|
||||
impl RegularBackgroundSize {
|
||||
#[must_use]
|
||||
pub fn width(&self) -> u32 {
|
||||
|
|
Loading…
Reference in a new issue