Fixup actor audio flags docs (#1682)

* Fixup actor audio flags docs

* format
This commit is contained in:
Dragorn421
2024-09-07 15:48:30 +02:00
committed by GitHub
parent d925976c82
commit 3add37c3a0
18 changed files with 56 additions and 56 deletions
+20 -20
View File
@@ -46,17 +46,17 @@ struct Actor* D_801ED920; // 2 funcs. 1 out of z_actor
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "objects/object_bdoor/object_bdoor.h"
#define ACTOR_AUDIO_FLAG_SFX_ACTOR_POS (1 << 0)
#define ACTOR_AUDIO_FLAG_SFX_CENTERED_1 (1 << 1)
#define ACTOR_AUDIO_FLAG_SFX_CENTERED_2 (1 << 2)
#define ACTOR_AUDIO_FLAG_SFX_CENTERED_3 (1 << 3)
#define ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_1 (1 << 0)
#define ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_2 (1 << 1) // identical behavior to ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_1
#define ACTOR_AUDIO_FLAG_SFX_CENTERED_1 (1 << 2)
#define ACTOR_AUDIO_FLAG_SFX_CENTERED_2 (1 << 3) // identical behavior to ACTOR_AUDIO_FLAG_SFX_CENTERED_1
#define ACTOR_AUDIO_FLAG_SFX_TIMER (1 << 4)
#define ACTOR_AUDIO_FLAG_SEQ_KAMARO_DANCE (1 << 5)
#define ACTOR_AUDIO_FLAG_SEQ_MUSIC_BOX_HOUSE (1 << 6)
#define ACTOR_AUDIO_FLAG_SFX_ALL \
(ACTOR_AUDIO_FLAG_SFX_TIMER | ACTOR_AUDIO_FLAG_SFX_CENTERED_3 | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | \
ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | ACTOR_AUDIO_FLAG_SFX_ACTOR_POS)
(ACTOR_AUDIO_FLAG_SFX_TIMER | ACTOR_AUDIO_FLAG_SFX_CENTERED_2 | ACTOR_AUDIO_FLAG_SFX_CENTERED_1 | \
ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_2 | ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_1)
#define ACTOR_AUDIO_FLAG_SEQ_ALL (ACTOR_AUDIO_FLAG_SEQ_MUSIC_BOX_HOUSE | ACTOR_AUDIO_FLAG_SEQ_KAMARO_DANCE)
#define ACTOR_AUDIO_FLAG_ALL (ACTOR_AUDIO_FLAG_SFX_ALL | ACTOR_AUDIO_FLAG_SEQ_ALL)
@@ -2326,6 +2326,15 @@ void Actor_PlaySfx_SurfaceBomb(PlayState* play, Actor* actor) {
Audio_PlaySfx_AtPos(&actor->projectedPos, NA_SE_PL_WALK_GROUND + surfaceSfxOffset);
}
/**
* Play a sfx at the actor's position using the shared audioFlag system
*/
void Actor_PlaySfx_Flagged2(Actor* actor, u16 sfxId) {
actor->sfxId = sfxId;
actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL;
actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_2;
}
/**
* Play a sfx at the center of the screen using the shared audioFlag system
*/
@@ -2344,22 +2353,13 @@ void Actor_PlaySfx_FlaggedCentered2(Actor* actor, u16 sfxId) {
actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_2;
}
/**
* Play a sfx at the center of the screen using the shared audioFlag system
*/
void Actor_PlaySfx_FlaggedCentered3(Actor* actor, u16 sfxId) {
actor->sfxId = sfxId;
actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL;
actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_3;
}
/**
* Play a sfx at the actor's position using the shared audioFlag system
*/
void Actor_PlaySfx_Flagged(Actor* actor, u16 sfxId) {
actor->sfxId = sfxId;
actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL;
actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_ACTOR_POS;
actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_1;
}
void Actor_PlaySfx_FlaggedTimer(Actor* actor, s32 timer) {
@@ -2781,16 +2781,16 @@ void Actor_UpdateFlaggedAudio(Actor* actor) {
s32 sfxId = actor->sfxId;
if (sfxId != NA_SE_NONE) {
if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_1) {
if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_2) {
AudioSfx_PlaySfx(sfxId, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
} else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_2) {
} else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_1) {
Audio_PlaySfx(sfxId);
} else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_3) {
} else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_CENTERED_2) {
Audio_PlaySfx_2(sfxId);
} else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_TIMER) {
Audio_PlaySfx_AtPosWithChannelIO(&gSfxDefaultPos, NA_SE_SY_TIMER - SFX_FLAG, (sfxId - 1));
} else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_ACTOR_POS) {
} else if (actor->audioFlags & ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_1) {
Audio_PlaySfx_AtPos(&actor->projectedPos, sfxId);
}
}