diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-12 19:01:27 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-12 19:01:27 -0400 |
| commit | a0a3b3974cab754c10a1517d82762b99482970ce (patch) | |
| tree | 8aeb0ca1e007bacecc8e12a263bd5aa321b8f69a /src/tacmap.rs | |
| parent | 7f63ec5c10eb7e8dd4edaabd1a6a437328911d39 (diff) | |
| download | systemic4x-main.tar.gz systemic4x-main.tar.bz2 systemic4x-main.zip | |
Diffstat (limited to 'src/tacmap.rs')
| -rw-r--r-- | src/tacmap.rs | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/tacmap.rs b/src/tacmap.rs index 9ff69f6..05747d4 100644 --- a/src/tacmap.rs +++ b/src/tacmap.rs @@ -101,16 +101,18 @@ impl TacticalMap self.camera_controller.keyboard_input(key_code, key_state); } - pub fn draw( + pub fn prepare( &mut self, + scene: &mut SceneCtx, wgpuctx: &WgpuCtx, - fleets_manager: &FleetsManager, + fleets_man: &FleetsManager, solar_system: &SolarSystem, timeman: &TimeMan, - ) -> Result<(), wgpu::SurfaceError> + ) -> Result<(), ()> { self.camera.update_buffer(wgpuctx, &self.pmatrix); - + self.camera.stage_changes(scene.encoder_mut()); + if self.system_for_render.is_none() || self.system_for_render.unwrap() != solar_system.id() { @@ -123,8 +125,12 @@ impl TacticalMap self.body_renderer.rebuild(wgpuctx, solar_system); self.orbit_renderer.rebuild(wgpuctx, solar_system); - match self.orbit_renderer.update(wgpuctx, solar_system, timeman.seconds()) - { + match self.orbit_renderer.update( + wgpuctx, + fleets_man, + solar_system, + timeman.seconds() + ){ Ok(()) => {}, Err(e) => println!("Tactical map orbit render update error: {}", e) } @@ -137,7 +143,7 @@ impl TacticalMap match self.fleet_renderer.update( wgpuctx, - fleets_manager, + fleets_man, solar_system, timeman.seconds()) { @@ -148,13 +154,6 @@ impl TacticalMap Ok(()) } - pub fn prepare( - &self, - scene: &mut SceneCtx) - { - self.camera.stage_changes(scene.encoder_mut()); - } - pub fn paint( &self, pass: &mut wgpu::RenderPass<'_>) |
