aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx/music.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/sfx/music.cpp')
-rw-r--r--engines/sci/sfx/music.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp
index 057b4677bf..9da4b2acbf 100644
--- a/engines/sci/sfx/music.cpp
+++ b/engines/sci/sfx/music.cpp
@@ -370,20 +370,18 @@ void SciMusic::doFade(MusicEntry *pSnd) {
pSnd->fadeTicker--;
else {
pSnd->fadeTicker = pSnd->fadeTickerStep;
- if (pSnd->volume + pSnd->fadeStep > pSnd->fadeTo) {
+ pSnd->volume += pSnd->fadeStep;
+ if (((pSnd->fadeStep > 0) && (pSnd->volume >= pSnd->fadeTo)) || ((pSnd->fadeStep < 0) && (pSnd->volume <= pSnd->fadeTo))) {
pSnd->volume = pSnd->fadeTo;
pSnd->fadeStep = 0;
- } else {
- pSnd->volume += pSnd->fadeStep;
}
pSnd->pMidiParser->setVolume(pSnd->volume);
if (pSnd->fadeStep == 0) {
// Signal the engine scripts that the sound is done fading
- // FIXME: is this correct?
- //SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan; // HACK
- //PUT_SEL32V(segMan, pSnd->soundObj, signal, SIGNAL_OFFSET);
+ SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan; // HACK
+ PUT_SEL32V(segMan, pSnd->soundObj, signal, SIGNAL_OFFSET);
}
}
}