[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_sound.cpp,1.13,1.14 d_sound.h,1.5,1.6 driver96.h,1.27,1.28 rdwin.cpp,1.17,1.18

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat Aug 30 11:07:02 CEST 2003


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

Modified Files:
	d_sound.cpp d_sound.h driver96.h rdwin.cpp 
Log Message:
added sfx support, increased speech support, and music code(streaming works fine but you don't hear anything) newStream, and appendStream doesn't work but playRaw works for music

Index: d_sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_sound.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- d_sound.cpp	28 Aug 2003 06:13:59 -0000	1.13
+++ d_sound.cpp	30 Aug 2003 18:06:08 -0000	1.14
@@ -25,170 +25,6 @@
 //
 //	Summary		:	This module holds the driver interface to direct sound.
 //
-//	Version	Date		By		Description
-//	------- ---------	---		-----------------------------------------------
-//	1.0		03-Dec-96	PRP		The sound buffer can be created, with the
-//								format defined by the game engine, and speech
-//								can be played.
-//
-//	1.1		05-Dec-96	PRP		Sound effects now done.
-//
[...2990 lines suppressed...]
-	memcpy(musStreaming, s->musStreaming,	sizeof(int16) * MAXMUS);
-	memcpy(musicPaused,	 s->musicPaused,	sizeof(int16) * MAXMUS);
-	memcpy(musCounter,	 s->musCounter,		sizeof(int16) * MAXMUS);
-	memcpy(musFading,	 s->musFading,		sizeof(int16) * MAXMUS);
-	memcpy(musLooping,	 s->musLooping,		sizeof(int16) * MAXMUS);
-	memcpy(musLastSample,s->musLastSample,	sizeof(int16) * MAXMUS);
-	memcpy(streamCursor, s->streamCursor,	sizeof(int32) * MAXMUS);
-	memcpy(musFilePos,	 s->musFilePos,		sizeof(int32) * MAXMUS);
-	memcpy(musEnd,		 s->musEnd,			sizeof(int32) * MAXMUS);
-	memcpy(musId,		 s->musId,			sizeof(uint32) * MAXMUS);
-	memcpy(volMusic,	 s->volMusic,		sizeof(uint32) * 2);
-//	memcpy(dsbdMus,		 s->dsbdMus,		sizeof(DSBUFFERDESC) * MAXMUS);
-//	memcpy(lpDsbMus,	 s->lpDsbMus,		sizeof(LPDIRECTSOUNDBUFFER) * MAXMUS);
-//	memcpy(fpMus,		 s->fpMus,			sizeof(FILE*) * MAXMUS);
-//	memcpy(wfMus,		 s->wfMus,			sizeof(PCMWAVEFORMAT) * MAXMUS);
-
-	for (i = 0; i<MAXMUS; i++)
-		memcpy(musFilename[i], s->musFilename[i], sizeof(char) * 256);
-}
-

Index: d_sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_sound.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- d_sound.h	2 Aug 2003 02:31:36 -0000	1.5
+++ d_sound.h	30 Aug 2003 18:06:08 -0000	1.6
@@ -41,6 +41,8 @@
 #include "sound/mixer.h"
 #include "common/file.h"
 
+void sword2_sound_handler (void *engine);
+
 class Sword2Sound {
 	public:
 		Sword2Sound(SoundMixer *mixer);
@@ -65,7 +67,7 @@
 		int32 PauseMusic(void);
 		int32 UnpauseMusic(void);
 		int32 StreamMusic(uint8 *filename, int32 looping);
-		int32 StreamCompMusic(const char *filename, const char *directory, uint32 musicId, int32 looping);
+		int32 StreamCompMusic(const char *filename, uint32 musicId, int32 looping);
 		int32 MusicTimeRemaining();
 		int32 ReverseStereo(void);
 		uint8 GetFxVolume(void);
@@ -75,8 +77,6 @@
 		uint8 IsFxMute(void);
 		uint8 IsSpeechMute(void);
 		void  StopMusic(void);
-		void  GetSoundStatus(_drvSoundStatus *s);
-		void  SetSoundStatus(_drvSoundStatus *s);
 		void  SetFxVolume(uint8 vol);
 		void  SetSpeechVolume(uint8 vol);
 		void  SetMusicVolume(uint8 vol);
@@ -92,14 +92,16 @@
 		int32 GetFxIndex(int32 id);
 		void StartMusicFadeDown(int i);
 		int32 DipMusic();
-		void UpdateSampleStreaming(void);
 
 		int32 fxId[MAXFX];
 		uint8 fxCached[MAXFX];
 		uint8 fxiPaused[MAXFX];
 		uint8 fxLooped[MAXFX];
 		uint8 fxVolume[MAXFX];
-		
+		uint32 flagsFx[MAXFX];
+		uint16 *bufferFx[MAXFX];
+		int32 bufferSizeFx[MAXFX];
+
 		uint8 soundOn;
 		uint8 speechStatus;
 		uint8 fxPaused;
@@ -116,14 +118,13 @@
 		int16 musFading[MAXMUS];
 		int16 musLooping[MAXMUS];
 
-		//DSBUFFERDESC dsbdMus[MAXMUS];
-		//LPDIRECTSOUNDBUFFER lpDsbMus[MAXMUS];
-		PlayingSoundHandle musicHandle[MAXMUS];
+		PlayingSoundHandle soundHandleFx[MAXFX];
+		PlayingSoundHandle soundHandleMusic[MAXMUS];
+		PlayingSoundHandle soundHandleSpeech;
+		File				fpMus;
+		int bufferSizeMusic;
+		int musicIndexChannel[MAXMUS];
 		int musicChannels[MAXMUS];
-		uint16 *lpDsbMus[MAXMUS];
-		File fpMus[MAXMUS];
-		//FILE *fpMus[MAXMUS];
-		//PCMWAVEFORMAT wfMus[MAXMUS];
 		int32 streamCursor[MAXMUS];
 		char musFilename[MAXMUS][256];
 		int32 musFilePos[MAXMUS];
@@ -132,7 +133,6 @@
 		uint32 musId[MAXMUS];
 		uint32 volMusic[2];
 		uint8 musicMuted;
-		
 };
 
 

Index: driver96.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/driver96.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- driver96.h	28 Aug 2003 06:36:15 -0000	1.27
+++ driver96.h	30 Aug 2003 18:06:08 -0000	1.28
@@ -1365,50 +1365,6 @@
 //	DDCOLORKEY			blackColorKey;
 } _drvDrawStatus;
 
-
-
-//  This is the structure which is used to set and
-//  retrieve the direct sound drivers global variables.
-
-typedef struct
-{	
-//	HWND				hwnd;
-//	LPDIRECTSOUND		lpDS;
-//	LPDIRECTSOUNDBUFFER	dsbPrimary;
-//	LPDIRECTSOUNDBUFFER	dsbSpeech;
-//	LPDIRECTSOUNDBUFFER	dsbFx[MAXFX];
-	int32				fxId[MAXFX];
-	uint8				fxCached[MAXFX];
-	uint8				soundOn;
-	uint8				speechStatus;
-	uint8				fxPaused;
-	char				musFilename[MAXMUS][256];
-	uint8				speechPaused;
-	uint8				speechVol;
-	uint8				fxVol;
-	uint8               speechMuted;
-	uint8               fxMuted;
-	uint8				musicMuted;
-	uint8				compressedMusic;
-	uint8				fxiPaused[MAXFX];
-	uint8				fxLooped[MAXFX];
-	int16 				musStreaming[MAXMUS];
-	int16				musicPaused[MAXMUS];
-	int16 				musCounter[MAXMUS];
-	int16				musFading[MAXMUS];
-	int16				musLooping[MAXMUS];
-	int16				musLastSample[MAXMUS];
-	int32				streamCursor[MAXMUS];
-	int32				musFilePos[MAXMUS];
-	int32				musEnd[MAXMUS];
-	uint32				musId[MAXMUS];
-//	DSBUFFERDESC 		dsbdMus[MAXMUS];
-//	LPDIRECTSOUNDBUFFER lpDsbMus[MAXMUS];
-	FILE				*fpMus[MAXMUS];
-//	PCMWAVEFORMAT       wfMus[MAXMUS];
-	uint32				volMusic[2];
-} _drvSoundStatus;
-
 //  This is the structure which is used to retrieve
 //  the keyboard driver bits.
 

Index: rdwin.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/rdwin.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- rdwin.cpp	29 Aug 2003 06:42:34 -0000	1.17
+++ rdwin.cpp	30 Aug 2003 18:06:08 -0000	1.18
@@ -19,12 +19,9 @@
 
 #define WIN32_LEAN_AND_MEAN
 
-//#include <windows.h>
-//#include <windowsx.h>
-#include <stdio.h>
-
 #include "common/stdafx.h"
 #include "common/engine.h"
+#include "common/timer.h"
 
 #include "driver96.h"
 
@@ -532,6 +529,7 @@
 	DestroyWindow(hwnd);
 */
 	// just quit for now
+	g_engine->_timer->releaseProcedure(sword2_sound_handler);
 	g_system->quit();
 	return(RD_OK);
 





More information about the Scummvm-git-logs mailing list