From: hgn Date: Tue, 21 Nov 2023 11:09:04 +0000 (+0000) Subject: forgot to lock! X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=f2c77307831c6f971dcad62552cbe57fa99bce98;hp=7a6ce9a58463f0123223f2b379d90fb6305bad8f;p=carveJwlIkooP6JGAAIwe30JlM.git forgot to lock! --- diff --git a/audio.h b/audio.h index dbd6fc7..5e29a96 100644 --- a/audio.h +++ b/audio.h @@ -126,6 +126,7 @@ audio_clip audio_rewind[] = { audio_clip audio_ui[] = { { .path = "sound/ui_click.ogg" }, { .path = "sound/ui_ding.ogg" }, + { .path = "sound/teleport.ogg" } }; audio_clip audio_challenge[] = { diff --git a/ent_challenge.c b/ent_challenge.c index b8f2f5e..72149b1 100644 --- a/ent_challenge.c +++ b/ent_challenge.c @@ -67,8 +67,10 @@ static void ent_challenge_preupdate( ent_challenge *challenge, int active ){ world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; world_static.focused_entity = 0; + audio_lock(); audio_oneshot_3d( &audio_challenge[6], localplayer.rb.co, 30.0f, 1.0f ); + audio_unlock(); } return; } @@ -92,7 +94,9 @@ static void ent_challenge_preupdate( ent_challenge *challenge, int active ){ next = objective->id_next; v3_fill( objective->transform.s, 1.0f ); } + audio_lock(); audio_oneshot( &audio_challenge[5], 1.0f, 0.0f ); + audio_unlock(); return; } } @@ -101,7 +105,9 @@ static void ent_challenge_preupdate( ent_challenge *challenge, int active ){ world_static.challenge_target = NULL; world_entity_unfocus(); gui_helper_clear(); + audio_lock(); audio_oneshot( &audio_challenge[4], 1.0f, 0.0f ); + audio_unlock(); return; } } diff --git a/ent_miniworld.c b/ent_miniworld.c index c56fa18..9d1d615 100644 --- a/ent_miniworld.c +++ b/ent_miniworld.c @@ -184,6 +184,9 @@ static void ent_miniworld_preupdate(void){ srinput.state = k_input_state_resume; menu.disable_open = 0; gui_helper_clear(); + audio_lock(); + audio_oneshot( &audio_ui[2], 1.0f, 0.0f ); + audio_unlock(); } else { if( global_miniworld.mode == 1 ){ @@ -213,6 +216,10 @@ static void ent_miniworld_preupdate(void){ } static void ent_miniworld_goback(void){ + audio_lock(); + audio_oneshot( &audio_ui[2], 1.0f, 0.0f ); + audio_unlock(); + global_miniworld.transition = -1; global_miniworld.t = 1.0f; diff --git a/ent_objective.c b/ent_objective.c index 0cf5790..97e33d8 100644 --- a/ent_objective.c +++ b/ent_objective.c @@ -21,13 +21,17 @@ static void ent_objective_pass( world_instance *world, ent_objective_pass( world, next ); else{ vg_info( "pass challenge point\n" ); + audio_lock(); audio_oneshot_3d( &audio_challenge[0], localplayer.rb.co, 30.0f, 1.0f ); + audio_unlock(); } } else { vg_success( "challenge win\n" ); + audio_lock(); audio_oneshot( &audio_challenge[2], 1.0f, 0.0f ); + audio_unlock(); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; world_static.focused_entity = 0; @@ -107,8 +111,10 @@ static void ent_objective_call( world_instance *world, ent_call *call ){ ent_objective_pass( world, objective ); } else { + audio_lock(); audio_oneshot_3d( &audio_challenge[6], localplayer.rb.co, 30.0f, 1.0f ); + audio_unlock(); vg_error( "challenge failed\n" ); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; diff --git a/sound_src/teleport.ogg b/sound_src/teleport.ogg new file mode 100644 index 0000000..dfce51e Binary files /dev/null and b/sound_src/teleport.ogg differ