aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-28 13:07:14 +0200
committerFilippos Karapetis2011-12-28 13:14:55 +0200
commit8496b5c4d8134c86735edd90e598d7d94a37bf32 (patch)
tree5a46a8b6090553cad7dab5caa13a677e4d8501ef /engines/sci
parent26f1643e8646cac71b0adb7b88876674134f3613 (diff)
downloadscummvm-rg350-8496b5c4d8134c86735edd90e598d7d94a37bf32.tar.gz
scummvm-rg350-8496b5c4d8134c86735edd90e598d7d94a37bf32.tar.bz2
scummvm-rg350-8496b5c4d8134c86735edd90e598d7d94a37bf32.zip
SCI: Rename _bMultiMidi to _useDigitalSFX and only initialize it inside SoundCommandParser
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sound/music.cpp10
-rw-r--r--engines/sci/sound/music.h7
-rw-r--r--engines/sci/sound/soundcmd.cpp14
-rw-r--r--engines/sci/sound/soundcmd.h4
4 files changed, 18 insertions, 17 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 4ffa8d7590..09cab75c39 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -37,8 +37,8 @@
namespace Sci {
-SciMusic::SciMusic(SciVersion soundVersion)
- : _soundVersion(soundVersion), _soundOn(true), _masterVolume(0), _globalReverb(0) {
+SciMusic::SciMusic(SciVersion soundVersion, bool useDigitalSFX)
+ : _soundVersion(soundVersion), _soundOn(true), _masterVolume(0), _globalReverb(0), _useDigitalSFX(useDigitalSFX) {
// Reserve some space in the playlist, to avoid expensive insertion
// operations
@@ -122,8 +122,6 @@ void SciMusic::init() {
error("Failed to initialize sound driver");
}
- _bMultiMidi = ConfMan.getBool("multi_midi");
-
// Find out what the first possible channel is (used, when doing channel
// remapping).
_driverFirstChannel = _pMidiDrv->getFirstChannel();
@@ -285,10 +283,10 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
SoundResource::Track *track = pSnd->soundRes->getTrackByType(_pMidiDrv->getPlayId());
// If MIDI device is selected but there is no digital track in sound
- // resource try to use adlib's digital sample if possible. Also, if the
+ // resource try to use Adlib's digital sample if possible. Also, if the
// track couldn't be found, load the digital track, as some games depend on
// this (e.g. the Longbow demo).
- if (!track || (_bMultiMidi && track->digitalChannelNr == -1)) {
+ if (!track || (_useDigitalSFX && track->digitalChannelNr == -1)) {
SoundResource::Track *digital = pSnd->soundRes->getDigitalTrack();
if (digital)
track = digital;
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h
index fa6f538a7e..1f798c90d7 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -120,7 +120,7 @@ typedef Common::Array<uint32> MidiCommandQueue;
class SciMusic : public Common::Serializable {
public:
- SciMusic(SciVersion soundVersion);
+ SciMusic(SciVersion soundVersion, bool useDigitalSFX);
~SciMusic();
void init();
@@ -210,9 +210,8 @@ protected:
MidiPlayer *_pMidiDrv;
uint32 _dwTempo;
- // Mixed AdLib/MIDI mode: when enabled from the ScummVM sound options screen,
- // and a sound has a digital track, the sound from the AdLib track is played
- bool _bMultiMidi;
+ // If true and a sound has a digital track, the sound from the AdLib track is played
+ bool _useDigitalSFX;
private:
MusicList _playList;
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 274c532779..4b05a7fb11 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -35,17 +35,19 @@ namespace Sci {
SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, AudioPlayer *audio, SciVersion soundVersion) :
_resMan(resMan), _segMan(segMan), _kernel(kernel), _audio(audio), _soundVersion(soundVersion) {
- _music = new SciMusic(_soundVersion);
- _music->init();
// Check if the user wants synthesized or digital sound effects in SCI1.1
// or later games
- _bMultiMidi = ConfMan.getBool("multi_midi");
+ _useDigitalSFX = ConfMan.getBool("multi_midi");
+
// In SCI2 and later games, this check should always be true - there was
// always only one version of each sound effect or digital music track
// (e.g. the menu music in GK1 - there is a sound effect with the same
// resource number, but it's totally unrelated to the menu music).
if (getSciVersion() >= SCI_VERSION_2)
- _bMultiMidi = true;
+ _useDigitalSFX = true;
+
+ _music = new SciMusic(_soundVersion, _useDigitalSFX);
+ _music->init();
}
SoundCommandParser::~SoundCommandParser() {
@@ -93,7 +95,7 @@ void SoundCommandParser::initSoundResource(MusicEntry *newSound) {
// Found a relevant audio resource, create an audio stream if there is
// no associated sound resource, or if both resources exist and the
// user wants the digital version.
- if (_bMultiMidi || !newSound->soundRes) {
+ if (_useDigitalSFX || !newSound->soundRes) {
int sampleLen;
newSound->pStreamAud = _audio->getAudioStream(newSound->resourceId, 65535, &sampleLen);
newSound->soundType = Audio::Mixer::kSpeechSoundType;
@@ -485,7 +487,7 @@ void SoundCommandParser::processUpdateCues(reg_t obj) {
} else {
// Slot actually has no data (which would mean that a sound-resource w/
// unsupported data is used.
- // (example lsl5 - sound resource 744 - it's roland exclusive
+ // (example lsl5 - sound resource 744 - it's Roland exclusive
writeSelectorValue(_segMan, obj, SELECTOR(signal), SIGNAL_OFFSET);
// If we don't set signal here, at least the switch to the mud wrestling
// room in lsl5 will not work.
diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h
index c1dce014d2..d76f969c7d 100644
--- a/engines/sci/sound/soundcmd.h
+++ b/engines/sci/sound/soundcmd.h
@@ -111,7 +111,9 @@ private:
SciMusic *_music;
AudioPlayer *_audio;
SciVersion _soundVersion;
- bool _bMultiMidi;
+ // If true and an alternative digital sound effect exists, the digital
+ // sound effect is preferred instead
+ bool _useDigitalSFX;
void processInitSound(reg_t obj);
void processDisposeSound(reg_t obj);