diff --git a/src/core/app.rs b/src/core/app.rs index 0c5e04e..e5f1cb0 100644 --- a/src/core/app.rs +++ b/src/core/app.rs @@ -109,8 +109,7 @@ impl<'window> App<'window> { // !Hack: As far as I know I can't propagate errors out of here. So for now just ignore them let _ = renderer.render(&self.render_ctx); - let _ = renderer.update(&dt, &self.render_ctx); - renderer.update_brickmap(&self.render_ctx, &mut world); + let _ = renderer.update(&dt, &self.render_ctx, &mut world); // Simple framerate tracking self.render_ctx.window.set_title(&format!( diff --git a/src/voxel/brickmap/renderer.rs b/src/voxel/brickmap/renderer.rs index ce622a0..f3bf8c8 100644 --- a/src/voxel/brickmap/renderer.rs +++ b/src/voxel/brickmap/renderer.rs @@ -185,11 +185,6 @@ impl BrickmapRenderer { unpack_bind_group, }) } - - pub fn update_brickmap(&mut self, context: &gfx::Context, world: &mut WorldManager) { - self.brickmap_manager - .process_feedback_buffer(context, world); - } } impl VoxelRenderer for BrickmapRenderer { @@ -249,7 +244,14 @@ impl VoxelRenderer for BrickmapRenderer { Ok(()) } - fn update(&mut self, _dt: &Duration, _context: &gfx::Context) -> Result<()> { + fn update( + &mut self, + _dt: &Duration, + context: &gfx::Context, + world: &mut WorldManager, + ) -> Result<()> { + self.brickmap_manager + .process_feedback_buffer(context, world); Ok(()) } } diff --git a/src/voxel/renderer.rs b/src/voxel/renderer.rs index f66ff00..adf79c6 100644 --- a/src/voxel/renderer.rs +++ b/src/voxel/renderer.rs @@ -2,9 +2,10 @@ use std::time::Duration; use anyhow::Result; +use super::world::WorldManager; use crate::gfx::Context; pub trait VoxelRenderer { - fn update(&mut self, dt: &Duration, context: &Context) -> Result<()>; + fn update(&mut self, dt: &Duration, context: &Context, world: &mut WorldManager) -> Result<()>; fn render(&self, context: &Context) -> Result<()>; }