From 692890b6d65954484579eca902c9b33605b4e0b1 Mon Sep 17 00:00:00 2001 From: Corwin Date: Mon, 17 Apr 2023 23:34:09 +0100 Subject: [PATCH] fix jitter between objects and background --- examples/the-purple-night/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/the-purple-night/src/lib.rs b/examples/the-purple-night/src/lib.rs index a65be820..d3a45474 100644 --- a/examples/the-purple-night/src/lib.rs +++ b/examples/the-purple-night/src/lib.rs @@ -2066,10 +2066,6 @@ impl<'a> Game<'a> { .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 { self.particles.remove(i); } @@ -2274,6 +2270,9 @@ fn game_with_level(gba: &mut agb::Gba) { sfx.frame(); vblank.wait_for_vblank(); 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) { GameStatus::Continue => {} GameStatus::Lost => {