aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-09 18:11:42 +0000
committerMartin Kiewitz2010-07-09 18:11:42 +0000
commit18d1ab8c709602d71ad4175c29d4517f1bc5bbab (patch)
treea930f09481c89aa21a9662b406d044f953359d50 /engines/sci/sound
parentabd2057408794c1cb9618532a77e738bda6d7a4f (diff)
downloadscummvm-rg350-18d1ab8c709602d71ad4175c29d4517f1bc5bbab.tar.gz
scummvm-rg350-18d1ab8c709602d71ad4175c29d4517f1bc5bbab.tar.bz2
scummvm-rg350-18d1ab8c709602d71ad4175c29d4517f1bc5bbab.zip
SCI: move comments and change selector for sci0 sound in kDoSoundPause, also allow pausing everything even for sci1early (qfg2 is using it)
svn-id: r50765
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/soundcmd.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 26fbfb6c7c..5ac8c6b270 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -210,16 +210,21 @@ void SoundCommandParser::processStopSound(reg_t obj, bool sampleFinishedPlaying)
reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) {
if (_soundVersion <= SCI_VERSION_0_LATE) {
+ // SCI0 games give us 0/1 for either resuming or pausing the current music
+ // this one doesn't count, so pausing 2 times and resuming once means here that we are supposed to resume
uint16 value = argv[0].toUint16();
MusicEntry *musicSlot = _music->getActiveSci0MusicSlot();
switch (value) {
case 1:
- if ((musicSlot) && (musicSlot->status == kSoundPlaying))
+ if ((musicSlot) && (musicSlot->status == kSoundPlaying)) {
_music->soundPause(musicSlot);
+ writeSelectorValue(_segMan, musicSlot->soundObj, SELECTOR(state), kSoundPaused);
+ }
return make_reg(0, 0);
case 0:
if ((musicSlot) && (musicSlot->status == kSoundPaused)) {
_music->soundResume(musicSlot);
+ writeSelectorValue(_segMan, musicSlot->soundObj, SELECTOR(state), kSoundPlaying);
return make_reg(0, 1);
}
return make_reg(0, 0);
@@ -231,13 +236,6 @@ reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) {
reg_t obj = argv[0];
uint16 value = argc > 1 ? argv[1].toUint16() : 0;
if (!obj.segment) { // pause the whole playlist
- // SCI0 games (up to including qfg1) give us 0/1 for either resuming or pausing the current music
- // this one doesn't count, so pausing 2 times and resuming once means here that we are supposed to resume
-
- // Pausing/Resuming the whole playlist was introduced in the SCI1 late sound scheme.
- if (_soundVersion <= SCI_VERSION_1_EARLY)
- return acc;
-
_music->pauseAll(value);
} else { // pause a playlist slot
MusicEntry *musicSlot = _music->getSlot(obj);
@@ -246,13 +244,7 @@ reg_t SoundCommandParser::kDoSoundPause(int argc, reg_t *argv, reg_t acc) {
return acc;
}
- if (_soundVersion <= SCI_VERSION_0_LATE) {
- // Always pause the sound in SCI0 games. It's resumed in cmdResumeSound()
- writeSelectorValue(_segMan, musicSlot->soundObj, SELECTOR(state), kSoundPaused);
- _music->soundPause(musicSlot);
- } else {
- _music->soundToggle(musicSlot, value);
- }
+ _music->soundToggle(musicSlot, value);
}
return acc;
}