Allow envelopes with delay values of 0 on init (#625)

This allows sounds to start instantly without any fade-in. Using new soundbanks with delay values of 0 will not compile with base decomp, but old decomp-compliant soundbanks will work with this commit.
This commit is contained in:
Gregory Heskett
2023-06-07 06:46:12 -04:00
committed by GitHub
parent dde6e7da1a
commit 50b023ef21
4 changed files with 8 additions and 7 deletions

View File

@@ -428,8 +428,9 @@ s32 adsr_update(struct Note *note) {
adsr->target = adsr->target * adsr->target;
adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
#else // !(VERSION_EU || VERSION_SH)
if (isInit && adsr->delay <= 1) {
note->initFullVelocity = TRUE;
if (adsr->delay <= 0) {
adsr->delay = 1;
note->initFullVelocity = isInit;
}
adsr->target = BSWAP16(adsr->envelope[adsr->envIndex].arg);

View File

@@ -26,10 +26,10 @@ enum ADSRActions {
};
enum ADSRDelays {
ADSR_DISABLE = 0,
ADSR_HANG = -1,
ADSR_GOTO = -2,
ADSR_RESTART = -3,
ADSR_DISABLE = -4,
};
enum VibratoModes {