What does deduplicate do to "include_background_gfx!"? #788
-
I have a boot sequence in mind: A splash screen, and then, an animated background (If that's possible). include_background_gfx!(backgrounds,
splash => deduplicate "assets/boot_splash.aseprite",
title => deduplicate "assets/main_menu.aseprite"
); And my sequence: sfx.play_main_sound().expect("Could not start the song!");
splash.show(&gfx);
let mut i = 0;
loop {
sfx.frame();
i += 1;
if i > 200000 {
break;
}
}
splash.destroy(&gfx);
title.show(&gfx);
agb::display::busy_wait_for_vblank();
input.update();
sfx.frame(); The pointIf I remove the Note: The second background contains some frames instead of being a static image, that may be related? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Deduplicate will look at every tile that's needed to show a background, along with every horizontal and vertical flip to try and reduce the amount of space needed. Because if you show the same tile in multiple places in your background, then we only need to put it into video ram (vram) once and reference the same tile multiple times. You'll see a big difference if you look at the vram viewer in your emulator between enabling deduplicate and disabling it. There isn't enough space in vram in the GBA for every tile to be unique when working with 256 colour palettes, so in that case you will need some repetition to make sure it fits in the limited space you have. |
Beta Was this translation helpful? Give feedback.
Deduplicate will look at every tile that's needed to show a background, along with every horizontal and vertical flip to try and reduce the amount of space needed. Because if you show the same tile in multiple places in your background, then we only need to put it into video ram (vram) once and reference the same tile multiple times. You'll see a big difference if you look at the vram viewer in your emulator between enabling deduplicate and disabling it.
There isn't enough space in vram in the GBA for every tile to be unique when working with 256 colour palettes, so in that case you will need some repetition to make sure it fits in the limited space you have.