mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-22 15:16:40 +11:00
Correctly use deduplication for combo rom
This commit is contained in:
parent
c9bf56755a
commit
c25cd74f43
1 changed files with 7 additions and 15 deletions
|
@ -8,7 +8,7 @@ use alloc::boxed::Box;
|
||||||
|
|
||||||
use agb::{
|
use agb::{
|
||||||
display::{
|
display::{
|
||||||
tiled::{InfiniteScrolledMap, RegularBackgroundSize, TileFormat, TileSet, TileSetting},
|
tiled::{InfiniteScrolledMap, RegularBackgroundSize, TileFormat, TileSet},
|
||||||
Priority,
|
Priority,
|
||||||
},
|
},
|
||||||
fixnum::{Num, Vector2D},
|
fixnum::{Num, Vector2D},
|
||||||
|
@ -66,11 +66,11 @@ fn get_game(gba: &mut agb::Gba) -> Game {
|
||||||
|
|
||||||
let tiles = [hat, purple, hyperspace, amplitude];
|
let tiles = [hat, purple, hyperspace, amplitude];
|
||||||
|
|
||||||
let palette_assignments = &[
|
let tile_settings = &[
|
||||||
games::hat.palette_assignments,
|
games::hat.tile_settings,
|
||||||
games::purple.palette_assignments,
|
games::purple.tile_settings,
|
||||||
games::hyperspace.palette_assignments,
|
games::hyperspace.tile_settings,
|
||||||
games::amplitude.palette_assignments,
|
games::amplitude.tile_settings,
|
||||||
];
|
];
|
||||||
|
|
||||||
vram.set_background_palettes(games::PALETTES);
|
vram.set_background_palettes(games::PALETTES);
|
||||||
|
@ -87,15 +87,7 @@ fn get_game(gba: &mut agb::Gba) -> Game {
|
||||||
|
|
||||||
let game = (pos.x).rem_euclid(tiles.len() as i32 * 30) as usize / 30;
|
let game = (pos.x).rem_euclid(tiles.len() as i32 * 30) as usize / 30;
|
||||||
let tile_id = (y * 30 + x) as usize;
|
let tile_id = (y * 30 + x) as usize;
|
||||||
(
|
(&tiles[game], tile_settings[game][tile_id])
|
||||||
&tiles[game],
|
|
||||||
TileSetting::new(
|
|
||||||
tile_id as u16,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
palette_assignments[game][tile_id],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue