aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-05-03 17:54:47 +0000
committerMartin Kiewitz2010-05-03 17:54:47 +0000
commitb07a88548f47351fc2e89685312904e45e7664b4 (patch)
tree18c1d94c3275c6c251347465a99198934f9e039d
parentc67344d380fd964334df6d00d9ddb99ab2394fbd (diff)
downloadscummvm-rg350-b07a88548f47351fc2e89685312904e45e7664b4.tar.gz
scummvm-rg350-b07a88548f47351fc2e89685312904e45e7664b4.tar.bz2
scummvm-rg350-b07a88548f47351fc2e89685312904e45e7664b4.zip
SCI: set signal in SCI0/SCI01 games, when samples have been played only. fixes sq3 guys from andromeda, but also doesn't screw up music in sq3new/kq1 - added comments about this issue
svn-id: r48918
-rw-r--r--engines/sci/sound/soundcmd.cpp16
-rw-r--r--engines/sci/sound/soundcmd.h2
2 files changed, 16 insertions, 2 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 20bce575f5..48b65c2810 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -498,6 +498,10 @@ void SoundCommandParser::cmdDisposeSound(reg_t obj, int16 value) {
}
void SoundCommandParser::cmdStopSound(reg_t obj, int16 value) {
+ processStopSound(obj, value, false);
+}
+
+void SoundCommandParser::processStopSound(reg_t obj, int16 value, bool sampleFinishedPlaying) {
if (!obj.segment)
return;
@@ -517,9 +521,17 @@ void SoundCommandParser::cmdStopSound(reg_t obj, int16 value) {
PUT_SEL32V(_segMan, obj, SELECTOR(state), kSoundStopped);
} else {
PUT_SEL32V(_segMan, obj, SELECTOR(handle), 0);
- PUT_SEL32V(_segMan, obj, SELECTOR(signal), SIGNAL_OFFSET);
}
+ // Set signal selector in sound SCI0 games only, when the sample has finished playing
+ // If we don't set it at all, we get a problem when using vaporizer on the 2 guys
+ // If we set it all the time, we get no music in sq3new and kq1
+ // FIXME: this *may* be wrong, it's impossible to find out in sierra DOS sci, because SCI0 under DOS didn't have
+ // sfx drivers included
+ // We need to set signal in sound SCI1+ games all the time
+ if ((_soundVersion > SCI_VERSION_0_LATE) || sampleFinishedPlaying)
+ PUT_SEL32V(_segMan, obj, SELECTOR(signal), SIGNAL_OFFSET);
+
musicSlot->dataInc = 0;
musicSlot->signal = 0;
_music->soundStop(musicSlot);
@@ -812,7 +824,7 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) {
musicSlot->sampleLoopCounter = currentLoopCounter;
}
if (!_music->soundIsActive(musicSlot)) {
- cmdStopSound(obj, 0);
+ processStopSound(obj, 0, true);
} else {
_music->updateAudioStreamTicker(musicSlot);
}
diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h
index 41ce9517a9..09cca23450 100644
--- a/engines/sci/sound/soundcmd.h
+++ b/engines/sci/sound/soundcmd.h
@@ -130,6 +130,8 @@ private:
void cmdSetSoundLoop(reg_t obj, int16 value);
void cmdSuspendSound(reg_t obj, int16 value);
+ void processStopSound(reg_t obj, int16 value, bool sampleFinishedPlaying);
+
#ifdef USE_OLD_MUSIC_FUNCTIONS
void changeSoundStatus(reg_t obj, int newStatus);
#endif