[Scummvm-cvs-logs] CVS: scummvm scumm.h,1.193,1.194 sound.cpp,1.119,1.120

Max Horn fingolfin at users.sourceforge.net
Sat Aug 3 04:58:02 CEST 2002


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

Modified Files:
	scumm.h sound.cpp 
Log Message:
hopefully fixed #589746 (Clicking sounds)

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- scumm.h	28 Jul 2002 15:35:25 -0000	1.193
+++ scumm.h	3 Aug 2002 11:57:10 -0000	1.194
@@ -29,7 +29,7 @@
 #include "bundle.h"
 
 #define SCUMMVM_VERSION "0.2.2 CVS"
-#define SCUMMVM_CVS "2002-07-16"
+#define SCUMMVM_CVS "2002-08-03"
 
 #define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0)
 #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
@@ -771,7 +771,7 @@
 	bool isSfxFinished();
 	void playBundleSound(char *sound);
 	void decompressBundleSound(int index);
-	int playSfxSound(void *sound, uint32 size, uint rate);
+	int playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned = false);
  	int playSfxSound_MP3(void *sound, uint32 size);
 	void stopSfxSound();
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- sound.cpp	29 Jul 2002 15:08:45 -0000	1.119
+++ sound.cpp	3 Aug 2002 11:57:10 -0000	1.120
@@ -678,16 +678,8 @@
 		error("startSfxSound: cannot read %d bytes", size);
 		return -1;
 	}
-	// FIXME - why is this code here? playSfxSound Already should do the conversion
-	for (i = 0; i < size; i++) {
-		// Fixme: From WinCE port
-		if (_sound_volume_sfx != 256)
-			data[i] = _sound_volume_sfx * data[i] / 256;
 
-		data[i] ^= 0x80;
-	}
-
-	return playSfxSound(data, size, 1000000 / (256 - rate));
+	return playSfxSound(data, size, 1000000 / (256 - rate), true);
 }
 
 
@@ -837,11 +829,14 @@
 	_mixer->play_raw(NULL, final, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
 }
 
-int Scumm::playSfxSound(void *sound, uint32 size, uint rate)
+int Scumm::playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned)
 {
 	if (_soundsPaused)
 		return -1;
-	return _mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE);
+	byte flags = SoundMixer::FLAG_AUTOFREE;
+	if (isUnsigned)
+		flags |= SoundMixer::FLAG_UNSIGNED;
+	return _mixer->play_raw(NULL, sound, size, rate, flags);
 }
 
 int Scumm::playSfxSound_MP3(void *sound, uint32 size)





More information about the Scummvm-git-logs mailing list