From 2e0a4571af587f28ba5ea580f177a225d0d352e2 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 20:09:41 +0400 Subject: fix(audio): attach the engine loop to the player's missile Prepare velocity-driven Op2 sounds with the projectile's CTL attachment. Move their source with the active flight and stop it when the flight ends or its slot is reused. Keep launch as a separate one-shot. The GOG phase function confirms the missile's 0 to 1 phase range. In the stock Firing Line window the engine loop began at the tail and stopped on terrain contact. --- apps/fparkan-game/src/projectile_trail.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'apps/fparkan-game/src/projectile_trail.rs') diff --git a/apps/fparkan-game/src/projectile_trail.rs b/apps/fparkan-game/src/projectile_trail.rs index bcadb7ba..4e01afc5 100644 --- a/apps/fparkan-game/src/projectile_trail.rs +++ b/apps/fparkan-game/src/projectile_trail.rs @@ -1,9 +1,9 @@ use super::{ ambient_effect_pipeline_state, append_environment_range, environment_vertex, - prepare_effect_material, quad_indices, EnvironmentGpuRange, PreparedEffectMaterial, - StaticPreviewScene, + prepare_effect_material, projectile_render::ProjectileEffect, quad_indices, + EnvironmentGpuRange, PreparedEffectMaterial, StaticPreviewScene, }; -use fparkan_fx::{op5::TrailLayer, FxDocument, FxOpcode}; +use fparkan_fx::{op5::TrailLayer, FxOpcode}; use std::{collections::HashMap, path::Path}; pub(super) struct ProjectileTrail { @@ -14,13 +14,18 @@ pub(super) struct ProjectileTrail { pub(super) fn prepare( root: &Path, - effects: &[(String, FxDocument)], + effects: &[ProjectileEffect<'_>], name: &str, preview: &mut StaticPreviewScene, cache: &mut HashMap, ) -> Vec<(TrailLayer, usize, fparkan_render::LegacyPipelineState)> { let mut layers = Vec::new(); - for (effect, document) in effects { + for ProjectileEffect { + resource: effect, + document, + .. + } in effects + { let header = document.header(); let [scale, sy, sz] = header.scale; for command in document -- cgit v1.2.3