[Scummvm-cvs-logs] CVS: scummvm/scumm/smush smush_mixer.cpp,1.24,1.25 smush_player.cpp,1.80,1.81

Max Horn fingolfin at users.sourceforge.net
Tue Dec 23 16:26:06 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm/smush
In directory sc8-pr-cvs1:/tmp/cvs-serv23172/scumm/smush

Modified Files:
	smush_mixer.cpp smush_player.cpp 
Log Message:
turned PlayingSoundHandle into an 'opaque' (well not really :-) data type, mainly because people kept (accidentally and sometimes on purpose :-) misusing them

Index: smush_mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_mixer.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- smush_mixer.cpp	22 Dec 2003 19:03:32 -0000	1.24
+++ smush_mixer.cpp	24 Dec 2003 00:24:57 -0000	1.25
@@ -39,7 +39,6 @@
 	for (int32 i = 0; i < NUM_CHANNELS; i++) {
 		_channels[i].id = -1;
 		_channels[i].chan = NULL;
-		_channels[i].handle = 0;
 	}
 }
 
@@ -70,19 +69,17 @@
 	}
 
 	for (i = 0; i < NUM_CHANNELS; i++) {
-		if ((_channels[i].chan == NULL || _channels[i].id == -1) && _channels[i].handle == 0) {
+		if ((_channels[i].chan == NULL || _channels[i].id == -1) && !_channels[i].handle.isActive()) {
 			_channels[i].chan = c;
 			_channels[i].id = track;
-			_channels[i].handle = 0;
 			return;
 		}
 	}
 
 	for (i = 0; i < NUM_CHANNELS; i++) {
-		warning("channel %d : %p(%d, %d) %d %d", i, (void *)_channels[i].chan, 
+		warning("channel %d : %p(%d, %d) %d", i, (void *)_channels[i].chan, 
 			_channels[i].chan ? _channels[i].chan->getTrackIdentifier() : -1, 
-			_channels[i].chan ? _channels[i].chan->isTerminated() : 1, 
-			_channels[i].handle);
+			_channels[i].chan ? _channels[i].chan->isTerminated() : 1);
 	}
 
 	error("SmushMixer::addChannel(%d): no channel available", track);
@@ -122,7 +119,7 @@
 				}
 
 				if (_silentMixer == false) {
-					if (_channels[i].handle == 0)
+					if (!_channels[i].handle.isActive())
 						_mixer->newStream(&_channels[i].handle, rate, flags, 500000);
 					_mixer->appendStream(_channels[i].handle, data, size);
 				}

Index: smush_player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/smush/smush_player.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- smush_player.cpp	22 Dec 2003 19:05:49 -0000	1.80
+++ smush_player.cpp	24 Dec 2003 00:24:57 -0000	1.81
@@ -229,7 +229,6 @@
 	_storeFrame = false;
 	_width = 0;
 	_height = 0;
-	_IACTchannel = 0;
 	_IACTpos = 0;
 	_soundFrequency = 22050;
 	_speed = speed;
@@ -461,7 +460,7 @@
 						}
 					} while (--count);
 
-					if (_IACTchannel == 0)
+					if (!_IACTchannel.isActive())
 						_scumm->_mixer->newStream(&_IACTchannel, 22050, SoundMixer::FLAG_STEREO | SoundMixer::FLAG_16BITS, 200000);
 					_scumm->_mixer->appendStream(_IACTchannel, output_data, 0x1000);
 





More information about the Scummvm-git-logs mailing list