[Scummvm-cvs-logs] scummvm master -> 3752396aefc43beba2df6a47221407d805cb3a7b

bluegr md5 at scummvm.org
Wed Dec 28 12:25:24 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8496b5c4d8 SCI: Rename _bMultiMidi to _useDigitalSFX and only initialize it inside SoundCommandParser
3752396aef SCI: Always prefer digital sound effects to prevent confusion to users


Commit: 8496b5c4d8134c86735edd90e598d7d94a37bf32
    https://github.com/scummvm/scummvm/commit/8496b5c4d8134c86735edd90e598d7d94a37bf32
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-28T03:14:55-08:00

Commit Message:
SCI: Rename _bMultiMidi to _useDigitalSFX and only initialize it inside SoundCommandParser

Changed paths:
    engines/sci/sound/music.cpp
    engines/sci/sound/music.h
    engines/sci/sound/soundcmd.cpp
    engines/sci/sound/soundcmd.h



diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 4ffa8d7..09cab75 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 fa6f538..1f798c9 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 274c532..4b05a7f 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 c1dce01..d76f969 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);


Commit: 3752396aefc43beba2df6a47221407d805cb3a7b
    https://github.com/scummvm/scummvm/commit/3752396aefc43beba2df6a47221407d805cb3a7b
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-28T03:21:19-08:00

Commit Message:
SCI: Always prefer digital sound effects to prevent confusion to users

This toggle will be enabled again when a more user-friendly GUI option
is possible

Changed paths:
    NEWS
    engines/sci/sound/soundcmd.cpp



diff --git a/NEWS b/NEWS
index ab2c28d..a2ecbaa 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,9 @@ For a more comprehensive changelog of the latest experimental code, see:
  SCI:
    - Fixed race condition in SCI1.1 palette changes. This fixes an error in
      QFG1VGA, when sleeping at Erana's place.
+   - The option to toggle sound effect types between digitized and synthesized
+     has been disabled until a more user-friendly GUI option is possible.
+     Digital sound effects are always preferred for now.
 
 1.4.0 (2011-11-11)
  New Games:
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 4b05a7f..3306a76 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -32,9 +32,12 @@
 
 namespace Sci {
 
+//#define ENABLE_SFX_TYPE_SELECTION
+
 SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, AudioPlayer *audio, SciVersion soundVersion) :
 	_resMan(resMan), _segMan(segMan), _kernel(kernel), _audio(audio), _soundVersion(soundVersion) {
 
+#ifdef ENABLE_SFX_TYPE_SELECTION
 	// Check if the user wants synthesized or digital sound effects in SCI1.1
 	// or later games
 	_useDigitalSFX = ConfMan.getBool("multi_midi");
@@ -45,6 +48,10 @@ SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segM
 	// resource number, but it's totally unrelated to the menu music).
 	if (getSciVersion() >= SCI_VERSION_2)
 		_useDigitalSFX = true;
+#else
+	// Always prefer digital sound effects
+	_useDigitalSFX = true;
+#endif
 
 	_music = new SciMusic(_soundVersion, _useDigitalSFX);
 	_music->init();






More information about the Scummvm-git-logs mailing list