aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/sfx/music.cpp8
-rw-r--r--engines/sci/sfx/music.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp
index 9d01c2266e..c45cc8c2d9 100644
--- a/engines/sci/sfx/music.cpp
+++ b/engines/sci/sfx/music.cpp
@@ -559,13 +559,15 @@ void MusicEntry::doFade(Audio::Mixer *mixer) {
if (fadeTicker)
fadeTicker--;
else {
+ int16 fadeVolume = volume;
fadeTicker = fadeTickerStep;
- volume += fadeStep;
- if (((fadeStep > 0) && (volume >= fadeTo)) || ((fadeStep < 0) && (volume <= fadeTo))) {
- volume = fadeTo;
+ fadeVolume += fadeStep;
+ if (((fadeStep > 0) && (fadeVolume >= fadeTo)) || ((fadeStep < 0) && (fadeVolume <= fadeTo))) {
+ fadeVolume = fadeTo;
fadeStep = 0;
signal = SIGNAL_OFFSET;
}
+ volume = fadeVolume;
if (pMidiParser)
pMidiParser->setVolume(volume);
diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h
index 34925fe127..f1d5edf53c 100644
--- a/engines/sci/sfx/music.h
+++ b/engines/sci/sfx/music.h
@@ -80,7 +80,7 @@ public:
uint16 signal;
byte prio;
uint16 loop;
- int16 volume;
+ byte volume;
byte hold;
int16 pauseCounter;