aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-02 17:16:59 +0000
committerMartin Kiewitz2010-01-02 17:16:59 +0000
commit6fa3c10aedfc0a6277428707edd8b3b35d1df2c6 (patch)
treec66f40fd5dc0be5d54a276156dd5452f1f9229cb /engines/sci
parent2ef3983ed8fc1222546058e9db547e0a90dd92c7 (diff)
downloadscummvm-rg350-6fa3c10aedfc0a6277428707edd8b3b35d1df2c6.tar.gz
scummvm-rg350-6fa3c10aedfc0a6277428707edd8b3b35d1df2c6.tar.bz2
scummvm-rg350-6fa3c10aedfc0a6277428707edd8b3b35d1df2c6.zip
SCI/newmusic: fading signal handling changed... fixes lsl1demo and gk1demo
svn-id: r46891
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sfx/music.cpp3
-rw-r--r--engines/sci/sfx/music.h1
-rw-r--r--engines/sci/sfx/soundcmd.cpp16
3 files changed, 9 insertions, 11 deletions
diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp
index cedcd1c923..852321bb37 100644
--- a/engines/sci/sfx/music.cpp
+++ b/engines/sci/sfx/music.cpp
@@ -535,6 +535,7 @@ MusicEntry::MusicEntry() {
fadeTicker = 0;
fadeTickerStep = 0;
fadeSetVolume = false;
+ fadeCompleted = false;
status = kSoundStopped;
@@ -572,7 +573,7 @@ void MusicEntry::doFade() {
if (((fadeStep > 0) && (fadeVolume >= fadeTo)) || ((fadeStep < 0) && (fadeVolume <= fadeTo))) {
fadeVolume = fadeTo;
fadeStep = 0;
- signal = SIGNAL_OFFSET;
+ fadeCompleted = true;
}
volume = fadeVolume;
diff --git a/engines/sci/sfx/music.h b/engines/sci/sfx/music.h
index f59e594939..5f101ed39f 100644
--- a/engines/sci/sfx/music.h
+++ b/engines/sci/sfx/music.h
@@ -94,6 +94,7 @@ public:
uint32 fadeTicker;
uint32 fadeTickerStep;
bool fadeSetVolume;
+ bool fadeCompleted;
SoundStatus status;
diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp
index f7ff987838..e8e599bc5c 100644
--- a/engines/sci/sfx/soundcmd.cpp
+++ b/engines/sci/sfx/soundcmd.cpp
@@ -803,16 +803,7 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) {
}
break;
case SIGNAL_OFFSET:
- // Check if this signal is the end of the track or the end of fading effect.
- // If this came from a fading effect, don't stop the track here, it'll be stopped
- // by the engine scripts
- if (musicSlot->fadeSetVolume) {
- musicSlot->fadeSetVolume = false;
- // Notify the game scripts that music fading is done
- PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
- } else {
- cmdStopSound(obj, 0);
- }
+ cmdStopSound(obj, 0);
break;
default:
// Sync the signal of the sound object
@@ -821,6 +812,11 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) {
}
}
+ if (musicSlot->fadeCompleted) {
+ musicSlot->fadeCompleted = false;
+ PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
+ }
+
// Sync loop selector for SCI0
if (_soundVersion <= SCI_VERSION_0_LATE)
PUT_SEL32V(_segMan, obj, loop, musicSlot->loop);