Name Actor_PlaySfx and Player_PlaySfx (#1190)

* name funcs

* namefixer

* function comments
This commit is contained in:
engineer124
2023-03-03 00:09:16 -05:00
committed by GitHub
parent 5729b6d3f1
commit cc8772a896
280 changed files with 1433 additions and 1425 deletions
+2 -2
View File
@@ -706,8 +706,8 @@ void func_800B8D50(PlayState* play, Actor* actor, f32 arg2, s16 yaw, f32 arg4, u
void func_800B8D98(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4);
void func_800B8DD4(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5);
void func_800B8E1C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4);
void func_800B8E58(Player* player, u16 sfxId);
void Actor_PlaySfxAtPos(Actor* actor, u16 sfxId);
void Player_PlaySfx(Player* player, u16 sfxId);
void Actor_PlaySfx(Actor* actor, u16 sfxId);
void func_800B8EF4(PlayState* play, Actor* actor);
void func_800B8F98(Actor* actor, u16 sfxId);
void func_800B8FC0(Actor* actor, u16 sfxId);
-1
View File
@@ -218,7 +218,6 @@ typedef struct {
/* 0x148 */ f32 pushForce;
/* 0x14C */ f32 unk14C;
/* 0x150 */ s16 yRotation;
/* 0x152 */ u16 unk152;
/* 0x154 */ u32 flags;
/* 0x158 */ u8 stateFlags;
/* 0x15A */ s16 pad15A;
+11 -8
View File
@@ -2130,7 +2130,10 @@ void func_800B8E1C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4)
func_800B8DD4(play, actor, arg2, arg3, arg4, 0);
}
void func_800B8E58(Player* player, u16 sfxId) {
/**
* Play a sound effect at the player's position
*/
void Player_PlaySfx(Player* player, u16 sfxId) {
if (player->currentMask == PLAYER_MASK_GIANT) {
func_8019F170(&player->actor.projectedPos, sfxId);
} else {
@@ -2140,9 +2143,9 @@ void func_800B8E58(Player* player, u16 sfxId) {
}
/**
* Plays the sound effect at the actor's position
* Play a sound effect at the actor's position
*/
void Actor_PlaySfxAtPos(Actor* actor, u16 sfxId) {
void Actor_PlaySfx(Actor* actor, u16 sfxId) {
Audio_PlaySfxAtPos(&actor->projectedPos, sfxId);
}
@@ -3839,7 +3842,7 @@ void Actor_SpawnShieldParticlesMetal(PlayState* play, Vec3f* pos) {
void Actor_SetColorFilter(Actor* actor, u16 colorFlag, u16 colorIntensityMax, u16 xluFlag, u16 duration) {
if ((colorFlag == 0x8000) && !(colorIntensityMax & 0x8000)) {
Actor_PlaySfxAtPos(actor, NA_SE_EN_LIGHT_ARROW_HIT);
Actor_PlaySfx(actor, NA_SE_EN_LIGHT_ARROW_HIT);
}
actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration;
@@ -4476,13 +4479,13 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
// Apply sfx along with damage effect
if ((actor != NULL) && (effectAlpha > 0.05f) && (play->gameOverCtx.state == GAMEOVER_INACTIVE)) {
if (type == ACTOR_DRAW_DMGEFF_FIRE) {
Actor_PlaySfxAtPos(actor, NA_SE_EV_BURN_OUT - SFX_FLAG);
Actor_PlaySfx(actor, NA_SE_EV_BURN_OUT - SFX_FLAG);
} else if (type == ACTOR_DRAW_DMGEFF_BLUE_FIRE) {
Actor_PlaySfxAtPos(actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG);
Actor_PlaySfx(actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG);
} else if (type == ACTOR_DRAW_DMGEFF_FROZEN_SFX) {
Actor_PlaySfxAtPos(actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
Actor_PlaySfx(actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
} else if ((type == ACTOR_DRAW_DMGEFF_LIGHT_ORBS) || (type == ACTOR_DRAW_DMGEFF_BLUE_LIGHT_ORBS)) {
Actor_PlaySfxAtPos(actor, NA_SE_EN_COMMON_DEADLIGHT - SFX_FLAG);
Actor_PlaySfx(actor, NA_SE_EN_COMMON_DEADLIGHT - SFX_FLAG);
}
}
+3 -3
View File
@@ -805,7 +805,7 @@ void EffectSsEnIce_SpawnFlying(PlayState* play, Actor* actor, Vec3f* pos, Color_
initParams.scale = scale;
if (actor != NULL) {
Actor_PlaySfxAtPos(actor, NA_SE_PL_FREEZE_S);
Actor_PlaySfx(actor, NA_SE_PL_FREEZE_S);
}
EffectSs_Spawn(play, EFFECT_SS_EN_ICE, 80, &initParams);
@@ -897,7 +897,7 @@ void EffectSsEnFire_SpawnVec3f(PlayState* play, Actor* actor, Vec3f* pos, s16 sc
initParams.bodyPart = bodyPart;
if (actor != NULL) {
Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION);
Actor_PlaySfx(actor, NA_SE_EV_FLAME_IGNITION);
}
EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams);
@@ -917,7 +917,7 @@ void EffectSsEnFire_SpawnVec3s(PlayState* play, Actor* actor, Vec3s* pos, s16 sc
initParams.bodyPart = bodyPart;
if (actor != NULL) {
Actor_PlaySfxAtPos(actor, NA_SE_EV_FLAME_IGNITION);
Actor_PlaySfx(actor, NA_SE_EV_FLAME_IGNITION);
}
EffectSs_Spawn(play, EFFECT_SS_EN_FIRE, 128, &initParams);
+2 -2
View File
@@ -267,12 +267,12 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, PlayState* play, f32 distAboveThreshold) {
enHy->isLeftFootOnGround = isFootOnGround = SubS_IsFloorAbove(play, &enHy->leftFootPos, distAboveThreshold);
if (enHy->isLeftFootOnGround && !wasLeftFootOnGround && isFootOnGround) {
Actor_PlaySfxAtPos(&enHy->actor, sfxId);
Actor_PlaySfx(&enHy->actor, sfxId);
}
enHy->isRightFootOnGround = isFootOnGround = SubS_IsFloorAbove(play, &enHy->rightFootPos, distAboveThreshold);
if (enHy->isRightFootOnGround && !wasRightFootOnGround && isFootOnGround) {
Actor_PlaySfxAtPos(&enHy->actor, sfxId);
Actor_PlaySfx(&enHy->actor, sfxId);
}
return false;
@@ -186,7 +186,7 @@ void FireArrow_Fly(ArrowFire* this, PlayState* play) {
FireArrow_Lerp(&this->firedPos, &this->actor.world.pos, 0.05f);
if (arrow->unk_261 & 1) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_EXPLOSION_FRAME);
Actor_PlaySfx(&this->actor, NA_SE_IT_EXPLOSION_FRAME);
ArrowFire_SetupAction(this, FireArrow_Hit);
this->timer = 32;
this->alpha = 255;
@@ -160,7 +160,7 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) {
ArrowIce_LerpFiredPosition(&this->firedPos, &this->actor.world.pos, 0.05f);
if (arrow->unk_261 & 1) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_EXPLOSION_ICE);
Actor_PlaySfx(&this->actor, NA_SE_IT_EXPLOSION_ICE);
ArrowIce_SetupAction(this, ArrowIce_Hit);
this->timer = 32;
this->alpha = 255;
@@ -154,7 +154,7 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) {
ArrowLight_Lerp(&this->firedPos, &this->actor.world.pos, 0.05f);
if (arrow->unk_261 & 1) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_EXPLOSION_LIGHT);
Actor_PlaySfx(&this->actor, NA_SE_IT_EXPLOSION_LIGHT);
ArrowLight_SetupAction(this, ArrowLight_Hit);
this->timer = 32;
this->alpha = 255;
@@ -184,7 +184,7 @@ void func_80C0A458(BgAstrBombwall* this, PlayState* play) {
func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId);
this->dyna.actor.draw = NULL;
func_80C0A120(this, play);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WALL_BROKEN);
this->actionFunc = func_80C0A4BC;
}
@@ -343,7 +343,7 @@ void BgCraceMovebg_ClosingDoor_SetupDoNothing(BgCraceMovebg* this, PlayState* pl
this->targetDoorHeight = 0.0f;
this->doorHeight = 0.0f;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
this->actionFunc = BgCraceMovebg_ClosingDoor_DoNothing;
}
@@ -108,7 +108,7 @@ void BgCtowerGear_Splash(BgCtowerGear* this, PlayState* play) {
}
}
}
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WATERWHEEL_LEVEL);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_WATERWHEEL_LEVEL);
}
}
@@ -99,7 +99,7 @@ void BgCtowerRot_DoorDoNothing(BgCtowerRot* this, PlayState* play) {
void BgCtowerRot_DoorClose(BgCtowerRot* this, PlayState* play) {
if (!Math_SmoothStepToF(&this->timer, 0.0f, 0.1f, 15.0f, 0.1f)) {
if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
ActorCutscene_Stop(this->dyna.actor.cutscene);
}
this->actionFunc = BgCtowerRot_DoorDoNothing;
@@ -485,7 +485,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) {
this->unk_178 *= -0.6f;
this->unk_17C++;
if (this->unk_182) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND);
sp5C = this->unk_15C;
Matrix_Push();
Matrix_RotateYS(BINANG_SUB(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW);
@@ -498,7 +498,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) {
func_80B8296C(play, &sp50, 70.0f);
} else {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND);
}
} else {
this->dyna.actor.shape.rot.z = 0x1C72;
@@ -510,7 +510,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) {
this->unk_178 *= -0.6f;
this->unk_17C++;
if (this->unk_182) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_WATER_BOUND);
sp3C = this->unk_160;
Matrix_Push();
Matrix_RotateYS(BINANG_ADD(this->dyna.actor.shape.rot.y, 0x4000), MTXMODE_NEW);
@@ -523,7 +523,7 @@ void func_80B82DE0(BgDblueBalance* this, PlayState* play) {
func_80B8296C(play, &sp30, 47.0f);
} else {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SEESAW_BOUND);
}
} else {
this->dyna.actor.shape.rot.z = -0x1C72;
@@ -422,7 +422,7 @@ void func_80A2A444(BgDblueMovebg* this, PlayState* play) {
player->stateFlags2 &= ~PLAYER_STATE2_10;
this->dyna.pushForce = 0.0f;
Flags_SetSwitch(play, this->unk_1C0);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
if (func_80A29A80(play, this->unk_1C8, this->unk_1C4)) {
this->unk_172 |= 1;
@@ -524,7 +524,7 @@ void func_80A2A7F8(BgDblueMovebg* this, PlayState* play) {
this->unk_18A = 0;
this->unk_17E = 0;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
if (func_80A29A80(play, this->unk_1C8, this->unk_1C4)) {
this->unk_172 |= 1;
@@ -223,7 +223,7 @@ void func_80B841A0(BgDblueWaterfall* this, PlayState* play) {
EffectSsGSplash_Spawn(play, &sp94, NULL, NULL, 0, 250);
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_REFLECTION_WATER);
Actor_PlaySfx(&this->actor, NA_SE_IT_REFLECTION_WATER);
}
}
@@ -164,7 +164,7 @@ void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) {
func_800C62BC(play, &play->colCtx.dyna, this->dyna.bgId);
Flags_SetSwitch(play, BG_DKJAIL_GET_SWITCH(&this->dyna.actor));
BgDkjailIvy_IvyCutEffects(this, play);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_GRASS_WALL_BROKEN);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_GRASS_WALL_BROKEN);
BgDkjailIvy_SetupFadeOut(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
@@ -278,14 +278,14 @@ void func_80BC4228(BgF40Block* this, PlayState* play) {
} else {
this->actionFunc = func_80BC4530;
ActorCutscene_Stop(this->dyna.actor.cutscene);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C);
}
}
if (func_80BC3D08(this, play, 0)) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
this->actionFunc = func_80BC41AC;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F);
return;
}
@@ -338,14 +338,14 @@ void func_80BC4448(BgF40Block* this, PlayState* play) {
} else {
this->actionFunc = func_80BC4380;
ActorCutscene_Stop(this->dyna.actor.cutscene);
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C);
}
}
if (func_80BC3D08(this, play, 0)) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
this->actionFunc = func_80BC43CC;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F);
}
}
@@ -129,7 +129,7 @@ void BgF40Switch_Destroy(Actor* thisx, PlayState* play) {
void BgF40Switch_Unpress(BgF40Switch* this, PlayState* play) {
this->dyna.actor.scale.y += 0.0495f;
if (this->dyna.actor.scale.y >= 0.165f) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH);
this->actionFunc = BgF40Switch_IdleUnpressed;
this->dyna.actor.scale.y = 0.165f;
}
@@ -144,7 +144,7 @@ void BgF40Switch_IdlePressed(BgF40Switch* this, PlayState* play) {
void BgF40Switch_Press(BgF40Switch* this, PlayState* play) {
this->dyna.actor.scale.y -= 0.0495f;
if (this->dyna.actor.scale.y <= 0.0165f) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
if (this->isInitiator) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
@@ -68,7 +68,7 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) {
sp28 = true;
} else if (this->unk_15E > 0) {
if (this->unk_15E == 100) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
}
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 120.0f;
//! FAKE:
@@ -83,7 +83,7 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) {
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 320.0f;
Flags_UnsetSwitch(play, BGHAKUGINELVPOLE_GET_SWITCHFLAG(&this->dyna.actor));
this->unk_15E = -1;
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
}
} else if ((BGHAKUGINELVPOLE_GET_SWITCHFLAG(&this->dyna.actor) != 0x7F) &&
Flags_GetSwitch(play, BGHAKUGINELVPOLE_GET_SWITCHFLAG(&this->dyna.actor))) {
@@ -839,7 +839,7 @@ void func_80A9CE1C(BgHakuginPost* this, PlayState* play) {
temp = (s16)(this->dyna.actor.yawTowardsPlayer + 0x58F0);
D_80A9E028.unk_0000[i].unk_28 = ((s16)(player->actor.shape.rot.y - temp) / 3) + temp;
D_80A9E028.unk_0000[i].unk_34 = 2;
func_800B8E58(player, NA_SE_IT_HAMMER_HIT);
Player_PlaySfx(player, NA_SE_IT_HAMMER_HIT);
func_8019F128(NA_SE_EV_SLIDE_DOOR_OPEN);
Flags_SetSwitch(play, D_80A9E028.unk_0000[i].unk_2E);
this->unk_178 = 20;

Some files were not shown because too many files have changed in this diff Show More