aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRuud Klaver2016-09-18 20:32:47 +0200
committerColin Snover2017-10-04 23:29:38 -0500
commitcedd9d3c40503ec74575ea133a60c569a57238c4 (patch)
tree9716f2c19c995713423c56db3236e2f32f8f6bdc /engines
parent1ff9e931dc4d6253edacf8fcb05bd9c358c70027 (diff)
downloadscummvm-rg350-cedd9d3c40503ec74575ea133a60c569a57238c4.tar.gz
scummvm-rg350-cedd9d3c40503ec74575ea133a60c569a57238c4.tar.bz2
scummvm-rg350-cedd9d3c40503ec74575ea133a60c569a57238c4.zip
SCI: Play MIDI version of SCI0 sound resource if user prefers it
If the user has "Prefer digital sound effects" disabled for a SCI0 game, do not play the digital sample version of a sound resource, if such data is present. When the resource has only digital sample data and no MIDI information, play the sample instead. Closes gh-1022.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/sound/music.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 647f588d1e..5530952dcf 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -350,8 +350,27 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
pSnd->time = ++_timeCounter;
if (track) {
+ bool playSample;
+
+ if (_soundVersion <= SCI_VERSION_0_LATE && !_useDigitalSFX) {
+ // For SCI0 the digital sample is present in the same track as the
+ // MIDI. If the user specifically requests not to use the digital
+ // samples, play the MIDI data instead. If the MIDI portion of the
+ // track is empty however, play the digital sample anyway. This is
+ // necessary for e.g. the "Where am I?" sample in the SQ3 intro.
+ playSample = false;
+
+ if (track->channelCount == 2) {
+ SoundResource::Channel &chan = track->channels[0];
+ if (chan.data.size() < 2 || chan.data[1] == SCI_MIDI_EOT) {
+ playSample = true;
+ }
+ }
+ } else
+ playSample = (track->digitalChannelNr != -1);
+
// Play digital sample
- if (track->digitalChannelNr != -1) {
+ if (playSample) {
const SciSpan<const byte> &channelData = track->channels[track->digitalChannelNr].data;
delete pSnd->pStreamAud;
byte flags = Audio::FLAG_UNSIGNED;