Skip to content

Commit

Permalink
Add an into_inner() function on infinite scrolled map (#575)
Browse files Browse the repository at this point in the history
Adds a useful into_inner function which we need at the moment.

Will add a changelog and documentation later

- [x] Changelog updated
  • Loading branch information
gwilymk authored Mar 6, 2024
2 parents 0e7716b + 90fe944 commit 5bdc782
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions agb/src/display/tiled/infinite_scrolled_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,12 @@ impl<'a> InfiniteScrolledMap<'a> {
pub const fn background(&self) -> BackgroundID {
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
}
}

fn div_floor(x: i32, y: i32) -> i32 {
Expand Down

0 comments on commit 5bdc782

Please sign in to comment.