[Scummvm-cvs-logs] CVS: scummvm/scumm string.cpp,1.90,1.91 sound.cpp,1.98,1.99 imuse.cpp,2.15,2.16 imuse.h,1.26,1.27

Max Horn fingolfin at users.sourceforge.net
Sun Mar 23 05:15:23 CET 2003


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

Modified Files:
	string.cpp sound.cpp imuse.cpp imuse.h 
Log Message:
cleanup

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- string.cpp	12 Mar 2003 19:53:02 -0000	1.90
+++ string.cpp	23 Mar 2003 13:14:54 -0000	1.91
@@ -163,7 +163,7 @@
 		// This hack will force the backup cutoff system to be used instead,
 		// unless the talkChannel is null (eg, this string has no sound attached)
 		if ((_gameId == GID_CMI || _gameId == GID_DIG) && (_sound->_talkChannel > 0))
-				return;
+			return;
 
 		if (_sound->_sfxMode == 0)
 			stopTalk();

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- sound.cpp	18 Mar 2003 22:07:49 -0000	1.98
+++ sound.cpp	23 Mar 2003 13:14:54 -0000	1.99
@@ -454,7 +454,6 @@
 
 int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
 	int num = 0, i;
-	byte file_byte, file_byte_2;
 	int size;
 	byte *sound;
 
@@ -520,15 +519,11 @@
 	}
 
 	_sfxFile->seek(offset, SEEK_SET);
-	i = 0;
-	while (num > 0) {
-		_sfxFile->read(&file_byte, sizeof(file_byte));
-		_sfxFile->read(&file_byte_2, sizeof(file_byte_2));
-		assert(i < (int)ARRAYSIZE(_mouthSyncTimes));
-		_mouthSyncTimes[i++] = file_byte | (file_byte_2 << 8);
-		num--;
-	}
-	assert(i < (int)ARRAYSIZE(_mouthSyncTimes));
+
+	assert(num+1 < (int)ARRAYSIZE(_mouthSyncTimes));
+	for (i = 0; i < num; i++)
+		_mouthSyncTimes[i] = _sfxFile->readUint16BE();
+
 	_mouthSyncTimes[i] = 0xFFFF;
 	_sfxMode |= mode;
 	_curSoundPos = 0;
@@ -552,7 +547,7 @@
 
 	_endOfMouthSync = false;
 	do {
-		val ^= 1;
+		val = !val;
 		j = *ms++;
 		if (j == 0xFFFF) {
 			_endOfMouthSync = true;
@@ -587,13 +582,13 @@
 		return _scumm->_imuseDigital->getSoundStatus(sound);
 
 	if (_scumm->_imuse)
-		return _scumm->_imuse->get_sound_status(sound);
+		return _scumm->_imuse->getSoundStatus(sound);
 
 	return 0;
 }
 
 // This is exactly the same as isSoundRunning except that it
-// calls IMuse::get_sound_active() instead of IMuse::get_sound_status().
+// calls IMuse::get_sound_active() instead of IMuse::getSoundStatus().
 // This is necessary when determining what resources to
 // expire from memory.
 bool Sound::isSoundActive(int sound) {

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 2.15
retrieving revision 2.16
diff -u -d -r2.15 -r2.16
--- imuse.cpp	18 Mar 2003 16:13:46 -0000	2.15
+++ imuse.cpp	23 Mar 2003 13:14:54 -0000	2.16
@@ -458,7 +458,7 @@
 	bool startSound(int sound);
 	int stopSound(int sound);
 	int stop_all_sounds();
-	int get_sound_status(int sound);
+	int getSoundStatus(int sound);
 	bool get_sound_active(int sound);
 	int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h);
 	int clear_queue();
@@ -720,6 +720,7 @@
 		return false;
 
 	player->clear();
+
 	return player->startSound(sound);
 }
 
@@ -1011,7 +1012,7 @@
 	return newvol;
 }
 
-int IMuseInternal::get_sound_status(int sound) {
+int IMuseInternal::getSoundStatus(int sound) {
 	int i;
 	Player *player;
 	for (i = ARRAYSIZE(_players), player = _players; i != 0; i--, player++) {
@@ -1028,7 +1029,7 @@
 	return get_queue_sound_status(sound);
 }
 
-// This is exactly the same as get_sound_status except that
+// This is exactly the same as getSoundStatus except that
 // it treats sounds that are fading out just the same as
 // other sounds. This is the method to use when determining
 // what resources to expire from memory.
@@ -1286,7 +1287,7 @@
 			}
 			return -1;
 		case 13:
-			return get_sound_status(b);
+			return getSoundStatus(b);
 		case 14:
 			// Sam and Max: Volume Fader?
 			// Prevent instantaneous volume fades.
@@ -1490,7 +1491,7 @@
 
 	// If the command is to start a sound, stop that sound if it's already playing.
 	// This fixes some carnival music problems.
-	if (trig->command [0] == 8 && get_sound_status (trig->command [1]))
+	if (trig->command [0] == 8 && getSoundStatus (trig->command [1]))
 		stopSound (trig->command [1]);
 	return 0;
 }
@@ -3554,7 +3555,7 @@
 bool IMuse::startSound(int sound) { in(); bool ret = _target->startSound (sound); out(); return ret; }
 int IMuse::stopSound(int sound) { in(); int ret = _target->stopSound (sound); out(); return ret; }
 int IMuse::stop_all_sounds() { in(); int ret = _target->stop_all_sounds(); out(); return ret; }
-int IMuse::get_sound_status(int sound) { in(); int ret = _target->get_sound_status (sound); out(); return ret; }
+int IMuse::getSoundStatus(int sound) { in(); int ret = _target->getSoundStatus (sound); out(); return ret; }
 bool IMuse::get_sound_active(int sound) { in(); bool ret = _target->get_sound_active (sound); out(); return ret; }
 int32 IMuse::doCommand(int a, int b, int c, int d, int e, int f, int g, int h) { in(); int32 ret = _target->doCommand (a,b,c,d,e,f,g,h); out(); return ret; }
 int IMuse::clear_queue() { in(); int ret = _target->clear_queue(); out(); return ret; }

Index: imuse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- imuse.h	18 Mar 2003 16:13:50 -0000	1.26
+++ imuse.h	23 Mar 2003 13:14:54 -0000	1.27
@@ -57,7 +57,7 @@
 	bool startSound(int sound);
 	int stopSound(int sound);
 	int stop_all_sounds();
-	int get_sound_status(int sound);
+	int getSoundStatus(int sound);
 	bool get_sound_active(int sound);
 	int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h);
 	int clear_queue();





More information about the Scummvm-git-logs mailing list