mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Assert replace tile is passed two tiles of the same size
This commit is contained in:
parent
d106b0a82b
commit
9a5ecc5cda
|
@ -27,7 +27,7 @@ const fn layout_of(format: TileFormat) -> Layout {
|
|||
unsafe { Layout::from_size_align_unchecked(format.tile_size(), format.tile_size()) }
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum TileFormat {
|
||||
FourBpp,
|
||||
EightBpp,
|
||||
|
@ -363,6 +363,11 @@ impl VRamManager {
|
|||
target_tile_set: &TileSet<'_>,
|
||||
target_tile: u16,
|
||||
) {
|
||||
assert_eq!(
|
||||
source_tile_set.format, target_tile_set.format,
|
||||
"Must replace a tileset with the same format"
|
||||
);
|
||||
|
||||
if let Some(&reference) = self
|
||||
.tile_set_to_vram
|
||||
.get(&TileInTileSetReference::new(source_tile_set, source_tile))
|
||||
|
|
Loading…
Reference in a new issue