mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
Add missing methods for tiled1 to allow creating backgrounds (#368)
Fixes #367 Had missed implementations to actually get the backgrounds if you were using tiled1 mode. - [x] Changelog updated / no changelog update needed
This commit is contained in:
commit
987d7b0d2c
|
@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added missed implementations of `regular()` and `affine()` to `Tiled1` which made `Tiled1` impossible to use.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Text renderer can now be re-used which is useful for rpg style character/word at a time text boxes.
|
- Text renderer can now be re-used which is useful for rpg style character/word at a time text boxes.
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
|
|
||||||
use super::{CreatableAffineTiledMode, CreatableRegularTiledMode, TiledMode};
|
use super::{
|
||||||
|
AffineBackgroundSize, AffineMap, AffineTiledMode, CreatableAffineTiledMode,
|
||||||
|
CreatableRegularTiledMode, MapLoan, RegularBackgroundSize, RegularMap, RegularTiledMode,
|
||||||
|
TiledMode,
|
||||||
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
bitarray::Bitarray,
|
bitarray::Bitarray,
|
||||||
display::{set_graphics_mode, tiled::AFFINE_BG_ID_OFFSET, DisplayMode},
|
display::{set_graphics_mode, tiled::AFFINE_BG_ID_OFFSET, DisplayMode, Priority},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct Tiled1 {
|
pub struct Tiled1 {
|
||||||
|
@ -27,6 +31,18 @@ impl Tiled1 {
|
||||||
screenblocks: Default::default(),
|
screenblocks: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn regular(
|
||||||
|
&self,
|
||||||
|
priority: Priority,
|
||||||
|
size: RegularBackgroundSize,
|
||||||
|
) -> MapLoan<'_, RegularMap> {
|
||||||
|
self.regular_background(priority, size)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn affine(&self, priority: Priority, size: AffineBackgroundSize) -> MapLoan<'_, AffineMap> {
|
||||||
|
self.affine_background(priority, size)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TiledMode for Tiled1 {
|
impl TiledMode for Tiled1 {
|
||||||
|
|
Loading…
Reference in a new issue