[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,1.22,1.23 imuse.h,1.4,1.5 saveload.cpp,1.13,1.14

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Tue Oct 1 14:26:32 CEST 2002


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

Modified Files:
	imuse.cpp imuse.h saveload.cpp 
Log Message:
added stopAll in Imuse

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- imuse.cpp	1 Oct 2002 17:20:04 -0000	1.22
+++ imuse.cpp	1 Oct 2002 21:19:52 -0000	1.23
@@ -4862,6 +4862,7 @@
 			if (_channel[l]._toBeRemoved == true) {
 				_channel[l]._used = false;
 				free(_channel[l]._data);
+				memset(&_channel[l], 0, sizeof(channel));
 				continue;
 			}
 
@@ -5043,8 +5044,19 @@
 
 void IMuseDigital::stopSound(int sound) {
 	debug(1, "IMuseDigital::stopSound(%d)", sound);
-	for (int32 l = 0; l < MAX_DIGITAL_CHANNELS;l ++) {
+	for (int32 l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
 		if ((_channel[l]._idSound == sound) && (_channel[l]._used == true)) {
+			if (_channel[l]._isLoop == false)
+				_channel[l]._toBeRemoved = true;
+			else
+				_channel[l]._isLoop = false;
+		}
+	}
+}
+
+void IMuseDigital::stopAll() {
+	for (int32 l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
+		if (_channel[l]._used == true) {
 			_channel[l]._toBeRemoved = true;
 		}
 	}

Index: imuse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- imuse.h	1 Oct 2002 17:20:05 -0000	1.4
+++ imuse.h	1 Oct 2002 21:19:52 -0000	1.5
@@ -110,6 +110,7 @@
 	void handler();
 	void startSound(int sound);
 	void stopSound(int sound);
+	void stopAll();
 	int32 doCommand(int a, int b, int c, int d, int e, int f, int g, int h);
 	int getSoundStatus(int sound);
 };

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- saveload.cpp	24 Sep 2002 15:46:09 -0000	1.13
+++ saveload.cpp	1 Oct 2002 21:19:52 -0000	1.14
@@ -111,6 +111,10 @@
 	_current_version = hdr.ver;
 	memcpy(_saveLoadName, hdr.name, sizeof(hdr.name));
 
+	if (_imuseDigital) {
+		_imuseDigital->stopAll();
+	}
+
 	_sound->pauseSounds(true);
 
 	CHECK_HEAP openRoom(-1);





More information about the Scummvm-git-logs mailing list