aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2009-12-29 23:25:24 +0000
committerMartin Kiewitz2009-12-29 23:25:24 +0000
commit2576f4b0bdff2bcff5f8667780c1254b3f2d84a2 (patch)
treecd162120126d043959e60bc67799bfda6d666be7 /engines
parentfb8ecae7f1904f9d992ce3a01356febcd94d9e36 (diff)
downloadscummvm-rg350-2576f4b0bdff2bcff5f8667780c1254b3f2d84a2.tar.gz
scummvm-rg350-2576f4b0bdff2bcff5f8667780c1254b3f2d84a2.tar.bz2
scummvm-rg350-2576f4b0bdff2bcff5f8667780c1254b3f2d84a2.zip
SCI/newmusic: fixed fading (fixes gk1 demo, park area)
svn-id: r46730
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sfx/music.cpp2
-rw-r--r--engines/sci/sfx/soundcmd.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp
index 88dcec2b6f..a2f84f6ec6 100644
--- a/engines/sci/sfx/music.cpp
+++ b/engines/sci/sfx/music.cpp
@@ -378,6 +378,8 @@ void MusicEntry::doFade() {
volume = fadeTo;
fadeStep = 0;
}
+ SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan; // HACK
+ PUT_SEL32V(segMan, soundObj, vol, volume);
pMidiParser->setVolume(volume);
}
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index 918b744c4e..124a93025f 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -640,11 +640,14 @@ void SoundCommandParser::cmdFadeHandle(reg_t obj, int16 value) {
return;
}
- int volume = GET_SEL32V(_segMan, obj, vol);
+ int volume = musicSlot->volume;
+ PUT_SEL32V(_segMan, musicSlot->soundObj, vol, volume);
musicSlot->fadeTo = _argv[2].toUint16();
musicSlot->fadeStep = volume > _argv[2].toUint16() ? -_argv[4].toUint16() : _argv[4].toUint16();
musicSlot->fadeTickerStep = _argv[3].toUint16() * 16667 / _music->soundGetTempo();
musicSlot->fadeTicker = 0;
+
+ debugC(2, kDebugLevelSound, "cmdFadeHandle: to %d, step %d, ticker %d", musicSlot->fadeTo, musicSlot->fadeStep, musicSlot->fadeTickerStep);
#endif
}