From b0c3a064c29c2bf97981f45806696c2dd0d4dd90 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 07:24:01 +0400 Subject: feat(ui): preview new warbot geometry during a mission On stock Field Camp, open a compatible Unit DAT created after start, resize the preview, switch to a resident project, reopen the new project, and return to the mission with Vulkan validation clean. The factory reserve for new geometry is still prepared at mission load. --- apps/fparkan-game/src/designer_model.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'apps/fparkan-game/src/designer_model.rs') diff --git a/apps/fparkan-game/src/designer_model.rs b/apps/fparkan-game/src/designer_model.rs index 19f3fba2..9bf24600 100644 --- a/apps/fparkan-game/src/designer_model.rs +++ b/apps/fparkan-game/src/designer_model.rs @@ -13,7 +13,7 @@ const HALF_FOV: f32 = std::f32::consts::FRAC_PI_6; pub(super) struct DesignerModels(Vec>); -struct DesignerModel { +pub(super) struct DesignerModel { draws: Range, counts: Vec, center: [f32; 3], @@ -67,6 +67,14 @@ impl DesignerModels { } impl DesignerModel { + pub(super) fn uploaded(draws: Range, center: [f32; 3], radius: f32) -> Self { + Self { + draws, + counts: Vec::new(), + center, + radius, + } + } fn prepare(root: usize, scene: &mut StaticPreviewScene) -> Result, String> { let source = scene.dynamic_component_geometry[root] .iter() @@ -151,7 +159,7 @@ impl DesignerModel { })) } - fn view(&self, elapsed_ms: u32, drawable: [f32; 2]) -> VulkanModelPreview { + pub(super) fn view(&self, elapsed_ms: u32, drawable: [f32; 2]) -> VulkanModelPreview { let yaw = elapsed_ms as f64 * f64::from(SPIN_RADIANS_PER_MS); let (sin_yaw, cos_yaw) = yaw.sin_cos(); let (sin_elevation, cos_elevation) = ELEVATION.sin_cos(); @@ -190,6 +198,7 @@ impl DesignerModel { }; VulkanModelPreview { ranges: self.draws.clone(), + draw_before: None, viewport, camera, eye, -- cgit v1.2.3