Add a basic version of the example_logo for certain examples

This commit is contained in:
Gwilym Inzani 2024-05-25 11:24:23 +01:00
parent b208133564
commit 24e15f8786
5 changed files with 11 additions and 1 deletions

View file

@ -25,7 +25,7 @@ fn main(mut gba: agb::Gba) -> ! {
let dma = gba.dma.dma().dma0; let dma = gba.dma.dma().dma0;
example_logo::display_logo(&mut map, &mut vram); example_logo::display_logo_basic(&mut map, &mut vram);
let vblank = VBlank::get(); let vblank = VBlank::get();

BIN
agb/gfx/test_logo.aseprite Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
agb/gfx/test_logo_basic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,6 +1,7 @@
use super::tiled::{RegularMap, TiledMap, VRamManager}; use super::tiled::{RegularMap, TiledMap, VRamManager};
crate::include_background_gfx!(crate, agb_logo, test_logo => deduplicate "gfx/test_logo.png"); crate::include_background_gfx!(crate, agb_logo, test_logo => deduplicate "gfx/test_logo.png");
crate::include_background_gfx!(crate, agb_logo_basic, test_logo => deduplicate "gfx/test_logo_basic.png");
pub fn display_logo(map: &mut RegularMap, vram: &mut VRamManager) { pub fn display_logo(map: &mut RegularMap, vram: &mut VRamManager) {
vram.set_background_palettes(agb_logo::PALETTES); vram.set_background_palettes(agb_logo::PALETTES);
@ -11,6 +12,15 @@ pub fn display_logo(map: &mut RegularMap, vram: &mut VRamManager) {
map.set_visible(true); map.set_visible(true);
} }
pub fn display_logo_basic(map: &mut RegularMap, vram: &mut VRamManager) {
vram.set_background_palettes(agb_logo_basic::PALETTES);
map.fill_with(vram, &agb_logo_basic::test_logo);
map.commit(vram);
map.set_visible(true);
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::display::{tiled::RegularBackgroundSize, Priority}; use crate::display::{tiled::RegularBackgroundSize, Priority};