port: don't doubleswap envelope data

this fixes music running out of free channels
This commit is contained in:
fgsfds 2023-08-09 19:08:48 +02:00
parent 18bab30c59
commit 60e64e1a1d
1 changed files with 6 additions and 4 deletions

View File

@ -98,10 +98,12 @@ static inline void preprocessALSound(ALSound *snd, u8 *bankBase)
if (snd->envelope) {
PD_SWAP_PTR(snd->envelope);
ALEnvelope *env = PD_PTR_BASE(snd->envelope, bankBase);
PD_SWAP_VAL(env->attackTime);
PD_SWAP_VAL(env->releaseTime);
PD_SWAP_VAL(env->decayTime);
if (!alreadySwapped((intptr_t)snd->envelope)) {
ALEnvelope *env = PD_PTR_BASE(snd->envelope, bankBase);
PD_SWAP_VAL(env->attackTime);
PD_SWAP_VAL(env->releaseTime);
PD_SWAP_VAL(env->decayTime);
}
}
if (snd->keyMap) {