(Basically, it should never allow the same volume level as the previous
calculation.)
| ... | ... |
@@ -445,9 +445,10 @@ void Channel::Update() |
| 445 | 445 |
case CS_ATTACK: |
| 446 | 446 |
{
|
| 447 | 447 |
int newAmpl = this->ampl; |
| 448 |
+ int oldAmpl = this->ampl >> 7; |
|
| 448 | 449 |
do |
| 449 | 450 |
newAmpl = (newAmpl * static_cast<int>(this->attackLvl)) / 256; |
| 450 |
- while (newAmpl == this->ampl); |
|
| 451 |
+ while ((newAmpl >> 7) == oldAmpl); |
|
| 451 | 452 |
this->ampl = newAmpl; |
| 452 | 453 |
if (!this->ampl) |
| 453 | 454 |
this->state = CS_DECAY; |