diff options
| author | briaguya <70942617+briaguya-ai@users.noreply.github.com> | 2023-02-16 18:45:51 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-16 18:45:51 -0500 |
| commit | f4f10e4a4934a2824ce623c3aeb482186b132051 (patch) | |
| tree | af909ee5f1421ce2d38f09859dd86fcd3596ef99 /soh/src/code | |
| parent | 6b93da37d437235ffa119560382525285d068002 (diff) | |
don't show duped sequence names, don't repeat track intros on barinade (#2482)
* better fix for repeated sequence names, add delay to fix repeated bgm on barinade
---------
Co-authored-by: briaguya <briaguya@alice>
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/audio_load.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index fe1d25882..81d395a81 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -610,9 +610,32 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) { seqPlayer->delay = 0; seqPlayer->finished = 0; seqPlayer->playerIdx = playerIdx; + + // Fix for barinade boss fight starting music multiple times + // this is not noticeable if the sequence is authentic, since the "Boss Battle" + // sequence begins with some silence + if (gPlayState != NULL && + gPlayState->sceneNum == SCENE_BDAN_BOSS && + playerIdx == SEQ_PLAYER_BGM_MAIN && + seqId != NA_BGM_BOSS) { + + seqPlayer->delay = 10; + } + AudioSeq_SkipForwardSequence(seqPlayer); //! @bug missing return (but the return value is not used so it's not UB) - if (CVarGetInteger("gSeqNameOverlay", 0) && playerIdx == SEQ_PLAYER_BGM_MAIN) { + + // Keep track of the previous sequence/scene so we don't repeat notifications + static uint16_t previousSeqId = UINT16_MAX; + static int16_t previousSceneNum = INT16_MAX; + if (CVarGetInteger("gSeqNameOverlay", 0) && + playerIdx == SEQ_PLAYER_BGM_MAIN && + (seqId != previousSeqId || (gPlayState != NULL && gPlayState->sceneNum != previousSceneNum))) { + + previousSeqId = seqId; + if (gPlayState != NULL) { + previousSceneNum = gPlayState->sceneNum; + } const char* sequenceName = AudioCollection_GetSequenceName(seqId); if (sequenceName != NULL) { Overlay_DisplayText_Seconds(CVarGetInteger("gSeqNameOverlayDuration", 5), sequenceName); |
