fix jitter between objects and background

This commit is contained in:
Corwin 2023-04-17 23:34:09 +01:00
parent c970ab9362
commit 692890b6d6
No known key found for this signature in database

View file

@ -2066,10 +2066,6 @@ impl<'a> Game<'a> {
.commit_with_fudge(this_frame_offset, (0, 0).into()); .commit_with_fudge(this_frame_offset, (0, 0).into());
} }
self.level.background.commit(vram);
self.level.foreground.commit(vram);
self.level.clouds.commit(vram);
for i in remove { for i in remove {
self.particles.remove(i); self.particles.remove(i);
} }
@ -2274,6 +2270,9 @@ fn game_with_level(gba: &mut agb::Gba) {
sfx.frame(); sfx.frame();
vblank.wait_for_vblank(); vblank.wait_for_vblank();
object.commit(); object.commit();
game.level.background.commit(&mut vram);
game.level.foreground.commit(&mut vram);
game.level.clouds.commit(&mut vram);
match game.advance_frame(&object, &mut vram, &mut sfx) { match game.advance_frame(&object, &mut vram, &mut sfx) {
GameStatus::Continue => {} GameStatus::Continue => {}
GameStatus::Lost => { GameStatus::Lost => {