refactor: update debug state management and rendering systems

This commit is contained in:
Ryan Walters
2025-08-19 11:31:31 -05:00
parent 5109457fcd
commit 8b5e66f514
5 changed files with 90 additions and 90 deletions

View File

@@ -251,14 +251,13 @@ impl Game {
backbuffer: NonSendMut<BackbufferResource>,
debug_state: Res<DebugState>,
mut dirty: ResMut<RenderDirty>| {
if dirty.0 || *debug_state != DebugState::Off {
if dirty.0 || debug_state.enabled {
// Only copy backbuffer to main canvas if debug rendering is off
// (debug rendering draws directly to main canvas)
if *debug_state == DebugState::Off {
canvas.copy(&backbuffer.0, None, None).unwrap();
if !debug_state.enabled {
canvas.present();
}
dirty.0 = false;
canvas.present();
}
},
),