From dcba82d1cdf4a70ab879d8af0a623a10deecb544 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 08:00:08 +0400 Subject: feat(factory): build newly loaded projects without restarting the mission Transfer a saved design from the original designer panel, prepare it with the regular AniMesh scene builder, and queue the selected factory order. Appended world batches keep existing draw handles and gain the normal cockpit, walking animation, weapon and shield bindings. The Field Camp window witness adds a one-gun Unit DAT after mission start, uses the normal transfer and order controls, supplies the factory with a scripted test fixture, and captures the released unit with Vulkan validation clean. The two licensed factory tests also verify the assembled component records and weapon control. --- apps/fparkan-game/src/shield_effects.rs | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'apps/fparkan-game/src/shield_effects.rs') diff --git a/apps/fparkan-game/src/shield_effects.rs b/apps/fparkan-game/src/shield_effects.rs index 1bf0ede9..7f6a4e76 100644 --- a/apps/fparkan-game/src/shield_effects.rs +++ b/apps/fparkan-game/src/shield_effects.rs @@ -58,11 +58,27 @@ impl ShieldEffects { root: &Path, engine: &Engine, preview: &mut StaticPreviewScene, + ) -> Result { + Self::prepare_sources( + root, + shield_effect_sources(engine), + &mut preview.mesh, + &mut preview.materials, + &mut preview.material_animations, + ) + } + + pub(super) fn prepare_sources( + root: &Path, + sources: impl Iterator, + mesh: &mut VulkanStaticMesh, + scene_materials: &mut Vec, + animations: &mut Vec, ) -> Result { let mut effects = Self::default(); let mut documents: HashMap<_, Option>> = HashMap::new(); let mut materials: HashMap = HashMap::new(); - for (index, source) in shield_effect_sources(engine).collect::>() { + for (index, source) in sources.collect::>() { let (archive, name) = &source; let document = documents.entry(source.clone()).or_insert_with(|| { let bytes = load_resource_entry_bytes_from_root(root, archive, name).ok()?; @@ -82,7 +98,7 @@ impl ShieldEffects { root, std::str::from_utf8(material.archive_name()).ok()?, std::str::from_utf8(material.resource_name()).ok()?, - &mut preview.materials, + scene_materials, &mut materials, ) .ok() @@ -118,7 +134,7 @@ impl ShieldEffects { primitive.vertex_count ]; let range = append_environment_range( - &mut preview.mesh, + mesh, first, vertices, ambient_effect_mesh_primitive_indices(&template, primitive)?, @@ -127,7 +143,7 @@ impl ShieldEffects { let binding = append_effect_material_animation( &material, range.range_index, - &mut preview.material_animations, + animations, ); effects.ranges.insert(range.range_index, range); ranges.push((range, binding)); @@ -154,6 +170,11 @@ impl ShieldEffects { Ok(effects) } + pub(super) fn extend(&mut self, other: Self) { + self.shields.extend(other.shields); + self.ranges.extend(other.ranges); + } + pub(super) fn ranges(&self) -> impl Iterator + '_ { self.ranges.keys().copied() } -- cgit v1.2.3