From 59e212c197e8ad5e2c5c927d611758f37d4b91b8 Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Tue, 11 Jan 2022 12:31:53 +1100 Subject: [PATCH] Document code_8006BA00 (Audio Sound Sources) (#997) * Document SoundSources * PR Suggestions * Duration timers to dec * `PlaySfxByPosAndId` -> `PlaySoundByPosition` * Improve names * `PlaySfxAtStationaryPosition` -> `PlaySfxAtFixedWorldPos` and `originWorldPos` -> `worldPos` * format --- assets/xml/objects/object_link_boy.xml | 2 +- include/functions.h | 6 +++--- include/z64.h | 4 ++-- spec | 2 +- src/code/z_actor.c | 2 +- src/code/z_play.c | 4 ++-- .../{code_8006BA00.c => z_sound_source.c} | 20 ++++++++++--------- .../ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 2 +- .../actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c | 2 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 2 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 3 ++- .../z_bg_hidan_kowarerukabe.c | 4 ++-- .../ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c | 4 ++-- .../ovl_Bg_Ice_Turara/z_bg_ice_turara.c | 2 +- .../z_bg_jya_bombchuiwa.c | 2 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 2 +- .../ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c | 2 +- .../ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c | 3 ++- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 4 ++-- .../z_bg_spot01_idohashira.c | 2 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c | 2 +- .../z_bg_spot08_bakudankabe.c | 2 +- .../z_bg_spot11_bakudankabe.c | 2 +- .../z_bg_spot16_bombstone.c | 2 +- .../z_bg_spot17_bakudankabe.c | 2 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 15 ++++++++------ src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 2 +- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 2 +- src/overlays/actors/ovl_Demo_Go/z_demo_go.c | 2 +- src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c | 4 ++-- .../actors/ovl_Door_Killer/z_door_killer.c | 4 ++-- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 2 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 2 +- src/overlays/actors/ovl_En_Bili/z_en_bili.c | 2 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 2 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 2 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 5 +++-- src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 2 +- .../actors/ovl_En_Fire_Rock/z_en_fire_rock.c | 2 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 2 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 2 +- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 4 ++-- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 2 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 11 +++++----- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 8 ++++---- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 3 +-- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 2 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 4 ++-- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 4 ++-- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 2 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 2 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 4 ++-- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 16 +++++++-------- src/overlays/actors/ovl_En_Vali/z_en_vali.c | 2 +- src/overlays/actors/ovl_En_Xc/z_en_xc.c | 2 +- .../actors/ovl_En_Yukabyun/z_en_yukabyun.c | 2 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 2 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 8 ++++---- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 4 ++-- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 8 ++++---- 62 files changed, 119 insertions(+), 111 deletions(-) rename src/code/{code_8006BA00.c => z_sound_source.c} (63%) diff --git a/assets/xml/objects/object_link_boy.xml b/assets/xml/objects/object_link_boy.xml index 82642a7ba6..2f3cd943ca 100644 --- a/assets/xml/objects/object_link_boy.xml +++ b/assets/xml/objects/object_link_boy.xml @@ -268,4 +268,4 @@ - \ No newline at end of file + diff --git a/include/functions.h b/include/functions.h index 3e84c6f6c5..ce71b04947 100644 --- a/include/functions.h +++ b/include/functions.h @@ -829,9 +829,9 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx); void Cutscene_SetSegment(GlobalContext* globalCtx, void* segment); void* MemCopy(void* dest, void* src, s32 size); void GetItem_Draw(GlobalContext* globalCtx, s16 drawId); -void func_8006BA00(GlobalContext* globalCtx); -void func_8006BA30(GlobalContext* globalCtx); -void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos, s32 duration, u16 sfxId); +void SoundSource_InitAll(GlobalContext* globalCtx); +void SoundSource_UpdateAll(GlobalContext* globalCtx); +void SoundSource_PlaySfxAtFixedWorldPos(GlobalContext* globalCtx, Vec3f* pos, s32 duration, u16 sfxId); u16 ElfMessage_GetSariaText(GlobalContext* globalCtx); u16 ElfMessage_GetCUpText(GlobalContext* globalCtx); u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet); diff --git a/include/z64.h b/include/z64.h index 51de8b05e3..3f417ab13c 100644 --- a/include/z64.h +++ b/include/z64.h @@ -282,8 +282,8 @@ typedef struct { typedef struct { /* 0x00 */ u16 countdown; - /* 0x04 */ Vec3f originPos; - /* 0x10 */ Vec3f relativePos; + /* 0x04 */ Vec3f worldPos; + /* 0x10 */ Vec3f projectedPos; } SoundSource; // size = 0x1C typedef enum { diff --git a/spec b/spec index b1d7b628c7..c45195200f 100644 --- a/spec +++ b/spec @@ -314,7 +314,7 @@ beginseg include "build/src/code/z_demo.o" include "build/src/code/code_80069420.o" include "build/src/code/z_draw.o" - include "build/src/code/code_8006BA00.o" + include "build/src/code/z_sound_source.o" include "build/src/code/z_elf_message.o" include "build/src/code/z_face_reaction.o" include "build/src/code/code_8006C3A0.o" diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 7f77064c61..a46fdb52f1 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -2986,7 +2986,7 @@ Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory) { */ void Enemy_StartFinishingBlow(GlobalContext* globalCtx, Actor* actor) { globalCtx->actorCtx.freezeFlashTimer = 5; - Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE); } s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { diff --git a/src/code/z_play.c b/src/code/z_play.c index 787bbb1865..672eb0b14e 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -228,7 +228,7 @@ void Gameplay_Init(GameState* thisx) { func_80112098(globalCtx); Message_Init(globalCtx); GameOver_Init(globalCtx); - func_8006BA00(globalCtx); + SoundSource_InitAll(globalCtx); Effect_InitContext(globalCtx); EffectSs_InitInfo(globalCtx, 0x55); CollisionCheck_InitContext(globalCtx, &globalCtx->colChkCtx); @@ -975,7 +975,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3771); } - func_8006BA30(globalCtx); + SoundSource_UpdateAll(globalCtx); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 3777); diff --git a/src/code/code_8006BA00.c b/src/code/z_sound_source.c similarity index 63% rename from src/code/code_8006BA00.c rename to src/code/z_sound_source.c index 9cc18bfa57..ce54ee3939 100644 --- a/src/code/code_8006BA00.c +++ b/src/code/z_sound_source.c @@ -1,6 +1,6 @@ #include "global.h" -void func_8006BA00(GlobalContext* globalCtx) { +void SoundSource_InitAll(GlobalContext* globalCtx) { SoundSource* sources = &globalCtx->soundSources[0]; s32 i; @@ -9,16 +9,16 @@ void func_8006BA00(GlobalContext* globalCtx) { // clang-format on } -void func_8006BA30(GlobalContext* globalCtx) { +void SoundSource_UpdateAll(GlobalContext* globalCtx) { SoundSource* source = &globalCtx->soundSources[0]; s32 i; for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) { if (source->countdown != 0) { if (DECR(source->countdown) == 0) { - Audio_StopSfxByPos(&source->relativePos); + Audio_StopSfxByPos(&source->projectedPos); } else { - SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &source->originPos, &source->relativePos); + SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &source->worldPos, &source->projectedPos); } } @@ -26,7 +26,7 @@ void func_8006BA30(GlobalContext* globalCtx) { } } -void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos, s32 duration, u16 sfxId) { +void SoundSource_PlaySfxAtFixedWorldPos(GlobalContext* globalCtx, Vec3f* worldPos, s32 duration, u16 sfxId) { s32 countdown; SoundSource* source; s32 smallestCountdown = 0xFFFF; @@ -39,6 +39,7 @@ void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos, s32 duratio break; } + // Store the sound source with the smallest remaining countdown countdown = source->countdown; if (countdown < smallestCountdown) { smallestCountdown = countdown; @@ -47,14 +48,15 @@ void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos, s32 duratio source++; } + // If no sound source is available, replace the sound source with the smallest remaining countdown if (i >= ARRAY_COUNT(globalCtx->soundSources)) { source = backupSource; - Audio_StopSfxByPos(&source->relativePos); + Audio_StopSfxByPos(&source->projectedPos); } - source->originPos = *pos; + source->worldPos = *worldPos; source->countdown = duration; - SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &source->originPos, &source->relativePos); - Audio_PlaySoundGeneral(sfxId, &source->relativePos, 4, &D_801333E0, &D_801333E0, &D_801333E8); + SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &source->worldPos, &source->projectedPos); + Audio_PlaySoundGeneral(sfxId, &source->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index d48c5d63f5..e2c51a7a83 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -212,7 +212,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { } func_80033DB8(globalCtx, 10, 15); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 0x28, NA_SE_EV_BOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_BOX_BREAK); } Actor_Kill(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 2f9d2d6e79..a7e8732054 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -100,7 +100,7 @@ void BgHakaHuta_PlaySound(BgHakaHuta* this, GlobalContext* globalCtx, u16 sfx) { : this->dyna.actor.world.pos.z - 120.0f; pos.x = this->dyna.actor.world.pos.x; pos.y = this->dyna.actor.world.pos.y; - Audio_PlaySoundAtPosition(globalCtx, &pos, 30, sfx); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &pos, 30, sfx); } void BgHakaHuta_SpawnEnemies(BgHakaHuta* this, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index bfd7f198ac..e03caac417 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -127,7 +127,7 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) { pos.z = this->dyna.actor.world.pos.z; pos.y = this->dyna.actor.world.pos.y + 80.0f; EffectSsBomb2_SpawnLayered(globalCtx, &pos, &sZeroVector, &sZeroVector, 100, 45); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_BOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_BOX_BREAK); EffectSsHahen_SpawnBurst(globalCtx, &pos, 20.0f, 0, 350, 100, 50, OBJECT_HAKA_OBJECTS, 40, gEffFragments2DL); this->dropTimer = 5; diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index f505d554fd..4fcc16b09a 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -408,7 +408,8 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, GlobalContext* globalCtx) { Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); Quake_SetCountdown(quakeIndex, 999); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 30, + NA_SE_EV_ELECTRIC_EXPLOSION); return; case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 8daeee396d..ad17a3ec47 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -307,9 +307,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); if ((this->dyna.actor.params & 0xFF) == 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); } else { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); } func_80078884(NA_SE_SY_CORRECT_CHIME); diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 0ff881af17..bae0ba0b96 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -97,7 +97,7 @@ void BgIceShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) { if (Flags_GetTempClear(globalCtx, this->dyna.actor.room)) { Flags_SetClear(globalCtx, this->dyna.actor.room); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80891DD4; if (this->dyna.actor.shape.rot.x == 0) { OnePointCutscene_Attention(globalCtx, &this->dyna.actor); @@ -107,7 +107,7 @@ void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) { void func_80891D6C(BgIceShutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params)) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80891DD4; OnePointCutscene_Attention(globalCtx, &this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index 355649d3ef..fe2b8ed57a 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -96,7 +96,7 @@ void BgIceTurara_Break(BgIceTurara* this, GlobalContext* globalCtx, f32 arg2) { s32 j; s32 i; - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ICE_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ICE_BROKEN); for (i = 0; i < 2; i++) { for (j = 0; j < 10; j++) { pos.x = this->dyna.actor.world.pos.x + Rand_CenteredFloat(8.0f); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index 7d4b4ff3e8..02b0584642 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -149,7 +149,7 @@ void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* glob if (this->timer > 10) { BgJyaBombchuiwa_Break(this, globalCtx); BgJyaBombchuiwa_CleanUpAfterExplosion(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); } } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index a126793e4e..8568a78d50 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -165,7 +165,7 @@ void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index 270f31959b..1e636f163d 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -188,7 +188,7 @@ void BgJyaHaheniron_SetupRubbleCollide(BgJyaHaheniron* this) { void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx) { if (this->timer >= 17) { BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987AC); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index 879766bc8c..186fcddbf0 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -248,7 +248,8 @@ void func_808992E8(BgJyaIronobj* this, GlobalContext* globalCtx) { this->colCylinder.base.acFlags &= ~AC_HIT; if (actor != NULL && actor->id == ACTOR_EN_IK) { particleFunc[this->dyna.actor.params & 1](this, globalCtx, (EnIk*)actor); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 80, + NA_SE_EN_IRONNACK_BREAK_PILLAR); dropPos.x = this->dyna.actor.world.pos.x; dropPos.y = this->dyna.actor.world.pos.y + 20.0f; dropPos.z = this->dyna.actor.world.pos.z; diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 0e584155d5..0d3f9813a7 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -191,7 +191,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) { if (this->lightTimer > 40) { Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); BgJyaMegami_SetupExplode(this); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); OnePointCutscene_Init(globalCtx, 3440, -99, &this->dyna.actor, MAIN_CAM); } else { if (this->lightTimer < 8) { @@ -230,7 +230,7 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) { this->explosionTimer++; if (this->explosionTimer == 30) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_BREAKDOWN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_BREAKDOWN); } for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 89f69ede01..6f66a72b2b 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -53,7 +53,7 @@ void BgSpot01Idohashira_PlayBreakSfx1(BgSpot01Idohashira* this) { } void BgSpot01Idohashira_PlayBreakSfx2(BgSpot01Idohashira* this, GlobalContext* globalCtx) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 60, NA_SE_EV_WOODBOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 60, NA_SE_EV_WOODBOX_BREAK); } void func_808AAD3C(GlobalContext* globalCtx, Vec3f* vec, u32 arg2) { diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index dcc5fcd177..294ff1e2db 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -78,7 +78,7 @@ void func_808AE5A8(BgSpot05Soko* this, GlobalContext* globalCtx) { void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_METALDOOR_CLOSE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_METALDOOR_CLOSE); Actor_SetFocus(&this->dyna.actor, 50.0f); OnePointCutscene_Attention(globalCtx, &this->dyna.actor); this->actionFunc = func_808AE630; diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index f24daa833c..b0b3efad3b 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -185,7 +185,7 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); } else if (this->dyna.actor.xzDistToPlayer < 800.0f) { diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index 5535336897..d1c057737d 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -137,7 +137,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { func_808B2218(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); - Audio_PlaySoundAtPosition(globalCtx, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); return; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index e3755f872c..ec2a2c4db2 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -512,7 +512,7 @@ void func_808B5B6C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (actor->bgCheckFlags & 8 || (actor->bgCheckFlags & 1 && actor->velocity.y < 0.0f)) { BgSpot16Bombstone_SpawnFragments(this, globalCtx); BgSpot16Bombstone_SpawnDust(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 20, NA_SE_EV_ROCK_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &actor->world.pos, 20, NA_SE_EV_ROCK_BROKEN); Actor_Kill(actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index 1a573f54b0..660c65841a 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -116,7 +116,7 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(globalCtx, &this->dyna.actor) != NULL) { func_808B6BC0(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 74ed18fe95..af5ddc928e 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -3984,7 +3984,8 @@ void BossGanon_LightBall_Update(Actor* thisx, GlobalContext* globalCtx2) { if (sqrtf(SQ(xDistFromLink) + SQ(yDistFromLink) + SQ(zDistFromLink)) <= 25.0f) { spBA = 5; func_8002F6D4(globalCtx, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x30); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_GANON_HIT_THUNDER); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, + NA_SE_EN_GANON_HIT_THUNDER); ganondorf->timers[2] = 20; for (i = 0; i < ARRAY_COUNT(ganondorf->unk_4E4); i++) { @@ -4026,8 +4027,9 @@ void BossGanon_LightBall_Update(Actor* thisx, GlobalContext* globalCtx2) { case 4: if (sqrtf(SQ(xDistFromGanondorf) + SQ(yDistFromGanondorf) + SQ(zDistFromGanondorf)) < 30.0f) { spBA = 3; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_GANON_DAMAGE1); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_GANON_HIT_THUNDER); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_GANON_DAMAGE1); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, + NA_SE_EN_GANON_HIT_THUNDER); } break; @@ -4083,7 +4085,7 @@ void BossGanon_LightBall_Update(Actor* thisx, GlobalContext* globalCtx2) { sp54 = 15.0f; phi_f20 = 30.0f; sp4E = 70; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_GANON_HIT_THUNDER); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_GANON_HIT_THUNDER); } for (i = 0; i < sp4E; i++) { @@ -4460,7 +4462,8 @@ void func_808E2544(Actor* thisx, GlobalContext* globalCtx) { if (dorf->timers[2] == 0) { func_8002F6D4(globalCtx, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x50); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_GANON_HIT_THUNDER); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, + NA_SE_EN_GANON_HIT_THUNDER); dorf->timers[2] = 20; for (i = 0; i < ARRAY_COUNT(this->unk_4E4); i++) { @@ -4528,7 +4531,7 @@ void func_808E2544(Actor* thisx, GlobalContext* globalCtx) { } if (numEffects) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_FANTOM_THUNDER); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_FANTOM_THUNDER); for (i = 0; i < numEffects; i++) { sp60.x = Rand_CenteredFloat(30.0f); diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 153b94aa9c..2c915251c2 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -1560,7 +1560,7 @@ void BossMo_DeathCs(BossMo* this, GlobalContext* globalCtx) { this->drawActor = false; this->actor.flags &= ~ACTOR_FLAG_0; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MOFER_CORE_JUMP); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 70, NA_SE_EN_MOFER_LASTVOICE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 70, NA_SE_EN_MOFER_LASTVOICE); } if (this->timers[0] == 0) { this->csState = MO_DEATH_DRAIN_WATER_1; diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index aa0c6c3c45..1132f71d97 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -137,7 +137,7 @@ void DemoGj_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void DemoGj_PlayExplosionSfx(DemoGj* this, GlobalContext* globalCtx) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_GRAVE_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_GRAVE_EXPLOSION); } void DemoGj_SpawnSmoke(GlobalContext* globalCtx, Vec3f* pos, f32 arg2) { diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 9138664786..1a1a142882 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -75,7 +75,7 @@ void func_8097C8A8(DemoGo* this, GlobalContext* globalCtx) { if ((thisx->params == 0) || (thisx->params == 1)) { SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &thisx->world.pos, &sp20, &sp1C); - Audio_PlaySoundAtPosition(globalCtx, &sp20, 20, NA_SE_EV_OBJECT_FALL); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &sp20, 20, NA_SE_EV_OBJECT_FALL); } } diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index e4d6d98d1b..b83feee592 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -24,11 +24,11 @@ void DemoGt_PlayEarthquakeSfx() { } void DemoGt_PlayExplosion1Sfx(GlobalContext* globalCtx, Vec3f* pos) { - Audio_PlaySoundAtPosition(globalCtx, pos, 60, NA_SE_IT_BOMB_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, pos, 60, NA_SE_IT_BOMB_EXPLOSION); } void DemoGt_PlayExplosion2Sfx(GlobalContext* globalCtx, Vec3f* pos) { - Audio_PlaySoundAtPosition(globalCtx, pos, 60, NA_SE_EV_GRAVE_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, pos, 60, NA_SE_EV_GRAVE_EXPLOSION); } void DemoGt_Rumble(GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index f3551af91d..9307674efb 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -428,13 +428,13 @@ void DoorKiller_Wait(DoorKiller* this, GlobalContext* globalCtx) { } else if ((this->colliderCylinder.info.acHitInfo->toucher.dmgFlags & 0x48) != 0) { DoorKiller_SpawnRubble(&this->actor, globalCtx); this->actionFunc = DoorKiller_Die; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_KDOOR_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_KDOOR_BREAK); } } else if (Actor_GetCollidedExplosive(globalCtx, &this->colliderJntSph.base) != NULL) { // AC sphere: die if hit by explosive DoorKiller_SpawnRubble(&this->actor, globalCtx); this->actionFunc = DoorKiller_Die; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_KDOOR_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_KDOOR_BREAK); } else if (!Player_InCsMode(globalCtx) && (fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) && (playerPosRelToDoor.z < 50.0f) && (playerPosRelToDoor.z > 0.0f)) { diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index a69acc5b15..2799cf7a3c 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -279,7 +279,7 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { } EffectSsStone1_Spawn(globalCtx, &this->actor.world.pos, 0); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, sfxId); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, sfxId); Actor_Kill(&this->actor); } else { EffectSsHitMark_SpawnCustomScale(globalCtx, 0, 150, &this->actor.world.pos); diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index e62154d5ad..ba3f40e66a 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -642,7 +642,7 @@ void func_809BE26C(EnBigokuta* this, GlobalContext* globalCtx) { Flags_SetClear(globalCtx, this->actor.room); Camera_ChangeSetting(globalCtx->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0); func_8005ACFC(globalCtx->cameraPtrs[MAIN_CAM], 4); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE); Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xB0); Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 3040142ef7..f122ed99c3 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -509,7 +509,7 @@ void EnBili_Die(EnBili* this, GlobalContext* globalCtx) { } if (this->timer == 14) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_BIRI_BUBLE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_BIRI_BUBLE); } } diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 3ffa35d4c1..e46d956575 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -369,7 +369,7 @@ void EnBubble_Wait(EnBubble* this, GlobalContext* globalCtx) { void EnBubble_Pop(EnBubble* this, GlobalContext* globalCtx) { if (EnBubble_Explosion(this, globalCtx) >= 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index ad8c0e765c..717a7a2692 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -360,7 +360,7 @@ void EnButte_TransformIntoFairy(EnButte* this, GlobalContext* globalCtx) { EnButte_UpdateTransformationEffect(); if (this->timer == 5) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 60, NA_SE_EV_BUTTERFRY_TO_FAIRY); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 60, NA_SE_EV_BUTTERFRY_TO_FAIRY); } else if (this->timer == 4) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.focus.pos.x, this->actor.focus.pos.y, this->actor.focus.pos.z, 0, this->actor.shape.rot.y, 0, FAIRY_HEAL_TIMED); diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 1afe5686df..953f8ab351 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -563,7 +563,8 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_Kill(&this->actor); // Player laser sound effect if the laser did not time out. if (this->timers[CLEAR_TAG_TIMER_LASER_DEATH] != 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_FANTOM_THUNDER_GND); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, + NA_SE_EN_FANTOM_THUNDER_GND); } } break; @@ -630,7 +631,7 @@ void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx2) { Vec3f debrisEffectAcceleration; this->shouldExplode = false; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_IT_BOMB_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_IT_BOMB_EXPLOSION); // Spawn flash effect. crashEffectLocation.x = this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 966e1b562c..1f10e8370e 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -496,7 +496,7 @@ void EnEiyer_Land(EnEiyer* this, GlobalContext* globalCtx) { if (this->timer == -1) { if (this->actor.bgCheckFlags & 8 || this->actor.bgCheckFlags & 1) { this->timer = 10; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_SINK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_SINK); if (this->actor.bgCheckFlags & 1) { EffectSsGSplash_Spawn(globalCtx, &this->actor.world.pos, NULL, NULL, 1, 700); diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index adcf06d026..c961855573 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -211,7 +211,7 @@ void EnFireRock_Fall(EnFireRock* this, GlobalContext* globalCtx) { default: Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 3, 8.0f, 200, 10, 0); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); Actor_Kill(&this->actor); break; } diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index ae1cd00ada..b53a199780 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -400,7 +400,7 @@ void EnGSwitch_ArcheryPot(EnGSwitch* this, GlobalContext* globalCtx) { KAKERA_COLOR_NONE, OBJECT_TSUBO, object_tsubo_DL_001960); } func_80033480(globalCtx, thisPos, 30.0f, 4, 20, 50, 0); - Audio_PlaySoundAtPosition(globalCtx, thisPos, 40, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, thisPos, 40, NA_SE_EV_POT_BROKEN); EnGSwitch_Break(this, globalCtx); this->killTimer = 50; this->broken = true; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 40a0ce8f5a..533e53b769 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1913,7 +1913,7 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_IRON_DOOR_OPEN); } if (this->animTimer > 44) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_IRON_DOOR_CLOSE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_IRON_DOOR_CLOSE); } else { break; } diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 733e267e54..d8e4fa58c7 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -853,9 +853,9 @@ void EnGoma_SpawnHatchDebris(EnGoma* this, GlobalContext* globalCtx2) { s16 i; if (this->actor.params < 6) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 0x28, NA_SE_EN_GOMA_BJR_EGG2); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_GOMA_BJR_EGG2); } else { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 0x28, NA_SE_EN_GOMA_EGG2); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_GOMA_EGG2); } for (i = 0; i < 15; i++) { diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index ca272bafb2..b3736949f1 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -706,7 +706,7 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { } } else if (this->actor.colChkInfo.health <= 10) { Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_BOSS); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_LAST_DAMAGE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_LAST_DAMAGE); if (this->switchFlags != 0xFF) { Flags_SetSwitch(globalCtx, this->switchFlags); } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 3216bfd327..b69666737d 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -349,14 +349,15 @@ void EnIshi_Wait(EnIshi* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnIshi_SetupLiftedUp(this); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, liftSounds[type]); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, liftSounds[type]); if ((this->actor.params >> 4) & 1) { EnIshi_SpawnBugs(this, globalCtx); } } else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) && this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000048) { EnIshi_DropCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], sBreakSounds[type]); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], + sBreakSounds[type]); sFragmentSpawnFuncs[type](this, globalCtx); sDustSpawnFuncs[type](this, globalCtx); Actor_Kill(&this->actor); @@ -423,8 +424,8 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { EnIshi_DropCollectible(this, globalCtx); sFragmentSpawnFuncs[type](this, globalCtx); if (!(this->actor.bgCheckFlags & 0x20)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], - sBreakSounds[type]); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], + sBreakSounds[type]); sDustSpawnFuncs[type](this, globalCtx); } if (type == ROCK_LARGE) { @@ -454,7 +455,7 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { this->actor.minVelocityY = -6.0f; sRotSpeedX >>= 2; sRotSpeedY >>= 2; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); this->actor.bgCheckFlags &= ~0x40; } Math_StepToF(&this->actor.shape.yOffset, 0.0f, 2.0f); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 37411f2330..bfe59cf2a2 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -298,12 +298,12 @@ void EnKusa_Main(EnKusa* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnKusa_SetupLiftedUp(this); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_PL_PULL_UP_PLANT); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_PL_PULL_UP_PLANT); } else if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); if ((this->actor.params >> 4) & 1) { EnKusa_SpawnBugs(this, globalCtx); @@ -371,7 +371,7 @@ void EnKusa_Fall(EnKusa* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 0xB) { if (!(this->actor.bgCheckFlags & 0x20)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); } EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); @@ -402,7 +402,7 @@ void EnKusa_Fall(EnKusa* this, GlobalContext* globalCtx) { rotSpeedY >>= 1; rotSpeedYtarget >>= 1; this->actor.bgCheckFlags &= ~0x40; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); } EnKusa_UpdateVelY(this); diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 6d6c98bf25..bb42047193 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -313,8 +313,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) { EnKz* this = (EnKz*)thisx; s32 pad; - SkelAnime_InitFlex(globalCtx, &this->skelanime, &gKzSkel, NULL, this->jointTable, this->morphTable, - 12); + SkelAnime_InitFlex(globalCtx, &this->skelanime, &gKzSkel, NULL, this->jointTable, this->morphTable, 12); ActorShape_Init(&this->actor.shape, 0.0, NULL, 0.0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index af91240d0b..b97b765a01 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -132,7 +132,7 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { sp40.z = this->actor.world.pos.z; EffectSsHahen_SpawnBurst(globalCtx, &sp40, 6.0f, 0, 7, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); Actor_Kill(&this->actor); } else { if (this->timer == -300) { diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 21c4da9d2b..0e6633e887 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -430,7 +430,7 @@ void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, (((this->timer - 5) * 0.04f) + 0.8f) * 0.01f); } else { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_BUBLE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_BUBLE); Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x70); for (i = 0; i < 20; i++) { velocity.x = (Rand_ZeroOne() - 0.5f) * 7.0f; @@ -499,7 +499,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { pos.y = this->actor.world.pos.y + 11.0f; pos.z = this->actor.world.pos.z; EffectSsHahen_SpawnBurst(globalCtx, &pos, 6.0f, 0, 1, 2, 15, 7, 10, gOctorokProjectileDL); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); Actor_Kill(&this->actor); } } else if (this->timer == -300) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index d6d02a0673..2e0057c538 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -811,7 +811,7 @@ void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A++; if (this->unk_19A == 64) { Flags_SetSwitch(globalCtx, this->actor.params); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EV_FLAME_IGNITION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EV_FLAME_IGNITION); if (this->unk_194 == 0) { Flags_UnsetSwitch(globalCtx, 0x1B); } @@ -1099,7 +1099,7 @@ void func_80ADBF58(EnPoSisters* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 5.0f, 0.2f); } if (this->unk_19A == -70 && this->unk_194 == 1) { - Audio_PlaySoundAtPosition(globalCtx, &D_80ADD7BC, 40, NA_SE_EN_PO_LAUGH); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &D_80ADD7BC, 40, NA_SE_EN_PO_LAUGH); } if (this->unk_19A < -120) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index babd2bc61b..30b0965ca1 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -1901,7 +1901,7 @@ void func_80AEF40C(EnRu1* this) { } void func_80AEF4A8(EnRu1* this, GlobalContext* globalCtx) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.projectedPos, 20, NA_SE_VO_RT_FALL); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.projectedPos, 20, NA_SE_VO_RT_FALL); } void func_80AEF4E0(EnRu1* this) { diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index f3cfa2108a..eb882bc0f1 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -423,7 +423,7 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { BodyBreak_Alloc(&this->bodyBreak, 8, globalCtx); this->isDead = true; Enemy_StartFinishingBlow(globalCtx, &this->actor); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_SHELL_DEAD); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_SHELL_DEAD); return 1; } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index e181ed5feb..538558fdf2 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -488,8 +488,8 @@ void func_80B0D3AC(EnSw* this, GlobalContext* globalCtx) { } this->unk_38C--; if (this->unk_38C == 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 0x28, NA_SE_EN_STALGOLD_UP_CRY); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 0x28, NA_SE_EN_DODO_M_UP); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALGOLD_UP_CRY); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_DODO_M_UP); } else { return; } diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 02f1acbf85..82025e3781 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -172,7 +172,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f)) { EnTuboTrap_SpawnEffectsInWater(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -181,8 +181,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if (this->collider.base.atFlags & AT_BOUNCED) { this->collider.base.atFlags &= ~AT_BOUNCED; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -191,8 +191,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -202,8 +202,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { this->collider.base.atFlags &= ~AT_HIT; if (this->collider.base.at == &player->actor) { EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); - Audio_PlaySoundAtPosition(globalCtx, &player2->actor.world.pos, 40, NA_SE_PL_BODY_HIT); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &player2->actor.world.pos, 40, NA_SE_PL_BODY_HIT); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -212,7 +212,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) { EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index daef70a23f..781a8ed567 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -247,7 +247,7 @@ void EnVali_SetupDivideAndDie(EnVali* this, GlobalContext* globalCtx) { Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x50); this->timer = Rand_S16Offset(10, 10); this->bodyCollider.base.acFlags &= ~AC_ON; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_BARI_SPLIT); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_BARI_SPLIT); this->actor.flags &= ~ACTOR_FLAG_0; this->actor.draw = NULL; this->actionFunc = EnVali_DivideAndDie; diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index e54e9daf41..c4eb189c17 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -1540,7 +1540,7 @@ void EnXc_PlayTriforceSFX(Actor* thisx, GlobalContext* globalCtx) { Matrix_MultVec3f(&sp1C, &src); SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &src, &pos, &wDest); - Audio_PlaySoundAtPosition(globalCtx, &pos, 80, NA_SE_EV_TRIFORCE_MARK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &pos, 80, NA_SE_EV_TRIFORCE_MARK); this->unk_2A8 = 0; } } diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 8e2368b70f..92b3e58dcd 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -123,7 +123,7 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_HIT; this->collider.base.ocFlags1 &= ~OC1_HIT; this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_2); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_ROCK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_ROCK); this->actionfunc = EnYukabyun_Break; } diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 0c5bca7de4..90ab302d86 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -128,7 +128,7 @@ void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040))) { ObjBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); if (((this->actor.params >> 0xF) & 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 3d18456188..54bf0cf852 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -179,7 +179,7 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) { this->shakeRotSize = 400.0f; } else { ObjHamishi_Break(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 162ae81357..ac98cd8cfc 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -192,12 +192,12 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { ObjKibako_SetupHeld(this); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 19.0f)) { ObjKibako_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else if (this->collider.base.acFlags & AC_HIT) { ObjKibako_AirBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else { @@ -254,12 +254,12 @@ void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0xB) || (this->collider.base.atFlags & AT_HIT)) { ObjKibako_AirBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else if (this->actor.bgCheckFlags & 0x40) { ObjKibako_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else { diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index 998337f2ad..3cbce27fe8 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -146,7 +146,7 @@ void ObjKibako2_Idle(ObjKibako2* this, GlobalContext* globalCtx) { if ((this->collider.base.acFlags & AC_HIT) || (this->dyna.actor.home.rot.z != 0) || func_80033684(globalCtx, &this->dyna.actor) != NULL) { ObjKibako2_Break(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); this->dyna.actor.flags |= ACTOR_FLAG_4; func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->dyna.actor.draw = NULL; diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 3e6c32ad2c..193041358f 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -176,7 +176,7 @@ void func_80B96678(ObjLift* this, GlobalContext* globalCtx) { } if ((this->timer & 3) == 3) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 16, NA_SE_EV_BLOCK_SHAKE); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 16, NA_SE_EV_BLOCK_SHAKE); } } @@ -200,7 +200,7 @@ void func_80B96840(ObjLift* this, GlobalContext* globalCtx) { if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= (sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) { func_80B96160(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK); Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 2) & 0x3F); Actor_Kill(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 843cf0dc1b..cb0c4b5d9c 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -243,14 +243,14 @@ void ObjTsubo_Idle(ObjTsubo* this, GlobalContext* globalCtx) { ObjTsubo_SetupLiftedUp(this); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f)) { ObjTsubo_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); ObjTsubo_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else if ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x4FC1FFFC)) { ObjTsubo_AirBreak(this, globalCtx); ObjTsubo_SpawnCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); Actor_Kill(&this->actor); } else { if (this->actor.xzDistToPlayer < 600.0f) { @@ -306,12 +306,12 @@ void ObjTsubo_Thrown(ObjTsubo* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0xB) || (this->collider.base.atFlags & AT_HIT)) { ObjTsubo_AirBreak(this, globalCtx); ObjTsubo_SpawnCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); Actor_Kill(&this->actor); } else if (this->actor.bgCheckFlags & 0x40) { ObjTsubo_WaterBreak(this, globalCtx); ObjTsubo_SpawnCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_POT_BROKEN); Actor_Kill(&this->actor); } else { ObjTsubo_ApplyGravity(this);