[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_sound.cpp,1.31,1.32 d_sound.h,1.7,1.8 driver96.h,1.28,1.29

Pawel Kolodziejski aquadran at users.sourceforge.net
Tue Sep 2 20:58:12 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv15328

Modified Files:
	d_sound.cpp d_sound.h driver96.h 
Log Message:
fixed interval of fxServer func (why i saw before 1000 miliseconds?), moved init sound data to class sound

Index: d_sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_sound.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- d_sound.cpp	2 Sep 2003 16:20:10 -0000	1.31
+++ d_sound.cpp	3 Sep 2003 03:57:23 -0000	1.32
@@ -30,17 +30,6 @@
 //
 //	--------------------------------------------------------------------------
 //
-//	int32 InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth)
-//
-//	This function initialises DirectSound by specifying the parameters of the
-//	primary buffer.
-//
-//	Freq is the sample rate - 44100, 22050 or 11025
-//	Channels should be 1 for mono, 2 for stereo
-//	BitDepth should be either 8 or 16 bits per sample.	
-//
-//	--------------------------------------------------------------------------
-//
 //	int32 PlayCompSpeech(const char *filename, uint32 id, uint8 vol, int8 pan)
 //
 //	This function loads, decompresses and plays the wav 'id' from the cluster
@@ -234,17 +223,33 @@
 	volMusic[0] = 16;
 	volMusic[1] = 16;
 	musicMuted = 0;
-	bufferSizeMusic = 44100;
+	bufferSizeMusic = 4410;
 	_mixer = mixer;
+	
+	memset(fxId,		0, sizeof(fxId));
+	memset(fxCached,	0, sizeof(fxCached));
+	memset(fxiPaused,	0, sizeof(fxiPaused));
+	memset(fxLooped, 	0, sizeof(fxLooped));
+	memset(fxRate,		0, sizeof(fxRate));
 
-	// Don't care if this fails, because it should still work without
-	// sound cards but it should set a global system flag so that we can
-	// avoid loading sound fx & streaming music because they won't be
-	// heard anyway
-
-	InitialiseSound(22050, 2, 16);
+ 	memset(musStreaming,	0, sizeof(musStreaming));
+	memset(musicPaused,	0, sizeof(musicPaused));
+	memset(musCounter, 	0, sizeof(musCounter));
+	memset(musFading, 	0, sizeof(musFading));
+	memset(musLooping,	0, sizeof(musLooping));
+	memset(musFilePos,	0, sizeof(musFilePos));
+	memset(musEnd,		0, sizeof(musEnd));
+	memset(musLastSample,	0, sizeof(musLastSample));
+	memset(musId,		0, sizeof(musId));
+	memset(soundHandleMusic, 0, sizeof(soundHandleMusic));
+	memset(soundHandleFx, 0, sizeof(soundHandleFx));
+	soundHandleSpeech = 0;
+	memset(bufferFx, 0, sizeof(bufferFx));
+	memset(flagsFx, 0, sizeof(flagsFx));
+	memset(bufferSizeFx, 0, sizeof(bufferSizeFx));
 
-	g_engine->_timer->installProcedure(sword2_sound_handler, 1000000);
+	soundOn = 1;
+	g_engine->_timer->installProcedure(sword2_sound_handler, 100000);
 }
 
 // --------------------------------------------------------------------------
@@ -341,35 +346,6 @@
 	}
 }
 
-int32 Sword2Sound::InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth) {
-	soundOn = 1;
-	
-	memset(fxId,		0, sizeof(fxId));
-	memset(fxCached,	0, sizeof(fxCached));
-	memset(fxiPaused,	0, sizeof(fxiPaused));
-	memset(fxLooped, 	0, sizeof(fxLooped));
-	memset(fxRate,		0, sizeof(fxRate));
-
- 	memset(musStreaming,	0, sizeof(musStreaming));
-	memset(musicPaused,	0, sizeof(musicPaused));
-	memset(musCounter, 	0, sizeof(musCounter));
-	memset(musFading, 	0, sizeof(musFading));
-
-	memset(musLooping,	0, sizeof(musLooping));
-
-	memset(musFilePos,	0, sizeof(musFilePos));
-	memset(musEnd,		0, sizeof(musEnd));
-	memset(musLastSample,	0, sizeof(musLastSample));
-	memset(musId,		0, sizeof(musId));
-	memset(soundHandleMusic, 0, sizeof(soundHandleMusic));
-	memset(soundHandleFx, 0, sizeof(soundHandleFx));
-	soundHandleSpeech = 0;
-	memset(bufferFx, 0, sizeof(bufferFx));
-	memset(flagsFx, 0, sizeof(flagsFx));
-	memset(bufferSizeFx, 0, sizeof(bufferSizeFx));
-
-	return(RD_OK);
-}
 
 int32 Sword2Sound::AmISpeaking() {
 	if ((!speechMuted) && (!speechPaused) && (soundHandleSpeech != 0)) {

Index: d_sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_sound.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- d_sound.h	31 Aug 2003 10:45:14 -0000	1.7
+++ d_sound.h	3 Sep 2003 03:57:23 -0000	1.8
@@ -47,7 +47,6 @@
 	public:
 		Sword2Sound(SoundMixer *mixer);
 		void FxServer(void);
-		int32 InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth);
 		int32 PlaySpeech(uint8 *data, uint8 vol, int8 pan);
 		int32 PlayCompSpeech(const char *filename, uint32 speechid, uint8 vol, int8 pan);
 		int32 PreFetchCompSpeech(const char *filename, uint32 speechid, uint8 *waveMem);

Index: driver96.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/driver96.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- driver96.h	30 Aug 2003 18:06:08 -0000	1.28
+++ driver96.h	3 Sep 2003 03:57:23 -0000	1.29
@@ -768,26 +768,6 @@
 //	--------------------------- d_sound.c ------------------------------------
 //	--------------------------------------------------------------------------
 //
-//	int32 InitialiseSound(uint16 freq, uint16 channels, uint16 bitDepth)
-//
-//	This function initialises DirectSound by specifying the parameters of the
-//	primary buffer.
-//
-//	Freq is the sample rate - 44100, 22050 or 11025
-//	Channels should be 1 for mono, 2 for stereo
-//	BitDepth should be either 8 or 16 bits per sample.	
-//
-//	--------------------------------------------------------------------------
-//
-//	int32 PlaySpeech(uint8 *data, uint8 vol, int8 pan)
-//
-//	This function plays the wav file passed into it as speech.  An error occurs
-//	if speech is already playing, or directSound comes accross problems.
-//	volume can be from 0 to 16.
-//	pan can be from -16 (full left) to 16 (full right).
-//
-//	--------------------------------------------------------------------------
-//
 //	int32 PreFetchCompSpeech(const char *filename, uint32 speechid, uint8 *wave)
 //
 //	This function loads and decompresses speech sample 'speechid' from the





More information about the Scummvm-git-logs mailing list