8000 Macroify PlaySfxGeneral calls: introduce `SFX_PLAY_CENTERED` and `SFX_PLAY_AT_POS` by Dragorn421 · Pull Request #2633 · zeldaret/oot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Macroify PlaySfxGeneral calls: introduce SFX_PLAY_CENTERED and SFX_PLAY_AT_POS #2633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/sfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ typedef struct SfxParams {
#define SFX_DIST_SCALING 10.0f
#endif

#define SFX_PLAY_CENTERED(sfxId) \
Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, \
&gSfxDefaultReverb);

#define SFX_PLAY_AT_POS(projectedPos, sfxId) \
Audio_PlaySfxGeneral(sfxId, projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, \
&gSfxDefaultReverb);

void Audio_SetSfxBanksMute(u16 muteMask);
void Audio_QueueSeqCmdMute(u8 channelIndex);
void Audio_ClearBGMMute(u8 channelIndex);
Expand Down
7 changes: 2 additions & 5 deletions src/audio/game/debug.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,9 +842,7 @@ void AudioDebug_ProcessInput_SndCont(void) {
break;
case 2:
case 3:
Audio_PlaySfxGeneral(((sAudioSndContWork[2] << 12) & 0xFFFF) + sAudioSndContWork[3] + SFX_FLAG,
&gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_CENTERED(((sAudioSndContWork[2] << 12) & 0xFFFF) + sAudioSndContWork[3] + SFX_FLAG);
break;
case 4:
Audio_SetSoundOutputMode(sAudioSndContWork[sAudioSndContSel]);
Expand Down Expand Up @@ -1245,8 +1243,7 @@ void AudioDebug_ProcessInput_SfxParamChg(void) {

if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) {
sfx = (u16)(sAudioSfxParamChgWork[0] << 12) + sAudioSfxParamChgWork[1] + SFX_FLAG;
Audio_PlaySfxGeneral(sfx, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_CENTERED(sfx);
}

if (CHECK_BTN_ANY(sDebugPadPress, BTN_B)) {
Expand Down
14 changes: 5 additions & 9 deletions src/audio/game/general.c
Original file line number Diff line number Diff line change
Expand Up @@ -2816,8 +2816,7 @@ void func_800F4190(Vec3f* pos, u16 sfxId) {
void Audio_PlaySfxRandom(Vec3f* pos, u16 baseSfxId, u8 randLim) {
u8 offset = AudioThread_NextRandom() % randLim;

Audio_PlaySfxGeneral(baseSfxId + offset, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_AT_POS(pos, baseSfxId + offset);
}

void func_800F4254(Vec3f* pos, u8 level) {
Expand Down Expand Up @@ -3081,7 +3080,7 @@ void func_800F4C58(Vec3f* pos, u16 sfxId, u8 ioData) {
}
channelIndex++;
}
Audio_PlaySfxGeneral(sfxId, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(pos, sfxId);
}

void func_800F4E30(Vec3f* pos, f32 arg1) {
Expand Down Expand Up @@ -3704,12 +3703,10 @@ void Audio_UpdateMalonSinging(f32 dist, u16 seqId) {
void func_800F64E0(u8 arg0) {
D_80130608 = arg0;
if (arg0 != 0) {
Audio_PlaySfxGeneral(NA_SE_SY_WIN_OPEN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_WIN_OPEN);
AUDIOCMD_GLOBAL_MUTE();
} else {
Audio_PlaySfxGeneral(NA_SE_SY_WIN_CLOSE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_WIN_CLOSE);
AUDIOCMD_GLOBAL_UNMUTE(0);
}
}
Expand Down Expand Up @@ -3818,8 +3815,7 @@ void Audio_SetBaseFilter(u8 filter) {
if (filter == 0) {
Audio_StopSfxById(NA_SE_PL_IN_BUBBLE);
} else if (sAudioBaseFilter == 0) {
Audio_PlaySfxGeneral(NA_SE_PL_IN_BUBBLE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_PL_IN_BUBBLE);
}
}
sAudioBaseFilter = filter;
Expand Down
144 changes: 48 additions & 96 deletions src/code/db_camera.c

Large diffs are not rendered by default.

< 10000 button type="button" class="btn-octicon js-details-target" aria-label="Toggle diff contents" aria-expanded="true" style="width: 22px;">
12 changes: 4 additions & 8 deletions src/code/z_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2030,8 +2030,7 @@ void Actor_SetPlayerKnockbackSmallNoDamage(PlayState* play, Actor* actor, f32 sp
* 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);
SFX_PLAY_AT_POS(&player->actor.projectedPos, sfxId);
}

/**
Expand Down Expand Up @@ -2641,8 +2640,7 @@ void Actor_Draw(PlayState* play, Actor* actor) {

void Actor_UpdateFlaggedAudio(Actor* actor) {
if (actor->flags & ACTOR_FLAG_SFX_ACTOR_POS_2) {
Audio_PlaySfxGeneral(actor->sfx, &actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&actor->projectedPos, actor->sfx);
} else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_1) {
Sfx_PlaySfxCentered(actor->sfx);
} else if (actor->flags & ACTOR_AUDIO_FLAG_SFX_CENTERED_2) {
Expand Down Expand Up @@ -5670,8 +5668,7 @@ void func_80036E50(u16 textId, s16 arg1) {
Flags_SetInfTable(INFTABLE_0C);
return;
case 0x1033:
Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_CORRECT_CHIME);
Flags_SetEventChkInf(EVENTCHKINF_04);
Flags_SetInfTable(INFTABLE_0E);
return;
Expand Down Expand Up @@ -6136,8 +6133,7 @@ s32 func_80037CB8(PlayState* play, Actor* actor, s16 arg2) {
case TEXT_STATE_CHOICE:
case TEXT_STATE_EVENT:
if (Message_ShouldAdvance(play) && func_80037C94(play, actor, arg2)) {
Audio_PlaySfxGeneral(NA_SE_SY_CANCEL, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_CANCEL);
msgCtx->msgMode = MSGMODE_TEXT_CLOSING;
ret = true;
}
Expand Down
48 changes: 16 additions & 32 deletions src/code/z_collision_check.c
Original file line number Diff line number Diff line change
Expand Up 10000 @@ -1566,11 +1566,9 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c
if (flags == ATELEM_SFX_NORMAL && collider->colMaterial != COL_MATERIAL_METAL) {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos);
if (collider->actor == NULL) {
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_BOUND);
} else {
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND);
}
} else if (flags == ATELEM_SFX_NORMAL) { // collider->colMaterial == COL_MATERIAL_METAL
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_METAL, hitPos);
Expand All @@ -1582,20 +1580,16 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c
} else if (flags == ATELEM_SFX_HARD) {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos);
if (collider->actor == NULL) {
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_BOUND);
} else {
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &collider->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&collider->actor->projectedPos, NA_SE_IT_SHIELD_BOUND);
}
} else if (flags == ATELEM_SFX_WOOD) {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_DUST, hitPos);
if (collider->actor == NULL) {
Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_IT_REFLECTION_WOOD);
} else {
Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &collider->actor->projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&collider->actor->projectedPos, NA_SE_IT_REFLECTION_WOOD);
}
}
}
Expand All @@ -1606,17 +1600,13 @@ void CollisionCheck_HitSolid(PlayState* play, ColliderElement* elem, Collider* c
s32 CollisionCheck_SwordHitAudio(Collider* atCol, ColliderElement* acElem) {
if (atCol->actor != NULL && atCol->actor->category == ACTORCAT_PLAYER) {
if (acElem->elemMaterial == ELEM_MATERIAL_UNK0) {
Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_IT_SWORD_STRIKE);
} else if (acElem->elemMaterial == ELEM_MATERIAL_UNK1) {
Audio_PlaySfxGeneral(NA_SE_IT_SWORD_STRIKE_HARD, &atCol->actor->projectedPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_IT_SWORD_STRIKE_HARD);
} else if (acElem->elemMaterial == ELEM_MATERIAL_UNK2) {
Audio_PlaySfxGeneral(NA_SE_NONE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_NONE);
} else if (acElem->elemMaterial == ELEM_MATERIAL_UNK3) {
Audio_PlaySfxGeneral(NA_SE_NONE, &atCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&atCol->actor->projectedPos, NA_SE_NONE);
}
}
return true;
Expand Down Expand Up @@ -1693,8 +1683,7 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* atCol, ColliderElement
} else if (sHitInfo[acCol->colMaterial].effect == HIT_WOOD) {
if (atCol->actor == NULL) {
CollisionCheck_SpawnShieldParticles(play, hitPos);
Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_IT_REFLECTION_WOOD);
} else {
CollisionCheck_SpawnShieldParticlesWood(play, hitPos, &atCol->actor->projectedPos);
}
Expand All @@ -1707,11 +1696,9 @@ void CollisionCheck_HitEffects(PlayState* play, Collider* atCol, ColliderElement
} else {
EffectSsHitMark_SpawnFixedScale(play, EFFECT_HITMARK_WHITE, hitPos);
if (acCol->actor == NULL) {
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_BOUND);
} else {
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_BOUND, &acCol->actor->projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(&acCol->actor->projectedPos, NA_SE_IT_SHIELD_BOUND);
}
}
}
Expand Down Expand Up @@ -3525,17 +3512,15 @@ void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v) {
*/
void CollisionCheck_SpawnShieldParticlesMetal(PlayState* play, Vec3f* v) {
CollisionCheck_SpawnShieldParticles(play, v);
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_SW, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_IT_SHIELD_REFLECT_SW);
}

/**
* Spawns streaks of light and plays a metallic sound effect at the specified position
*/
void CollisionCheck_SpawnShieldParticlesMetalSfx(PlayState* play, Vec3f* v, Vec3f* pos) {
CollisionCheck_SpawnShieldParticles(play, v);
Audio_PlaySfxGeneral(NA_SE_IT_SHIELD_REFLECT_SW, pos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_AT_POS(pos, NA_SE_IT_SHIELD_REFLECT_SW);
}

/**
Expand Down Expand Up @@ -3575,8 +3560,7 @@ void CollisionCheck_SpawnShieldParticlesWood(PlayState* play, Vec3f* v, Vec3f* a
woodInit.lightPoint.z = woodInit.position.z;

Effect_Add(play, &effectIndex, EFFECT_SHIELD_PARTICLE, 0, 1, &woodInit);
Audio_PlaySfxGeneral(NA_SE_IT_REFLECTION_WOOD, actorPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_AT_POS(actorPos, NA_SE_IT_REFLECTION_WOOD);
}

/**
Expand Down
9 changes: 3 additions & 6 deletions src/code/z_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) ||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) &&
(gSaveContext.fileNum != 0xFEDC) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) {
Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_PIECE_OF_HEART);
titleDemoSkipped = true;
}

Expand Down Expand Up @@ -1472,14 +1471,12 @@ void CutsceneCmd_Transition(PlayState* play, CutsceneContext* csCtx, CsCmdTransi
play->envCtx.screenFillColor[3] = 255.0f * lerp;

if ((lerp == 0.0f) && (gSaveContext.save.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0)) {
Audio_PlaySfxGeneral(NA_SE_SY_WHITE_OUT_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_WHITE_OUT_S);
} else if ((lerp == 0.0f) &&
((gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_0) ||
(gSaveContext.save.entranceIndex == ENTR_HYRULE_CASTLE_0) ||
(gSaveContext.save.entranceIndex == ENTR_GREAT_FAIRYS_FOUNTAIN_SPELLS_0))) {
Audio_PlaySfxGeneral(NA_SE_EV_WHITE_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_EV_WHITE_OUT);
} else if ((lerp == 0.0f) && (play->sceneId == SCENE_INSIDE_GANONS_CASTLE)) {
Sfx_PlaySfxCentered2(NA_SE_EV_WHITE_OUT);
}
Expand Down
6 changes: 2 additions & 4 deletions src/code/z_en_item00.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,17 +965,15 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
}

if ((*params <= ITEM00_RUPEE_RED) || (*params == ITEM00_RUPEE_ORANGE)) {
Audio_PlaySfxGeneral(NA_SE_SY_GET_RUPY, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_GET_RUPY);
} else if (getItemId != GI_NONE) {
if (Actor_HasParent(&this->actor, play)) {
Flags_SetCollectible(play, this->collectibleFlag);
Actor_Kill(&this->actor);
}
return;
} else {
Audio_PlaySfxGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_GET_ITEM);
}

Flags_SetCollectible(play, this->collectibleFlag);
Expand Down
6 changes: 2 additions & 4 deletions src/code/z_fbdemo_circle.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ void TransitionCircle_Start(void* thisx) {
} else {
this->texY = (s32)(125.0f * (1 << 2));
if (this->appearanceType == TCA_RIPPLE) {
Audio_PlaySfxGeneral(NA_SE_OC_SECRET_WARP_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_OC_SECRET_WARP_OUT);
}
}

Expand All @@ -93,8 +92,7 @@ void TransitionCircle_Update(void* thisx, s32 updateRate) {
if (this->direction != TRANS_CIRCLE_DIR_IN) {
if (this->texY == 0) {
if (this->appearanceType == TCA_RIPPLE) {
Audio_PlaySfxGeneral(NA_SE_OC_SECRET_WARP_IN, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_OC_SECRET_WARP_IN);
}
}
this->texY += this->speed * 3 / updateRate;
Expand Down
9 changes: 3 additions & 6 deletions src/code/z_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,22 +608,19 @@ void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) {
* Play a sound effect at the center of the screen.
*/
void Sfx_PlaySfxCentered(u16 sfxId) {
Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_CENTERED(sfxId);
}

/**
* Play a sound effect at the center of the screen. Identical to `Sfx_PlaySfxCentered`.
*/
void Sfx_PlaySfxCentered2(u16 sfxId) {
Audio_PlaySfxGeneral(sfxId, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_CENTERED(sfxId);
}

/**
* Play a sound effect at the requested position.
*/
void Sfx_PlaySfxAtPos(Vec3f* projectedPos, u16 sfxId) {
Audio_PlaySfxGeneral(sfxId, projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_AT_POS(projectedPos, sfxId);
}
16 changes: 4 additions & 12 deletions src/code/z_map_exp.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,9 @@ void Minimap_Draw(PlayState* play) {
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) {
PRINTF("Game_play_demo_mode_check=%d\n", Play_InCsMode(play));
// clang-format off
if (!R_MINIMAP_DISABLED) { Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
if (!R_MINIMAP_DISABLED) { SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_UP);
} else {
Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_DOWN);
}
// clang-format on
R_MINIMAP_DISABLED ^= 1;
Expand Down Expand Up @@ -541,13 +537,9 @@ void Minimap_Draw(PlayState* play) {

if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play)) {
// clang-format off
if (!R_MINIMAP_DISABLED) { Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
if (!R_MINIMAP_DISABLED) { SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_UP);
} else {
Audio_PlaySfxGeneral(NA_SE_SY_CAMERA_ZOOM_DOWN, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
SFX_PLAY_CENTERED(NA_SE_SY_CAMERA_ZOOM_DOWN);
}
// clang-format on
R_MINIMAP_DISABLED ^= 1;
Expand Down
Loading
0