Give purple night the deduplication treatment

This commit is contained in:
Gwilym Inzani 2023-08-29 16:33:11 +01:00
parent 54237c0fce
commit 6422ed63f1

View file

@ -15,10 +15,7 @@ use alloc::{boxed::Box, vec::Vec};
use agb::{ use agb::{
display::{ display::{
object::{Graphics, OamManaged, Object, Sprite, Tag, TagMap}, object::{Graphics, OamManaged, Object, Sprite, Tag, TagMap},
tiled::{ tiled::{InfiniteScrolledMap, RegularBackgroundSize, TileFormat, TileSet, VRamManager},
InfiniteScrolledMap, RegularBackgroundSize, TileFormat, TileSet, TileSetting,
VRamManager,
},
Priority, HEIGHT, WIDTH, Priority, HEIGHT, WIDTH,
}, },
fixnum::{num, FixedNum, Rect, Vector2D}, fixnum::{num, FixedNum, Rect, Vector2D},
@ -57,7 +54,7 @@ const SWORDLESS_JUMP: &Tag = TAG_MAP.get("jump swordless");
const SWORDLESS_ATTACK: &Tag = KNIFE_ATTACK; const SWORDLESS_ATTACK: &Tag = KNIFE_ATTACK;
const SWORDLESS_JUMP_ATTACK: &Tag = KNIFE_JUMP_ATTACK; const SWORDLESS_JUMP_ATTACK: &Tag = KNIFE_JUMP_ATTACK;
agb::include_background_gfx!(background, "53269a", background => "gfx/background.aseprite"); agb::include_background_gfx!(background, "53269a", background => deduplicate "gfx/background.aseprite");
type Number = FixedNum<8>; type Number = FixedNum<8>;
@ -2207,11 +2204,10 @@ fn game_with_level(gba: &mut agb::Gba) {
Box::new(|pos| { Box::new(|pos| {
( (
&tileset, &tileset,
TileSetting::from_raw( background::background.tile_settings[*tilemap::BACKGROUND_MAP
*tilemap::BACKGROUND_MAP .get((pos.x + tilemap::WIDTH * pos.y) as usize)
.get((pos.x + tilemap::WIDTH * pos.y) as usize) .unwrap_or(&0)
.unwrap_or(&0), as usize],
),
) )
}), }),
); );
@ -2225,11 +2221,10 @@ fn game_with_level(gba: &mut agb::Gba) {
Box::new(|pos| { Box::new(|pos| {
( (
&tileset, &tileset,
TileSetting::from_raw( background::background.tile_settings[*tilemap::FOREGROUND_MAP
*tilemap::FOREGROUND_MAP .get((pos.x + tilemap::WIDTH * pos.y) as usize)
.get((pos.x + tilemap::WIDTH * pos.y) as usize) .unwrap_or(&0)
.unwrap_or(&0), as usize],
),
) )
}), }),
); );
@ -2243,11 +2238,10 @@ fn game_with_level(gba: &mut agb::Gba) {
Box::new(|pos| { Box::new(|pos| {
( (
&tileset, &tileset,
TileSetting::from_raw( background::background.tile_settings[*tilemap::CLOUD_MAP
*tilemap::CLOUD_MAP .get((pos.x + tilemap::WIDTH * pos.y) as usize)
.get((pos.x + tilemap::WIDTH * pos.y) as usize) .unwrap_or(&0)
.unwrap_or(&0), as usize],
),
) )
}), }),
); );