X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_audio.h;fp=player_audio.h;h=bfd93c4af0446f0174f53f3e9882d6542c960317;hb=2ab1c45f664daf5a452fd212c89dcfd918f7dd81;hp=8e5c0d2c83e7affb77a30396380bde604e7e05f1;hpb=d45f2b7d71311ce5ce8cd3496844b4ec7d2f46ac;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_audio.h b/player_audio.h index 8e5c0d2..bfd93c4 100644 --- a/player_audio.h +++ b/player_audio.h @@ -12,12 +12,13 @@ */ VG_STATIC void player_audio(void) { +#if 0 struct player_phys *phys = &player.phys; static int _air = 0; int l2 = _air; - _air = phys->in_air; + _air = player_skate.activity == k_skate_activity_air; static double last_revert = -2000.0; @@ -27,7 +28,8 @@ VG_STATIC void player_audio(void) audio_lock(); double revert_delta = vg.time - last_revert; - if( phys->on_board && (!_air && l2) && (revert_delta > 0.7) && + if( (phys->controller == k_player_controller_skate) && + (!_air && l2) && (revert_delta > 0.7) && (player.air_time > 0.5f) ) { audio_player_set_position( &audio_player_extra, phys->rb.co ); @@ -47,7 +49,8 @@ VG_STATIC void player_audio(void) } static float air = 0.0f; - air = vg_lerpf( air, phys->in_air? 1.0f: 0.0f, 5.0f*vg.time_delta ); + air = vg_lerpf( air, player_skate.activity == k_skate_activity_air, + 5.0f*vg.time_delta ); /* Spacial info */ v3f ears = { 1.0f,0.0f,0.0f }; @@ -110,7 +113,8 @@ VG_STATIC void player_audio(void) } } - if( freecam || player.is_dead || !phys->on_board ) + if( freecam || player.is_dead || + !(phys->controller != k_player_controller_skate)) { audio_player_set_vol( &audio_player0, 0.0f ); audio_player_set_vol( &audio_player1, 0.0f ); @@ -124,7 +128,8 @@ VG_STATIC void player_audio(void) else walk_phase = 0; - if( (player.step_phase != walk_phase) && !phys->in_air ) + if( (player.step_phase != walk_phase) && + !(player_walk.activity == k_walk_activity_air) ) { audio_player_set_flags( &audio_player_extra, AUDIO_FLAG_SPACIAL_3D ); audio_player_set_position( &audio_player_extra, phys->rb.co ); @@ -161,7 +166,7 @@ VG_STATIC void player_audio(void) float speed = vg_minf(v3_length( phys->rb.v )*0.1f,1.0f), attn = speed, slide = vg_clampf( fabsf(phys->slip), 0.0f, 1.0f ), - grind = phys->grind, + grind = player_skate.activity == k_skate_activity_grind, vol0 = (1.0f-air)*attn*(1.0f-slide)*(1.0f-grind), vol1 = air *attn*(1.0f-grind), vol2 = (1.0f-air)*attn*slide*(1.0f-grind), @@ -183,11 +188,11 @@ VG_STATIC void player_audio(void) #endif audio_unlock(); - if( player.phys.in_air ) + if( player_skate.activity == k_skate_activity_air ) player.air_time += vg.time_delta; else player.air_time = 0.0f; - +#endif } #endif /* PLAYER_AUDIO_H */