[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,1.70,1.71 scumm.h,1.49,1.50 scummvm.cpp,1.64,1.65 sound.cpp,1.44,1.45

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Sun Oct 27 11:33:02 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv12225/scumm

Modified Files:
	imuse.cpp scumm.h scummvm.cpp sound.cpp 
Log Message:
don't put samples into stream SoundMixer if sound card is disabled

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- imuse.cpp	23 Oct 2002 06:48:10 -0000	1.70
+++ imuse.cpp	27 Oct 2002 19:32:35 -0000	1.71
@@ -5437,12 +5437,14 @@
 				}
 			}
 
-			if (_channel[l]._initialized == false) {
-				_scumm->_mixer->playStream(NULL, l, buf, mixer_size,
-				                           _channel[l]._freq, _channel[l]._mixerFlags, 3, 2000000);
-				_channel[l]._initialized = true;
-			} else {
-				_scumm->_mixer->append(l, buf, mixer_size, _channel[l]._freq, _channel[l]._mixerFlags);
+			if (_scumm->_silentDigitalImuse == false) {
+				if (_channel[l]._initialized == false) {
+					_scumm->_mixer->playStream(NULL, l, buf, mixer_size,
+					                           _channel[l]._freq, _channel[l]._mixerFlags, 3, 2000000);
+					_channel[l]._initialized = true;
+				} else {
+					_scumm->_mixer->append(l, buf, mixer_size, _channel[l]._freq, _channel[l]._mixerFlags);
+				}
 			}
 		}
 	}

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- scumm.h	24 Oct 2002 09:40:20 -0000	1.49
+++ scumm.h	27 Oct 2002 19:32:35 -0000	1.50
@@ -884,6 +884,7 @@
 	uint16 _defaultTalkDelay;
 	bool _use_adlib;
 	int tempMusic;
+	bool _silentDigitalImuse;
 	int _saveSound;
 	uint16 _soundParam, _soundParam2, _soundParam3;
 	int current_cd_sound, _cd_loops, _cd_frame, _cd_track, _cd_end;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- scummvm.cpp	27 Oct 2002 10:31:07 -0000	1.64
+++ scummvm.cpp	27 Oct 2002 19:32:36 -0000	1.65
@@ -118,6 +118,7 @@
 
 	/* Bind the mixer to the system => mixer will be invoked
 	 * automatically when samples need to be generated */	
+	_silentDigitalImuse = false;
 	if (!_mixer->bindToSystem(syst)) {         
 		warning("Sound initialization failed");
 		if (detector->_use_adlib) {
@@ -126,6 +127,7 @@
 			detector->_midi_driver = MD_NULL;   
 			warning("Adlib music was selected, switching to midi null driver");   
 		}   
+		_silentDigitalImuse = true;
 	} 
 	_mixer->setVolume(kDefaultSFXVolume);
 	_mixer->setMusicVolume(kDefaultMusicVolume);

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- sound.cpp	27 Oct 2002 11:41:07 -0000	1.44
+++ sound.cpp	27 Oct 2002 19:32:36 -0000	1.45
@@ -925,6 +925,10 @@
 #define OUTPUT_SIZE 66150 // ((22050 * 2 * 2) / 4) * 3
 
 void Sound::playBundleMusic(char * song) {
+	if (_scumm->_silentDigitalImuse == true) {
+		return;
+	}
+
 	if (_nameBundleMusic == NULL) {
 		if (_scumm->_bundle->openMusicFile("digmusic.bun", _scumm->getGameDataPath()) == false) {
 			return;





More information about the Scummvm-git-logs mailing list