diff options
| author | Dragorn421 <Dragorn421@users.noreply.github.com> | 2024-09-08 22:26:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-08 16:26:01 -0400 |
| commit | a903f8b8bcc32d8f6c0a76ce5eeead271c297772 (patch) | |
| tree | 41fd27777d0304c90416ff31379186f6d45b5ef2 /src/code | |
| parent | de1a08c0612c36ca7528b9208a5a28d47d6b830a (diff) | |
Document `ACTOR_FLAG_SFX_` flags and functions (#2162)
* Document `ACTOR_FLAG_SFX_` flags and functions
* format
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 069bca7fa..e45d96552 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1938,7 +1938,7 @@ void Actor_PlaySfx(Actor* actor, u16 sfxId) { Sfx_PlaySfxAtPos(&actor->projectedPos, sfxId); } -void func_8002F850(PlayState* play, Actor* actor) { +void Actor_PlaySfx_SurfaceBomb(PlayState* play, Actor* actor) { s32 surfaceSfxOffset; if (actor->bgCheckFlags & BGCHECKFLAG_WATER) { @@ -1955,32 +1955,45 @@ void func_8002F850(PlayState* play, Actor* actor) { Sfx_PlaySfxAtPos(&actor->projectedPos, NA_SE_PL_WALK_GROUND + surfaceSfxOffset); } -void func_8002F8F0(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the actor's position using the shared flagged audio system + */ +void Actor_PlaySfx_Flagged2(Actor* actor, u16 sfxId) { actor->sfx = sfxId; - actor->flags |= ACTOR_FLAG_19; - actor->flags &= ~(ACTOR_FLAG_20 | ACTOR_FLAG_21 | ACTOR_FLAG_28); + actor->flags |= ACTOR_FLAG_SFX_ACTOR_POS_2; + actor->flags &= ~(ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | ACTOR_FLAG_SFX_TIMER); } -void func_8002F91C(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the center of the screen using the shared flagged audio system + */ +void Actor_PlaySfx_FlaggedCentered1(Actor* actor, u16 sfxId) { actor->sfx = sfxId; - actor->flags |= ACTOR_FLAG_20; - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_21 | ACTOR_FLAG_28); + actor->flags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_1; + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | ACTOR_FLAG_SFX_TIMER); } -void func_8002F948(Actor* actor, u16 sfxId) { +/** + * Play a sfx at the center of the screen using the shared flagged audio system + */ +void Actor_PlaySfx_FlaggedCentered2(Actor* actor, u16 sfxId) { actor->sfx = sfxId; - actor->flags |= ACTOR_FLAG_21; - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_20 | ACTOR_FLAG_28); + actor->flags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_2; + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_FLAG_SFX_TIMER); } -void func_8002F974(Actor* actor, u16 sfxId) { - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_20 | ACTOR_FLAG_21 | ACTOR_FLAG_28); +/** + * Play a sfx at the actor's position using the shared flagged audio system + */ +void Actor_PlaySfx_Flagged(Actor* actor, u16 sfxId) { + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | + ACTOR_FLAG_SFX_TIMER); actor->sfx = sfxId; } -void func_8002F994(Actor* actor, s32 timer) { - actor->flags |= ACTOR_FLAG_28; - actor->flags &= ~(ACTOR_FLAG_19 | ACTOR_FLAG_20 | ACTOR_FLAG_21); +void Actor_PlaySfx_FlaggedTimer(Actor* actor, s32 timer) { + actor->flags |= ACTOR_FLAG_SFX_TIMER; + actor->flags &= ~(ACTOR_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2); // The sfx field is not used for an actual sound effect here. // Instead, it controls the tick speed of the timer sound effect. @@ -2507,15 +2520,15 @@ void Actor_Draw(PlayState* play, Actor* actor) { Fault_RemoveClient(&faultClient); } -void func_80030ED8(Actor* actor) { - if (actor->flags & ACTOR_FLAG_19) { +void Actor_UpdateFlaggedAudio(Actor* actor) { + if (actor->flags & ACTOR_FLAG_SFX_ACTOR_POS_2) { Audio_PlaySfxGeneral(actor->sfx, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - } else if (actor->flags & ACTOR_FLAG_20) { + } else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_1) { Sfx_PlaySfxCentered(actor->sfx); - } else if (actor->flags & ACTOR_FLAG_21) { + } else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_2) { Sfx_PlaySfxCentered2(actor->sfx); - } else if (actor->flags & ACTOR_FLAG_28) { + } else if (actor->flags & ACTOR_FLAG_SFX_TIMER) { func_800F4C58(&gSfxDefaultPos, NA_SE_SY_TIMER - SFX_FLAG, (s8)(actor->sfx - 1)); } else { Sfx_PlaySfxAtPos(&actor->projectedPos, actor->sfx); @@ -2687,7 +2700,7 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) { if (!OOT_DEBUG || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(69) == 0)) { if (actor->sfx != 0) { - func_80030ED8(actor); + Actor_UpdateFlaggedAudio(actor); } } |
