summaryrefslogtreecommitdiff
path: root/src/code/z_actor.c
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2024-09-07 15:48:30 +0200
committerGitHub <noreply@github.com>2024-09-07 09:48:30 -0400
commit3add37c3a081241a4015f0ea84b534965047ff82 (patch)
tree33fce21c8841e7d699bac714d3f41fecdbe48d0d /src/code/z_actor.c
parentd925976c828a2d4cd9a8da01fabf50af6ac68e86 (diff)
Fixup actor audio flags docs (#1682)
* Fixup actor audio flags docs * format
Diffstat (limited to 'src/code/z_actor.c')
-rw-r--r--src/code/z_actor.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 52684408e..37d5d4cf1 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -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)
@@ -2327,30 +2327,30 @@ void Actor_PlaySfx_SurfaceBomb(PlayState* play, Actor* actor) {
}
/**
- * Play a sfx at the center of the screen using the shared audioFlag system
+ * Play a sfx at the actor's position using the shared audioFlag system
*/
-void Actor_PlaySfx_FlaggedCentered1(Actor* actor, u16 sfxId) {
+void Actor_PlaySfx_Flagged2(Actor* actor, u16 sfxId) {
actor->sfxId = sfxId;
actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL;
- actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_1;
+ actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_ACTOR_POS_2;
}
/**
* Play a sfx at the center of the screen using the shared audioFlag system
*/
-void Actor_PlaySfx_FlaggedCentered2(Actor* actor, u16 sfxId) {
+void Actor_PlaySfx_FlaggedCentered1(Actor* actor, u16 sfxId) {
actor->sfxId = sfxId;
actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL;
- actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_2;
+ actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_1;
}
/**
* Play a sfx at the center of the screen using the shared audioFlag system
*/
-void Actor_PlaySfx_FlaggedCentered3(Actor* actor, u16 sfxId) {
+void Actor_PlaySfx_FlaggedCentered2(Actor* actor, u16 sfxId) {
actor->sfxId = sfxId;
actor->audioFlags &= ~ACTOR_AUDIO_FLAG_SFX_ALL;
- actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_3;
+ actor->audioFlags |= ACTOR_AUDIO_FLAG_SFX_CENTERED_2;
}
/**
@@ -2359,7 +2359,7 @@ void Actor_PlaySfx_FlaggedCentered3(Actor* actor, u16 sfxId) {
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);
}
}