mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-02 14:16:53 +00:00
Fix audio regression: Don't "WalkCurve" on state OFF
This commit is contained in:
parent
dda6a39b6f
commit
2c9a1123f0
@ -804,23 +804,26 @@ void ADSREnvelope::SetState(ADSRState state) {
|
||||
}
|
||||
|
||||
void ADSREnvelope::Step() {
|
||||
WalkCurve(type_);
|
||||
switch (state_) {
|
||||
case STATE_ATTACK:
|
||||
WalkCurve(type_);
|
||||
if (height_ > PSP_SAS_ENVELOPE_HEIGHT_MAX || height_ < 0)
|
||||
SetState(STATE_DECAY);
|
||||
break;
|
||||
case STATE_DECAY:
|
||||
WalkCurve(type_);
|
||||
if (height_ > PSP_SAS_ENVELOPE_HEIGHT_MAX || height_ < sustainLevel)
|
||||
SetState(STATE_SUSTAIN);
|
||||
break;
|
||||
case STATE_SUSTAIN:
|
||||
WalkCurve(type_);
|
||||
if (height_ <= 0) {
|
||||
height_ = 0;
|
||||
SetState(STATE_RELEASE);
|
||||
}
|
||||
break;
|
||||
case STATE_RELEASE:
|
||||
WalkCurve(type_);
|
||||
if (height_ <= 0) {
|
||||
height_ = 0;
|
||||
SetState(STATE_OFF);
|
||||
|
Loading…
Reference in New Issue
Block a user