From 569a1c04254ba771ec38c4210690f2ec0a9c0a95 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 5 Mar 2024 23:50:38 +0000 Subject: [PATCH 1/3] Add an into_inner() function on infinite scrolled map --- agb/src/display/tiled/infinite_scrolled_map.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agb/src/display/tiled/infinite_scrolled_map.rs b/agb/src/display/tiled/infinite_scrolled_map.rs index e936808e..9ae33212 100644 --- a/agb/src/display/tiled/infinite_scrolled_map.rs +++ b/agb/src/display/tiled/infinite_scrolled_map.rs @@ -430,6 +430,11 @@ impl<'a> InfiniteScrolledMap<'a> { pub const fn background(&self) -> BackgroundID { self.map.background() } + + #[must_use] + pub fn into_inner(self) -> MapLoan<'a, RegularMap> { + self.map + } } fn div_floor(x: i32, y: i32) -> i32 { From 98d9c133c7fefcb3881dc3c1543aad73e550f3e2 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Wed, 6 Mar 2024 09:00:28 +0000 Subject: [PATCH 2/3] Add a changelog entry for into_inner --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49200d0e..ff432aff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added `.priority()`, `.set_priority()` and `.is_visible()` to `RegularMap`, `AffineMap` and `InfiniteScrolledMap`. - Replaced `.show()` and `.hide()` with `.set_visible()`in `RegularMap`, `AffineMap` and `InfiniteScrolledMap`. +- Added `.into_inner()` to `InfiniteScrolledMap` to get the map back once you are done using it in the `InfiniteScrolledMap`. - Added `.hflip()`, `.vflip()`, `.priority()`, `.position()` to `ObjectUnmanaged` and `Object`. - An abstraction over hblank DMA to allow for cool effects like gradients and circular windows. See the dma_effect* examples. - Expermental and incomplete support for MIDI files with agb-tracker. From 90fe94424fd4300b748edbea5dbc3eb4a1c530fb Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Wed, 6 Mar 2024 09:02:40 +0000 Subject: [PATCH 3/3] Add a doc entry for into_inner --- agb/src/display/tiled/infinite_scrolled_map.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/agb/src/display/tiled/infinite_scrolled_map.rs b/agb/src/display/tiled/infinite_scrolled_map.rs index 9ae33212..21a124ef 100644 --- a/agb/src/display/tiled/infinite_scrolled_map.rs +++ b/agb/src/display/tiled/infinite_scrolled_map.rs @@ -431,6 +431,7 @@ impl<'a> InfiniteScrolledMap<'a> { self.map.background() } + /// Returns the underlying map back. The map will not be cleared. #[must_use] pub fn into_inner(self) -> MapLoan<'a, RegularMap> { self.map