aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-12-29 00:22:39 +0000
committerFilippos Karapetis2009-12-29 00:22:39 +0000
commitac4551a39f838b945feb2847ebacc71eb3003c03 (patch)
treeb10aa4e1b2cc571c29f84e86f0808da84538ee6d /engines
parentb65e4a8f749d90b7c5109b5b2cb9e5ac188815c4 (diff)
downloadscummvm-rg350-ac4551a39f838b945feb2847ebacc71eb3003c03.tar.gz
scummvm-rg350-ac4551a39f838b945feb2847ebacc71eb3003c03.tar.bz2
scummvm-rg350-ac4551a39f838b945feb2847ebacc71eb3003c03.zip
SCI/new music code: cmdPauseHandle/cmdResumeHandle now work for SCI0 games
svn-id: r46697
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sfx/soundcmd.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index 3f2308b736..7c0ceba982 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -516,6 +516,7 @@ void SoundCommandParser::cmdPauseHandle(reg_t obj, int16 value) {
else
changeHandleStatus(obj, value ? SOUND_STATUS_SUSPENDED : SOUND_STATUS_PLAYING);
#else
+
MusicEntry *musicSlot = NULL;
MusicList::iterator slotLoop = NULL;
@@ -532,7 +533,7 @@ void SoundCommandParser::cmdPauseHandle(reg_t obj, int16 value) {
do {
if (_soundVersion <= SCI_VERSION_0_LATE) {
- PUT_SEL32V(_segMan, obj, state, kSoundPaused);
+ PUT_SEL32V(_segMan, musicSlot->soundObj, state, kSoundPaused);
_music->soundPause(musicSlot);
} else {
if (value)
@@ -558,14 +559,30 @@ void SoundCommandParser::cmdResumeHandle(reg_t obj, int16 value) {
#ifdef USE_OLD_MUSIC_FUNCTIONS
changeHandleStatus(obj, SOUND_STATUS_PLAYING);
#else
- MusicEntry *musicSlot = _music->getSlot(obj);
- if (!musicSlot) {
- warning("cmdResumeHandle: Slot not found");
- return;
+ MusicEntry *musicSlot = NULL;
+ MusicList::iterator slotLoop = NULL;
+
+ if (!obj.segment) {
+ slotLoop = _music->enumPlayList(NULL);
+ musicSlot = *slotLoop;
+ } else {
+ musicSlot = _music->getSlot(obj);
+ if (!musicSlot) {
+ warning("cmdResumeHandle: Slot not found");
+ return;
+ }
}
- PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
- _music->soundResume(musicSlot);
+ do {
+ PUT_SEL32V(_segMan, musicSlot->soundObj, state, kSoundPlaying);
+ _music->soundResume(musicSlot);
+
+ if (slotLoop) {
+ slotLoop = _music->enumPlayList(slotLoop);
+ if (slotLoop)
+ musicSlot = *slotLoop;
+ }
+ } while (slotLoop);
#endif
}