[Scummvm-cvs-logs] CVS: scummvm/scumm/smush scumm_renderer.cpp,1.20,1.21

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


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

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

Index: scumm_renderer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/scumm_renderer.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- scumm_renderer.cpp	23 Oct 2002 14:02:46 -0000	1.20
+++ scumm_renderer.cpp	27 Oct 2002 19:32:36 -0000	1.21
@@ -49,6 +49,7 @@
 	bool handleFrame();
 	bool stop();
 	bool update();
+	bool _silentMixer;
 };
 
 ScummMixer::ScummMixer(SoundMixer * m) : _mixer(m), _nextIndex(_mixer->_beginSlots) {
@@ -147,13 +148,15 @@
 					if(_channels[i].chan->getRate() == 11025) size *= 2;
 					size *= stereo ? 4 : 2;
 
-					// append to _sound
-					if(_channels[i].first) {
-						_channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_16BITS);
-						debug(5, "channel %d bound to mixer_index %d", _channels[i].id, _channels[i].mixer_index);
-						_channels[i].first = false;
-					} else {
-						_mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_16BITS);
+					if(_silentMixer == false) {
+						// append to _sound
+						if(_channels[i].first) {
+							_channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_16BITS);
+							debug(5, "channel %d bound to mixer_index %d", _channels[i].id, _channels[i].mixer_index);
+							_channels[i].first = false;
+						} else {
+							_mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_16BITS);
+						}
 					}
 
 					delete []data;
@@ -163,12 +166,14 @@
 					if(_channels[i].chan->getRate() == 11025) size *= 2;
 					size *= stereo ? 2 : 1;
 
-					// append to _sound
-					if(_channels[i].first) {
-						_channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
-						_channels[i].first = false;
-					} else {
-						_mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
+					if(_silentMixer == false) {
+						// append to _sound
+						if(_channels[i].first) {
+							_channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
+							_channels[i].first = false;
+						} else {
+							_mixer->append(_channels[i].mixer_index, data, size, rate, flags | SoundMixer::FLAG_UNSIGNED);
+						}
 					}
 
 					delete []data;
@@ -207,6 +212,7 @@
 	if(_smixer == 0) {
 		_smixer = new ScummMixer(_scumm->_mixer);
 		if(!_smixer) error("unable to allocate a smush mixer");
+		_smixer->_silentMixer = _scumm->_silentDigitalImuse;
 		s_renderer = this;
 		_scumm->_timer->installProcedure(&smush_handler, _insaneSpeed);
 	}





More information about the Scummvm-git-logs mailing list