From f0ddfc96b4a213fbe481af4367e75e05ad489731 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Wed, 30 Aug 2023 16:18:08 +0100 Subject: [PATCH] Reference the TRANSPARENT_TILE_INDEX in the definition of BLANK --- agb/src/display/tiled/map.rs | 2 +- agb/src/display/tiled/mod.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/agb/src/display/tiled/map.rs b/agb/src/display/tiled/map.rs index 367f111b..b2a83013 100644 --- a/agb/src/display/tiled/map.rs +++ b/agb/src/display/tiled/map.rs @@ -128,7 +128,7 @@ pub struct RegularMap { tiles_dirty: bool, } -pub const TRANSPARENT_TILE_INDEX: u16 = (1 << 10) - 1; +pub(crate) const TRANSPARENT_TILE_INDEX: u16 = (1 << 10) - 1; impl TiledMapTypes for RegularMap { type Size = RegularBackgroundSize; diff --git a/agb/src/display/tiled/mod.rs b/agb/src/display/tiled/mod.rs index 7c289a3f..e9f20881 100644 --- a/agb/src/display/tiled/mod.rs +++ b/agb/src/display/tiled/mod.rs @@ -16,6 +16,8 @@ pub use tiled1::Tiled1; pub use tiled2::Tiled2; pub use vram_manager::{DynamicTile, TileFormat, TileIndex, TileSet, VRamManager}; +use map::TRANSPARENT_TILE_INDEX; + // affine layers start at BG2 pub(crate) const AFFINE_BG_ID_OFFSET: usize = 2; @@ -165,7 +167,7 @@ impl Tile { pub struct TileSetting(u16); impl TileSetting { - pub const BLANK: Self = TileSetting::new(1023, false, false, 0); + pub const BLANK: Self = TileSetting::new(TRANSPARENT_TILE_INDEX, false, false, 0); #[must_use] pub const fn new(tile_id: u16, hflip: bool, vflip: bool, palette_id: u8) -> Self {