diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2022-12-18 23:18:21 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-18 23:18:21 -0500 |
| commit | be22b836f6161c455bb1e9f698bc3ac50ec1bf25 (patch) | |
| tree | 3d67e9dce88e6105251d9a6401f540425d337d85 /src/code | |
| parent | f181c2f10eb500bf366e4da3d0ed08ac4d97a713 (diff) | |
Name `Actor_PlaySfx` and `Player_PlaySfx` (#1469)
* name two main actor sfx functions
* adjust comments
* fix double s in player
* fix commas
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 18 | ||||
| -rw-r--r-- | src/code/z_effect_soft_sprite_old_init.c | 8 | ||||
| -rw-r--r-- | src/code/z_en_a_keep.c | 2 | ||||
| -rw-r--r-- | src/code/z_scene_table.c | 2 |
4 files changed, 18 insertions, 12 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index efc057dfd..a58bc208a 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1714,12 +1714,18 @@ void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) func_8002F758(play, actor, arg2, arg3, arg4, 0); } -void func_8002F7DC(Actor* actor, u16 sfxId) { - Audio_PlaySfxGeneral(sfxId, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); +/** + * Play a sound effect at the player's position + */ +void Player_PlaySfx(Player* player, u16 sfxId) { + Audio_PlaySfxGeneral(sfxId, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } -void Audio_PlayActorSfx2(Actor* actor, u16 sfxId) { +/** + * Play a sound effect at the actor's position + */ +void Actor_PlaySfx(Actor* actor, u16 sfxId) { func_80078914(&actor->projectedPos, sfxId); } @@ -1783,7 +1789,7 @@ s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId, if (SurfaceType_GetFloorType(&play->colCtx, poly, bgId) == FLOOR_TYPE_8) { play->roomCtx.unk_74[0] = 1; CollisionCheck_BlueBlood(play, NULL, pos); - Audio_PlayActorSfx2(actor, NA_SE_IT_WALL_HIT_BUYO); + Actor_PlaySfx(actor, NA_SE_IT_WALL_HIT_BUYO); return true; } @@ -3664,7 +3670,7 @@ void func_8003424C(PlayState* play, Vec3f* arg1) { void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s16 bufFlag, s16 duration) { if ((colorFlag == COLORFILTER_COLORFLAG_GRAY) && !(colorIntensityMax & COLORFILTER_INTENSITY_FLAG)) { - Audio_PlayActorSfx2(actor, NA_SE_EN_LIGHT_ARROW_HIT); + Actor_PlaySfx(actor, NA_SE_EN_LIGHT_ARROW_HIT); } actor->colorFilterParams = colorFlag | bufFlag | ((colorIntensityMax & 0xF8) << 5) | duration; diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 1e30438d7..5c6b95711 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -888,7 +888,7 @@ void EffectSsEnIce_SpawnFlyingVec3f(PlayState* play, Actor* actor, Vec3f* pos, s initParams.scale = scale; if (actor != NULL) { - Audio_PlayActorSfx2(actor, NA_SE_PL_FREEZE_S); + Actor_PlaySfx(actor, NA_SE_PL_FREEZE_S); } EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams); @@ -914,7 +914,7 @@ void EffectSsEnIce_SpawnFlyingVec3s(PlayState* play, Actor* actor, Vec3s* pos, s initParams.scale = scale; if (actor != NULL) { - Audio_PlayActorSfx2(actor, NA_SE_PL_FREEZE_S); + Actor_PlaySfx(actor, NA_SE_PL_FREEZE_S); } EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams); @@ -993,7 +993,7 @@ void EffectSsEnFire_SpawnVec3f(PlayState* play, Actor* actor, Vec3f* pos, s16 sc initParams.bodyPart = bodyPart; if (actor != NULL) { - Audio_PlayActorSfx2(actor, NA_SE_EV_FLAME_IGNITION); + Actor_PlaySfx(actor, NA_SE_EV_FLAME_IGNITION); } EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams); @@ -1014,7 +1014,7 @@ void EffectSsEnFire_SpawnVec3s(PlayState* play, Actor* actor, Vec3s* pos, s16 sc initParams.bodyPart = bodyPart; if (actor != NULL) { - Audio_PlayActorSfx2(actor, NA_SE_EV_FLAME_IGNITION); + Actor_PlaySfx(actor, NA_SE_EV_FLAME_IGNITION); } EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams); diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 09fca0a94..61d48446d 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -301,7 +301,7 @@ void EnAObj_Block(EnAObj* this, PlayState* play) { Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); if (this->dyna.actor.speedXZ != 0.0f) { - Audio_PlayActorSfx2(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); + Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } this->dyna.unk_154 = 0.0f; diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 7e1123fb2..e69ddc75d 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -1244,7 +1244,7 @@ void Scene_DrawConfigLostWoods(PlayState* play) { if ((play->roomCtx.unk_74[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) { if (play->roomCtx.unk_74[1] == 50) { - func_8002F7DC(&GET_PLAYER(play)->actor, NA_SE_EV_CHICKEN_CRY_M); + Player_PlaySfx(GET_PLAYER(play), NA_SE_EV_CHICKEN_CRY_M); play->roomCtx.unk_74[0] = 1; } play->roomCtx.unk_74[1]++; |
