X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=audio.h;h=8282c068183669efddbea0437be3fa96e56cdb10;hb=1142fd5c27cf6d5bef073969b55e20b160646164;hp=43adf052e289077ef860e1ef8ba82f1452b3d1b8;hpb=ec0918b2ef17a71418a57417689fd3042915aeeb;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/audio.h b/audio.h index 43adf05..8282c06 100644 --- a/audio.h +++ b/audio.h @@ -19,7 +19,10 @@ audio_clip audio_board[] = { .path="sound/skate.ogg" }, { .path="sound/wheel.ogg" }, { .path="sound/slide.ogg" }, - { .path="sound/reverb.ogg" } + { .path="sound/reverb.ogg" }, + { .path="sound/grind_loop.ogg" }, + { .path="sound/grind_enter.ogg" }, + { .path="sound/grind_exit.ogg" } }; audio_clip audio_splash = @@ -149,6 +152,11 @@ audio_player audio_player3 = .name = "Player3", }; +audio_player audio_player4 = +{ + .name = "Player4", +}; + audio_player audio_player_extra = { .name = "PlayerInst" @@ -165,6 +173,7 @@ VG_STATIC void audio_init(void) audio_player_init( &audio_player1 ); audio_player_init( &audio_player2 ); audio_player_init( &audio_player3 ); + audio_player_init( &audio_player4 ); audio_player_init( &audio_player_gate ); audio_player_init( &ambient_player ); audio_player_init( &ambient_sprites[0] ); @@ -198,6 +207,7 @@ VG_STATIC void audio_init(void) audio_player_set_flags( &audio_player0, flags ); audio_player_set_flags( &audio_player1, flags ); audio_player_set_flags( &audio_player2, flags ); + audio_player_set_flags( &audio_player4, flags ); audio_player_set_flags( &audio_player_gate, flags ); audio_player_set_flags( &audio_player3, AUDIO_FLAG_LOOP ); audio_player_set_flags( &ambient_player, AUDIO_FLAG_LOOP ); @@ -215,6 +225,7 @@ VG_STATIC void audio_init(void) audio_player_playclip( &audio_player1, &audio_board[1] ); audio_player_playclip( &audio_player2, &audio_board[2] ); audio_player_playclip( &audio_player3, &audio_board[3] ); + audio_player_playclip( &audio_player4, &audio_board[4] ); audio_player_playclip( &ambient_player, &audio_ambience[0] ); audio_player_playclip( &audio_player_gate, &audio_gate_ambient ); @@ -237,7 +248,7 @@ VG_STATIC void audio_init(void) }); } -VG_STATIC void audio_free(void*_) +VG_STATIC void audio_free(void) { /* TODO! */ vg_warn( "UNIMPLEMENTED: audio_free()\n" ); @@ -294,7 +305,7 @@ VG_STATIC void audio_sample_occlusion( v3f origin ) float occlusion = 1.0f - (d * (1.0f/(sample_dist*(float)sample_count))), rate = VG_TIMESTEP_FIXED * k_audio_occlusion_rate, - target = powf( occlusion, 6.0f ); + target = powf( vg_maxf(occlusion,0.0f), 6.0f ); audio_occlusion_current = vg_lerpf( audio_occlusion_current, target, rate ); }