Make affine map indexes u16

This commit is contained in:
Gwilym Inzani 2024-08-18 09:54:20 +01:00
parent 974b08989a
commit 2614fd1af0

View file

@ -432,7 +432,7 @@ impl AffineMap {
vram: &mut VRamManager, vram: &mut VRamManager,
pos: impl Into<Vector2D<u16>>, pos: impl Into<Vector2D<u16>>,
tileset: &TileSet<'_>, tileset: &TileSet<'_>,
tile_id: u8, tile_index: u16,
) { ) {
let pos = self.map_size().gba_offset(pos.into()); let pos = self.map_size().gba_offset(pos.into());
let colours = self.colours(); let colours = self.colours();
@ -442,8 +442,6 @@ impl AffineMap {
vram.remove_tile(old_tile.tile_index(colours)); vram.remove_tile(old_tile.tile_index(colours));
} }
let tile_index = tile_id as u16;
let new_tile = if tile_index != TRANSPARENT_TILE_INDEX { let new_tile = if tile_index != TRANSPARENT_TILE_INDEX {
let new_tile_idx = vram.add_tile(tileset, tile_index); let new_tile_idx = vram.add_tile(tileset, tile_index);
Tile::new(new_tile_idx, TileSetting(0)) Tile::new(new_tile_idx, TileSetting(0))