From 4367287f9e07aca6a173a5eaef641a75918d66e0 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 20:02:16 +0400 Subject: fix(audio): start node-attached laser sounds during wind-up Use the weapon descriptor's Control group to select the mode-1 sound rows. Update them through the existing FX clock and spatial Op2 playback for both manual and autonomous weapons. The GOG Control/Effect entry points confirm the selector, epoch and phase threshold, including retriggering after a sample at the exact phase peak. The stock Two Fortresses helicopter started the original sound at both weapon nodes in a Vulkan window. --- apps/fparkan-game/src/player_fire.rs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'apps/fparkan-game/src/player_fire.rs') diff --git a/apps/fparkan-game/src/player_fire.rs b/apps/fparkan-game/src/player_fire.rs index 870dfe2f..b1be6551 100644 --- a/apps/fparkan-game/src/player_fire.rs +++ b/apps/fparkan-game/src/player_fire.rs @@ -3,25 +3,30 @@ use super::{ LegacyIron3dEulerTransform, PlayerProjectile, PreparedControlPoint, StaticVulkanApp, }; +use fparkan_runtime::FiringEffectInstance; + impl StaticVulkanApp { pub(super) fn sample_player_fire( &mut self, clock_ms: u32, - ) -> Vec<(usize, PreparedControlPoint)> { + ) -> ( + Vec<(usize, PreparedControlPoint)>, + Vec, + ) { let trigger = self.player_fire_held || self.player_fire_pressed; self.player_fire_pressed = false; let Some(cockpit) = self.cockpit else { - return Vec::new(); + return (Vec::new(), Vec::new()); }; if self.mission_frame.is_none() || !self .player_weapon_layouts .contains_key(&cockpit.object_index) { - return Vec::new(); + return (Vec::new(), Vec::new()); } let Some(weapons) = self.player_weapon_banks.get_mut(&cockpit.handle) else { - return Vec::new(); + return (Vec::new(), Vec::new()); }; if let Some(engine) = &self.mission_engine { weapons.read_control_energy(engine, cockpit.handle); @@ -33,7 +38,12 @@ impl StaticVulkanApp { if let Some(engine) = &mut self.mission_engine { weapons.publish_control_energy(engine, cockpit.handle); } - shots + ( + shots, + weapons + .started_windup_sounds(cockpit.object_index) + .collect(), + ) } pub(super) fn emit_player_shots( -- cgit v1.2.3