aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-09-06 18:23:03 +0000
committerMartin Kiewitz2010-09-06 18:23:03 +0000
commit2bf82a8354df9bbf4ef5ebaedc928ad10c7c986c (patch)
treee073e2bad22e56a22e1ff34129d97fc50ada6bb4 /engines/sci
parentc78a63460be88bce41125f8555bf1d5ffdfa9ad0 (diff)
downloadscummvm-rg350-2bf82a8354df9bbf4ef5ebaedc928ad10c7c986c.tar.gz
scummvm-rg350-2bf82a8354df9bbf4ef5ebaedc928ad10c7c986c.tar.bz2
scummvm-rg350-2bf82a8354df9bbf4ef5ebaedc928ad10c7c986c.zip
SCI: fix regression of r52569
fade in/out of samples svn-id: r52604
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sound/music.cpp7
-rw-r--r--engines/sci/sound/music.h1
-rw-r--r--engines/sci/sound/soundcmd.cpp2
3 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index e2540e1a8f..e90329a879 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -431,6 +431,13 @@ void SciMusic::soundSetVolume(MusicEntry *pSnd, byte volume) {
}
}
+// this is used to set volume of the sample, used for fading only!
+void SciMusic::soundSetSampleVolume(MusicEntry *pSnd, byte volume) {
+ assert(volume <= MUSIC_VOLUME_MAX);
+ assert(pSnd->pStreamAud);
+ _pMixer->setChannelVolume(pSnd->hCurrentAud, volume * 2); // Mixer is 0-255, SCI is 0-127
+}
+
void SciMusic::soundSetPriority(MusicEntry *pSnd, byte prio) {
Common::StackLock lock(_mutex);
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h
index b10f64aa18..21d930fc9a 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -148,6 +148,7 @@ public:
void soundResume(MusicEntry *pSnd);
void soundToggle(MusicEntry *pSnd, bool pause);
void soundSetVolume(MusicEntry *pSnd, byte volume);
+ void soundSetSampleVolume(MusicEntry *pSnd, byte volume);
void soundSetPriority(MusicEntry *pSnd, byte prio);
uint16 soundGetMasterVolume();
void soundSetMasterVolume(uint16 vol);
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 84aedc8515..c5bb7fa707 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -402,7 +402,7 @@ void SoundCommandParser::processUpdateCues(reg_t obj) {
}
// We get a flag from MusicEntry::doFade() here to set volume for the stream
if (musicSlot->fadeSetVolume) {
- _music->soundSetVolume(musicSlot, musicSlot->volume);
+ _music->soundSetSampleVolume(musicSlot, musicSlot->volume);
musicSlot->fadeSetVolume = false;
}
} else if (musicSlot->pMidiParser) {