diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 13:08:44 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 13:08:44 +0300 |
| commit | bfc283603ff9fc48b2dff3673a56f7ad481e1031 (patch) | |
| tree | 9e44fadbde26b49595f09a595f91e0e4580ea9a4 /apps/fparkan-game/src/main.rs | |
| parent | 514136ca97191672ecd24173d1836cdc4d26493b (diff) | |
| download | fparkan-bfc283603ff9fc48b2dff3673a56f7ad481e1031.tar.xz fparkan-bfc283603ff9fc48b2dff3673a56f7ad481e1031.zip | |
feat(player): play footsteps on ground and building floors
Select the original step effects from the hero's Control rows. A footfall follows the accepted movement and the camera rhythm. The Firing Range window starts the ground sound on the step and stays quiet when the player stops.
Diffstat (limited to 'apps/fparkan-game/src/main.rs')
| -rw-r--r-- | apps/fparkan-game/src/main.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index f06b5d05..6a1a046a 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -20,6 +20,7 @@ mod mission_notices; mod mission_pause; mod player_collision; mod player_fire; +mod player_footsteps; mod projectile_render; mod projectile_trail; mod shield_effects; @@ -9822,6 +9823,10 @@ fn run_static_vulkan_mode( } app.demo_camera = demo_camera; app.cockpit = cockpit; + if let Some((engine, cockpit)) = app.mission_engine.as_ref().zip(cockpit) { + app.player_footsteps = + player_footsteps::PlayerFootsteps::load(root, engine, cockpit).unwrap_or_default(); + } app.player_weapon_layouts = player_weapon_layouts; if let Some(cockpit) = cockpit { let layout = &app.player_weapon_layouts[&cockpit.object_index]; @@ -10016,6 +10021,7 @@ struct StaticVulkanApp { projectile_draws: Vec<Option<ProjectileDraw>>, autodemo_draws: Vec<Option<ProjectileDraw>>, autonomous_shot_sounds: Vec<Option<Op2SoundCommand>>, + player_footsteps: player_footsteps::PlayerFootsteps, destruction_effects: Option<destruction_effects::DestructionEffects>, shield_effects: Option<shield_effects::ShieldEffects>, player_fire_held: bool, @@ -10165,6 +10171,7 @@ impl StaticVulkanApp { projectile_draws: Vec::new(), autodemo_draws: Vec::new(), autonomous_shot_sounds: Vec::new(), + player_footsteps: Default::default(), destruction_effects: None, shield_effects: None, player_fire_held: false, @@ -11276,6 +11283,9 @@ impl StaticVulkanApp { self.present_mission_notice(notice, control_clock_ms); } if let Some(audio) = self.audio.as_mut() { + if let Some(footstep) = frame.player_footstep { + self.player_footsteps.play(audio, footstep); + } shot_sound::play_autonomous( &self.autonomous_shot_sounds, &frame.autodemo_combat_events, |
