[Scummvm-cvs-logs] CVS: scummvm/scumm imuse_digi.cpp,1.67,1.68 player_mod.cpp,2.11,2.12 player_mod.h,2.9,2.10 sound.cpp,1.289,1.290 string.cpp,1.171,1.172

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


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

Modified Files:
	imuse_digi.cpp player_mod.cpp player_mod.h sound.cpp 
	string.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: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- imuse_digi.cpp	23 Dec 2003 00:10:08 -0000	1.67
+++ imuse_digi.cpp	24 Dec 2003 00:24:57 -0000	1.68
@@ -805,7 +805,7 @@
 			_channel[l].offset += mixer_size;
 
 			if (_scumm->_silentDigitalImuse == false) {
-				if (_channel[l].handle == 0)
+				if (!_channel[l].handle.isActive())
 					_scumm->_mixer->newStream(&_channel[l].handle, _channel[l].freq, 
 											_channel[l].mixerFlags, 100000);
 				_scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000);
@@ -821,7 +821,7 @@
 	int l, r;
 
 	for (l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
-		if (!_channel[l].used && !_channel[l].handle) {
+		if (!_channel[l].used && !_channel[l].handle.isActive()) {
 			byte *ptr = _scumm->getResourceAddress(rtSound, sound);
 			byte *s_ptr = ptr;
 			if (ptr == NULL) {
@@ -1290,7 +1290,6 @@
 		_bundleSongPosInMs = 0;
 		_pauseBundleMusic = false;
 		_musicBundleToBeChanged = false;
-		_bundleMusicTrack = 0;
 		_numberSamplesBundleMusic = _bundle->getNumberOfMusicSamplesByName(song);
 		_nameBundleMusic = song;
 		_scumm->_timer->installTimerProc(&music_handler, 1000000, this);
@@ -1423,7 +1422,7 @@
 
 	_bundleSongPosInMs = (_bundleMusicPosition * 5) / (_outputMixerSize / 200);
 	_bundleMusicPosition += final_size;
-	if (_bundleMusicTrack == 0)
+	if (!_bundleMusicTrack.isActive())
 		_scumm->_mixer->newStream(&_bundleMusicTrack, rate, SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, 300000);
 	_scumm->_mixer->appendStream(_bundleMusicTrack, buffer, final_size);
 	free(buffer);

Index: player_mod.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_mod.cpp,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -d -r2.11 -r2.12
--- player_mod.cpp	17 Dec 2003 06:24:18 -0000	2.11
+++ player_mod.cpp	24 Dec 2003 00:24:57 -0000	2.12
@@ -22,6 +22,9 @@
 
 #include "stdafx.h"
 #include "scumm/player_mod.h"
+#include "sound/audiostream.h"
+#include "sound/mixer.h"
+#include "sound/rate.h"
 
 namespace Scumm {
 

Index: player_mod.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_mod.h,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -d -r2.9 -r2.10
--- player_mod.h	8 Nov 2003 21:59:32 -0000	2.9
+++ player_mod.h	24 Dec 2003 00:24:57 -0000	2.10
@@ -24,9 +24,9 @@
 #define PLAYER_MOD_H
 
 #include "scumm/scumm.h"
-#include "sound/mixer.h"
-#include "sound/audiostream.h"
-#include "sound/rate.h"
+
+class AudioInputStream;
+class RateConverter;
 
 namespace Scumm {
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.289
retrieving revision 1.290
diff -u -d -r1.289 -r1.290
--- sound.cpp	23 Dec 2003 19:18:20 -0000	1.289
+++ sound.cpp	24 Dec 2003 00:24:57 -0000	1.290
@@ -56,7 +56,6 @@
 	memset(this,0,sizeof(Sound));	// palmos
 	
 	_scumm = parent;
-	_talkChannelHandle = 0;
 	_currentCDSound = 0;
 
 	_sfxFile = 0;
@@ -427,7 +426,7 @@
 	if ((_sfxMode & 2) && _scumm->VAR(_scumm->VAR_TALK_ACTOR)) {
 		act = _scumm->VAR(_scumm->VAR_TALK_ACTOR);
 
-		finished = !_talkChannelHandle;
+		finished = !_talkChannelHandle.isActive();
 
 		if (act != 0 && (uint) act < 0x80 && !_scumm->_string[0].no_talk_anim) {
 			a = _scumm->derefActor(act, "processSfxQueues");

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- string.cpp	22 Dec 2003 08:22:03 -0000	1.171
+++ string.cpp	24 Dec 2003 00:24:57 -0000	1.172
@@ -163,7 +163,7 @@
 	if (_talkDelay)
 		return;
 
-	if ((_gameId == GID_CMI || _gameId == GID_DIG) && _sound->_talkChannelHandle) {
+	if ((_gameId == GID_CMI || _gameId == GID_DIG) && _sound->_talkChannelHandle.isActive()) {
 		// Keep the 'speech' flag in _sound->_sfxMode set as long as the
 		// _talkChannelHandle is valid.
 		_sound->_sfxMode |= 2;
@@ -317,7 +317,7 @@
 			} else {
 				if ((_gameId == GID_LOOM256) && _noSubtitles && (_sound->pollCD())) {
 					// Special case for loomcd, since it only uses CD audio.for sound
-				} else if (_noSubtitles && (_haveMsg == 0xFE || _sound->_talkChannelHandle)) {
+				} else if (_noSubtitles && (_haveMsg == 0xFE || _sound->_talkChannelHandle.isActive())) {
 					// Subtitles are turned off, and there is a voice version
 					// of this message -> don't print it. 
 				} else





More information about the Scummvm-git-logs mailing list