diff options
author | Martin Kiewitz | 2009-12-27 15:41:31 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-12-27 15:41:31 +0000 |
commit | e371c4a1bde1e3623cbbe0d525fc945a741259d2 (patch) | |
tree | 578d334421bde4e2198d8fa558068861fd6ca158 /engines/sci | |
parent | ac224a7f8a9b086f4cd26e5c30751edb7ba526f4 (diff) | |
download | scummvm-rg350-e371c4a1bde1e3623cbbe0d525fc945a741259d2.tar.gz scummvm-rg350-e371c4a1bde1e3623cbbe0d525fc945a741259d2.tar.bz2 scummvm-rg350-e371c4a1bde1e3623cbbe0d525fc945a741259d2.zip |
SCI/newmusic: Fixed fading (fixes intro of castle of brain)
svn-id: r46651
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sfx/music.cpp | 10 | ||||
-rw-r--r-- | engines/sci/sfx/music.h | 2 |
2 files changed, 5 insertions, 7 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); } } } diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h index 861ddf69e3..0c7bc2e976 100644 --- a/engines/sci/sfx/music.h +++ b/engines/sci/sfx/music.h @@ -71,7 +71,7 @@ struct MusicEntry { uint16 ticker; byte prio; byte loop; - byte volume; + int16 volume; byte fadeTo; short fadeStep; |