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