X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_audio.h;h=727080cea20c36bc5cf93d996d2aa94436cdeeaa;hb=6294ef64d948eab2365e39a2645c9843aa96fba8;hp=298ce0f0dab5994bcdd6e0d1f62e70a996983b78;hpb=47941822dae18a018c985847b052e70214a3ccc6;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_audio.h b/player_audio.h index 298ce0f..727080c 100644 --- a/player_audio.h +++ b/player_audio.h @@ -103,7 +103,8 @@ VG_STATIC void player_audio(void) } else if( sprite_type == k_audio_sprite_type_water ) { - audio_player_playclip( avail, &audio_water[rand()%6] ); + if( world.water.enabled ) + audio_player_playclip( avail, &audio_water[rand()%6] ); } } } @@ -126,8 +127,28 @@ VG_STATIC void player_audio(void) audio_player_set_flags( &audio_player_extra, AUDIO_FLAG_SPACIAL_3D ); audio_player_set_position( &audio_player_extra, phys->rb.co ); audio_player_set_vol( &audio_player_extra, 6.0f ); - audio_player_playclip( &audio_player_extra, - &audio_footsteps[rand()%4] ); + + if( player.surface_prop == k_surface_prop_concrete ) + { + audio_player_playclip( + &audio_player_extra, + &audio_footsteps[rand()%vg_list_size(audio_footsteps)] + ); + } + else if( player.surface_prop == k_surface_prop_grass ) + { + audio_player_playclip( + &audio_player_extra, + &audio_footsteps_grass[rand()%vg_list_size(audio_footsteps_grass)] + ); + } + else if( player.surface_prop == k_surface_prop_wood ) + { + audio_player_playclip( + &audio_player_extra, + &audio_footsteps_wood[rand()%vg_list_size(audio_footsteps_wood)] + ); + } } player.step_phase = walk_phase;