aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-11 14:26:13 +0000
committerFilippos Karapetis2010-01-11 14:26:13 +0000
commit70694f98580012a4cea668a43fbae9de78fa3596 (patch)
treea0baff7e90dc54b6194c719a0ba1b2e8a58dd20a /engines/sci
parent6d53dfe917ffdc6c569c29d82957214cc8a24afc (diff)
downloadscummvm-rg350-70694f98580012a4cea668a43fbae9de78fa3596.tar.gz
scummvm-rg350-70694f98580012a4cea668a43fbae9de78fa3596.tar.bz2
scummvm-rg350-70694f98580012a4cea668a43fbae9de78fa3596.zip
New music code: Implemented sound stopping after fading, and disabled MIDI sound volume fading, till we figure out what's wrong with fading in the Sierra logo screen in GK1
svn-id: r47252
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sound/music.cpp8
-rw-r--r--engines/sci/sound/music.h1
-rw-r--r--engines/sci/sound/soundcmd.cpp7
3 files changed, 14 insertions, 2 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 4b452aad56..fd1e6f1bd9 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -36,6 +36,9 @@
namespace Sci {
+// When defined, volume fading immediately sets the final sound volume
+#define DISABLE_VOLUME_FADING
+
SciMusic::SciMusic(SciVersion soundVersion)
: _soundVersion(soundVersion), _soundOn(true) {
@@ -513,6 +516,7 @@ MusicEntry::MusicEntry() {
fadeTickerStep = 0;
fadeSetVolume = false;
fadeCompleted = false;
+ stopAfterFading = false;
status = kSoundStopped;
@@ -557,7 +561,11 @@ void MusicEntry::doFade() {
// Only process MIDI streams in this thread, not digital sound effects
if (pMidiParser)
+#ifndef DISABLE_VOLUME_FADING
pMidiParser->setVolume(volume);
+#else
+ pMidiParser->setVolume(fadeTo);
+#endif
fadeSetVolume = true; // set flag so that SoundCommandParser::cmdUpdateCues will set the volume of the stream
}
}
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h
index ce1570eb2c..049e192c23 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -95,6 +95,7 @@ public:
uint32 fadeTickerStep;
bool fadeSetVolume;
bool fadeCompleted;
+ bool stopAfterFading;
SoundStatus status;
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 8a09b078cf..feaa2e6906 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -669,12 +669,13 @@ void SoundCommandParser::cmdFadeSound(reg_t obj, int16 value) {
musicSlot->fadeTicker = 0;
break;
- case 5: // Possibly SCI1?!
- case 6: // SCI 1.1 TODO: find out what additional parameter is
+ case 5: // SCI01+
+ case 6: // SCI1+ (SCI1 late sound scheme), with fade and continue
musicSlot->fadeTo = CLIP<uint16>(_argv[2].toUint16(), 0, MUSIC_VOLUME_MAX);
musicSlot->fadeStep = volume > _argv[2].toUint16() ? -_argv[4].toUint16() : _argv[4].toUint16();
musicSlot->fadeTickerStep = _argv[3].toUint16() * 16667 / _music->soundGetTempo();
musicSlot->fadeTicker = 0;
+ musicSlot->stopAfterFading = (_argc == 6) ? (_argv[5].toUint16() != 0) : false;
break;
default:
@@ -846,6 +847,8 @@ void SoundCommandParser::cmdUpdateCues(reg_t obj, int16 value) {
cmdStopSound(obj, 0);
} else {
PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
+ if (musicSlot->stopAfterFading)
+ cmdStopSound(obj, 0);
}
}