aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-01 10:43:57 +0300
committerValentin Popov <valentin@popov.link>2026-12-01 10:43:57 +0300
commitbf991ad728dd6cdc02168b4d6552f0e7e85181a2 (patch)
tree20f796e1fd77ec39a63f2f25a9a42f491dd9ce55 /apps/fparkan-game/src
parent6bd2930a1805ee27b32f9329fa8d9aeb16479da9 (diff)
downloadfparkan-bf991ad728dd6cdc02168b4d6552f0e7e85181a2.tar.xz
fparkan-bf991ad728dd6cdc02168b4d6552f0e7e85181a2.zip
fix(render): drive warbot muzzle flashes with firing phases
Use the first CPT node when the effect has no explicit override. Feed the autonomous weapon banks into the same phase sampling path as manual weapons. Confirm the effect constructor and phase reads in the original DLLs, and compare the two cannon flashes in a live AutoDemo window at the same clock sample.
Diffstat (limited to 'apps/fparkan-game/src')
-rw-r--r--apps/fparkan-game/src/control_effects.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/fparkan-game/src/control_effects.rs b/apps/fparkan-game/src/control_effects.rs
index 4cee2c16..e3dd50a0 100644
--- a/apps/fparkan-game/src/control_effects.rs
+++ b/apps/fparkan-game/src/control_effects.rs
@@ -5,8 +5,8 @@ use super::{
};
use fparkan_fx::clock::{FxInstanceClock, FxPhaseProvider};
use fparkan_runtime::{
- control_damage_alarm_active, loaded_mission_assets, loaded_mission_control_device_tables,
- AutoDemoCombatEvent, Engine, FiringEffectInstance,
+ autonomous_firing_effect_phases, control_damage_alarm_active, loaded_mission_assets,
+ loaded_mission_control_device_tables, AutoDemoCombatEvent, Engine, FiringEffectInstance,
};
use std::collections::{HashMap, HashSet};
@@ -78,6 +78,11 @@ impl StaticVulkanApp {
})
.into_iter()
.flatten()
+ .chain(
+ self.mission_engine
+ .iter()
+ .flat_map(autonomous_firing_effect_phases),
+ )
.map(|(effect, phase)| (effect.into(), phase))
.collect();
let mut samples = advance_control_effect_instances(
@@ -115,7 +120,7 @@ impl StaticVulkanApp {
player_shots,
&weapon_phases,
);
- // Manual weapon audio is already emitted with the projectile.
+ // Weapon one-shots are already emitted with the projectile.
direct_shot_sounds.extend(self.control_sound_slots.iter().filter_map(|sound| {
let key = sound.effect.random_instance_key;
(sound.effect.time_mode == 4 && weapon_phases.contains_key(&key)).then_some(key)