[Scummvm-cvs-logs] CVS: scummvm/bs2 anims.cpp,1.5,1.6 controls.cpp,1.4,1.5 function.cpp,1.3,1.4 mouse.cpp,1.5,1.6 sound.cpp,1.5,1.6 speech.cpp,1.8,1.9 startup.cpp,1.5,1.6 sword2.cpp,1.6,1.7 sword2.h,1.2,1.3

Jonathan Gray khalek at users.sourceforge.net
Tue Jul 29 05:35:15 CEST 2003


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

Modified Files:
	anims.cpp controls.cpp function.cpp mouse.cpp sound.cpp 
	speech.cpp startup.cpp sword2.cpp sword2.h 
Log Message:
turn d_sound.cpp into class BS2Sound

Index: anims.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/anims.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- anims.cpp	28 Jul 2003 11:21:25 -0000	1.5
+++ anims.cpp	29 Jul 2003 12:34:45 -0000	1.6
@@ -601,7 +601,7 @@
 			}
 			//------------------------------
 
-			wavSize = GetCompSpeechSize(speechFile, wavId);		// returns size of decompressed wav, or 0 if wav not found
+			wavSize = g_bs2->_sound->GetCompSpeechSize(speechFile, wavId);		// returns size of decompressed wav, or 0 if wav not found
 			if (wavSize)	// if we've got the wav
 			{
 				// allocate memory for speech buffer
@@ -609,7 +609,7 @@
 
 				if (sequence_text_list[line].speech_mem)	// if mem allocated ok (should be fine, but worth checking)
 				{
-					if (PreFetchCompSpeech(speechFile, wavId, sequence_text_list[line].speech_mem->ad) == RD_OK)	// Load speech & decompress to our buffer
+					if (g_bs2->_sound->PreFetchCompSpeech(speechFile, wavId, sequence_text_list[line].speech_mem->ad) == RD_OK)	// Load speech & decompress to our buffer
 					{
 						Float_mem (sequence_text_list[line].speech_mem);	// now float this buffer so we can make space for the next text sprites and/or speech samples
 						speechRunning=1;	// ok, we've got speech!
@@ -722,7 +722,7 @@
 	//-----------------------------------------
 
 	leadIn += sizeof(_standardHeader);
-	rv = PlayFx( 0, leadIn, 0, 0, RDSE_FXLEADIN );		// wav data gets copied to sound memory
+	rv = g_bs2->_sound->PlayFx( 0, leadIn, 0, 0, RDSE_FXLEADIN );		// wav data gets copied to sound memory
 
 	//-----------------------------------------
 	#ifdef _BS2_DEBUG
@@ -840,7 +840,7 @@
 	// play the smacker
 
 	FN_stop_music(NULL);	// don't want to carry on streaming game music when smacker starts!
-	PauseFxForSequence();	// pause sfx during sequence, except the one used for lead-in music
+	g_bs2->_sound->PauseFxForSequence();	// pause sfx during sequence, except the one used for lead-in music
 
 	if (sequenceTextLines)	// if we have some text to accompany this sequence
 		rv = PlaySmacker(filename, sequenceSpeechArray, leadOut);
@@ -857,7 +857,7 @@
 	}
 */
 
-	UnpauseFx();	// unpause sound fx again, in case we're staying in same location
+	g_bs2->_sound->UnpauseFx();	// unpause sound fx again, in case we're staying in same location
 
  	//--------------------------------------
 	// close the lead-out music resource

Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/controls.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- controls.cpp	28 Jul 2003 07:00:12 -0000	1.4
+++ controls.cpp	29 Jul 2003 12:34:45 -0000	1.5
@@ -1929,12 +1929,12 @@
 
 	fclose(fp);
 
-	SetMusicVolume(buff[0]);
-	SetSpeechVolume(buff[1]);
-	SetFxVolume(buff[2]);
-	MuteMusic(buff[3]);
-	MuteSpeech(buff[4]);
-	MuteFx(buff[5]);
+	g_bs2->_sound->SetMusicVolume(buff[0]);
+	g_bs2->_sound->SetSpeechVolume(buff[1]);
+	g_bs2->_sound->SetFxVolume(buff[2]);
+	g_bs2->_sound->MuteMusic(buff[3]);
+	g_bs2->_sound->MuteSpeech(buff[4]);
+	g_bs2->_sound->MuteFx(buff[5]);
 
 
 	UpdateGraphicsLevel(GetRenderType(), buff[6]);	// (James13jun97)
@@ -1944,7 +1944,7 @@
 	pointerTextSelected = buff[8];
 
 	if (buff[9] != stereoReversed)
-		ReverseStereo();
+		g_bs2->_sound->ReverseStereo();
 
 	stereoReversed = buff[9];
 
@@ -1956,12 +1956,12 @@
 	uint8 buff[10];
 	FILE *fp;
 
-	buff[0] = GetMusicVolume();
-	buff[1] = GetSpeechVolume();
-	buff[2] = GetFxVolume();
-	buff[3] = IsMusicMute();
-	buff[4] = IsSpeechMute();
-	buff[5] = IsFxMute();
+	buff[0] = g_bs2->_sound->GetMusicVolume();
+	buff[1] = g_bs2->_sound->GetSpeechVolume();
+	buff[2] = g_bs2->_sound->GetFxVolume();
+	buff[3] = g_bs2->_sound->IsMusicMute();
+	buff[4] = g_bs2->_sound->IsSpeechMute();
+	buff[5] = g_bs2->_sound->IsFxMute();
 	buff[6] = GetRenderType();
 	buff[7] = subtitles;
 	buff[8] = pointerTextSelected;
@@ -2094,9 +2094,9 @@
 	int		title_len, subtitle_len, ok_len, cancel_len, left_align, test_len;
 
 // slider values
-	uint8   musicVolume  = GetMusicVolume();
-	uint8	speechVolume = GetSpeechVolume();
-	uint8	fxVolume	 = GetFxVolume();
+	uint8   musicVolume  = g_bs2->_sound->GetMusicVolume();
+	uint8	speechVolume = g_bs2->_sound->GetSpeechVolume();
+	uint8	fxVolume	 = g_bs2->_sound->GetFxVolume();
 	uint8	grfxLevel    = GetRenderType();
 
 // safe slider values for restoring on cancel
@@ -2197,9 +2197,9 @@
 	uint8 subtitle_state = subtitles;
 	uint8 stereo_state   = stereoReversed;
 
-	uint8 music_mute_state   = IsMusicMute();
-	uint8 speech_mute_state  = IsSpeechMute();
-	uint8 fx_mute_state	     = IsFxMute();
+	uint8 music_mute_state   = g_bs2->_sound->IsMusicMute();
+	uint8 speech_mute_state  = g_bs2->_sound->IsSpeechMute();
+	uint8 fx_mute_state	     = g_bs2->_sound->IsFxMute();
 
 
 //build the button surfaces surfaces
@@ -2359,19 +2359,19 @@
 		}
 
 		if (!music_mute_state)
-			SetMusicVolume(musicVolume);
+			g_bs2->_sound->SetMusicVolume(musicVolume);
 		else
-			SetMusicVolume(0);
+			g_bs2->_sound->SetMusicVolume(0);
 
 		if (!fx_mute_state)
-			SetFxVolume(fxVolume);
+			g_bs2->_sound->SetFxVolume(fxVolume);
 		else
-			SetFxVolume(0);
+			g_bs2->_sound->SetFxVolume(0);
 
 		if (!speech_mute_state)
-			SetSpeechVolume(speechVolume);
+			g_bs2->_sound->SetSpeechVolume(speechVolume);
 		else
-			SetSpeechVolume(0);
+			g_bs2->_sound->SetSpeechVolume(0);
 
 		//--------------------------------------------------
  		// Service windows
@@ -2555,19 +2555,19 @@
 				{
 					UpdateGraphicsLevel(safe_grfxLevel, grfxLevel);	// (James13jun97)
 
-					MuteMusic(music_mute_state);					// Ensure all the levels are recorded correctly (Pete21Aug97)
-					MuteSpeech(speech_mute_state);
-					MuteFx(fx_mute_state);
-					SetMusicVolume(music_target);
-					SetSpeechVolume(speech_target);
-					SetFxVolume(fx_target);
+					g_bs2->_sound->MuteMusic(music_mute_state);					// Ensure all the levels are recorded correctly (Pete21Aug97)
+					g_bs2->_sound->MuteSpeech(speech_mute_state);
+					g_bs2->_sound->MuteFx(fx_mute_state);
+					g_bs2->_sound->SetMusicVolume(music_target);
+					g_bs2->_sound->SetSpeechVolume(speech_target);
+					g_bs2->_sound->SetFxVolume(fx_target);
 
 					subtitles = subtitle_state;    // Save object label and subtitle settings
 					pointerTextSelected = object_state;
 					speechSelected      = !speech_mute_state;
 
 					if (stereo_state != stereoReversed)
-						ReverseStereo();
+						g_bs2->_sound->ReverseStereo();
 
 					stereoReversed      = stereo_state;
 					WriteOptionSettings();
@@ -2591,17 +2591,17 @@
 
 				if (touching_music_mute && dmusic_mute_state) {
 					music_mute_state = dmusic_mute_state = 0;  // if the button was in now let it out
-					MuteMusic(0);
+					g_bs2->_sound->MuteMusic(0);
 				}
 
 				if (touching_fx_mute && dfx_mute_state) {
 					fx_mute_state = dfx_mute_state = 0;  // if the button was in now let it out
-					MuteFx(0);
+					g_bs2->_sound->MuteFx(0);
 				}
 
 				if (touching_speech_mute && dspeech_mute_state) {
 					speech_mute_state = dspeech_mute_state = 0;  // if the button was in now let it out
-					MuteSpeech(0);
+					g_bs2->_sound->MuteSpeech(0);
 				}
 
 				// Stop tracking any sliders
@@ -2649,7 +2649,7 @@
 					else
 					{
 						music_mute_state = 1;
-						MuteMusic(1);
+						g_bs2->_sound->MuteMusic(1);
 					}
 				}
 
@@ -2660,7 +2660,7 @@
 					else
 					{
 						fx_mute_state=1;
-						MuteFx(1);
+						g_bs2->_sound->MuteFx(1);
 					}
 				}
 
@@ -2671,7 +2671,7 @@
 					else
 					{
 						speech_mute_state=1;
-						MuteSpeech(1);
+						g_bs2->_sound->MuteSpeech(1);
 					}
 				}
 
@@ -2680,7 +2680,7 @@
 					if (music_mute_state)
 					{
 						music_mute_state = 0;
-						MuteMusic(0);
+						g_bs2->_sound->MuteMusic(0);
 					}
 
 					if (mousex>(slab_sprite[0].x+SLIDER_W))
@@ -2707,7 +2707,7 @@
 					if (speech_mute_state)
 					{
 						speech_mute_state = 0;
-						MuteSpeech(0);
+						g_bs2->_sound->MuteSpeech(0);
 					}
 
 					if (mousex>(slab_sprite[1].x+SLIDER_W))
@@ -2734,7 +2734,7 @@
 					if (fx_mute_state)
 					{
 						fx_mute_state = 0;
-						MuteFx(0);
+						g_bs2->_sound->MuteFx(0);
 					}
 
 					if (mousex>(slab_sprite[2].x+SLIDER_W))

Index: function.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/function.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- function.cpp	28 Jul 2003 09:49:45 -0000	1.3
+++ function.cpp	29 Jul 2003 12:34:45 -0000	1.4
@@ -412,7 +412,6 @@
 // This function just quits the game if this is the playable demo, ie. credits are NOT played in the demo any more!
 
 extern uint8 quitGame;			// From sword2.cpp
-extern void UpdateCompSampleStreaming(void);	// From d_sound.c
 
 int32 FN_play_credits(int32 *params)
 {
@@ -431,7 +430,7 @@
 		StopMusic();	// Stop any streaming music
 		
 		for (int i = 0; i<16; i++)
-			UpdateCompSampleStreaming();	// And wait for it to die
+			g_bs2->_sound->UpdateCompSampleStreaming();	// And wait for it to die
 
 		GetDrawStatus (&ds);
 		GetSoundStatus(&ss);

Index: mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/mouse.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mouse.cpp	28 Jul 2003 09:49:45 -0000	1.5
+++ mouse.cpp	29 Jul 2003 12:34:45 -0000	1.6
@@ -235,7 +235,7 @@
 						}
 
 					//------------------------
-					rv = PauseFx();
+					rv = g_bs2->_sound->PauseFx();
 					if (rv != RD_OK)
 						Zdebug("ERROR: PauseFx() returned %.8x in SystemMenu()", rv);
   					//------------------------
@@ -309,7 +309,7 @@
 						this_screen.new_palette=1;
 
 					//------------------------
-					rv = UnpauseFx();
+					rv = g_bs2->_sound->UnpauseFx();
 					if (rv != RD_OK)
 						Zdebug("ERROR: UnpauseFx() returned %.8x in SystemMenu()", rv);
 					//------------------------

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sound.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- sound.cpp	28 Jul 2003 09:49:45 -0000	1.5
+++ sound.cpp	29 Jul 2003 12:34:45 -0000	1.6
@@ -111,7 +111,7 @@
 			}
 			else if (fxq[j].type == FX_SPOT2)
 			{
-				if (IsFxOpen(j+1))
+				if (g_bs2->_sound->IsFxOpen(j+1))
 					fxq[j].resource = 0;		// Once the Fx has finished remove it from the queue.
 			}
 		}
@@ -131,7 +131,7 @@
 	{
 		data = res_man.Res_open(fxq[j].resource);						// load in the sample
 		data += sizeof(_standardHeader);
-		rv = PlayFx( id, data, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT );		// wav data gets copied to sound memory
+		rv = g_bs2->_sound->PlayFx( id, data, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT );		// wav data gets copied to sound memory
 		res_man.Res_close(fxq[j].resource);								// release the sample
 //		fxq[j].resource = 0;											// clear spot fx from queue
 	}
@@ -139,9 +139,9 @@
 	{		// - to be referenced by 'j', so pass NULL data
 
 		if (fxq[j].type == FX_RANDOM)
-			rv = PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT );	// not looped
+			rv = g_bs2->_sound->PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXSPOT );	// not looped
 		else			// FX_LOOP
-			rv = PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXLOOP );	// looped
+			rv = g_bs2->_sound->PlayFx( id, NULL, fxq[j].volume, fxq[j].pan, RDSE_FXLOOP );	// looped
 	}
 
 	#ifdef _BS2_DEBUG
@@ -251,7 +251,7 @@
 			#endif
 
 			data += sizeof(_standardHeader);
-			rv = OpenFx(id,data);							// copy it to sound memory, using position in queue as 'id'
+			rv = g_bs2->_sound->OpenFx(id,data);							// copy it to sound memory, using position in queue as 'id'
 
 			#ifdef _BS2_DEBUG
 			if (rv)
@@ -289,7 +289,7 @@
 //			2	new pan (-16..16)
 
 //	SetFxVolumePan(int32 id, uint8 vol, uint8 pan);
-	SetFxVolumePan(1+params[0], params[1], params[2]);	// driver fx_id is 1+<pos in queue>
+	g_bs2->_sound->SetFxVolumePan(1+params[0], params[1], params[2]);	// driver fx_id is 1+<pos in queue>
 //	Zdebug("%d",params[2]);
 
 	return (IR_CONT);
@@ -302,7 +302,7 @@
 //			1	new volume (0..16)
 
 //	SetFxIdVolume(int32 id, uint8 vol);
-	SetFxIdVolume(1+params[0], params[1]);
+	g_bs2->_sound->SetFxIdVolume(1+params[0], params[1]);
 
 	return (IR_CONT);
 }
@@ -321,7 +321,7 @@
 	if ((fxq[j].type == FX_RANDOM) || (fxq[j].type == FX_LOOP))
 	{
 		id = (uint32)j+1;	// because 0 is not a valid id
-		rv = CloseFx(id);		// stop fx & remove sample from sound memory
+		rv = g_bs2->_sound->CloseFx(id);		// stop fx & remove sample from sound memory
 
 		#ifdef _BS2_DEBUG
 		if (rv)
@@ -350,7 +350,7 @@
 
 void Clear_fx_queue(void)
 {
-	ClearAllFx();			// stop all fx & remove the samples from sound memory
+	g_bs2->_sound->ClearAllFx();			// stop all fx & remove the samples from sound memory
 	Init_fx_queue();		// clean out the queue
 }
 
@@ -415,7 +415,7 @@
 	else
 		sprintf(filename,"%sCLUSTERS\\MUSIC.CLU", res_man.GetCdPath());
 
-	rv = StreamCompMusic(filename, params[0], loopFlag);
+	rv = g_bs2->_sound->StreamCompMusic(filename, params[0], loopFlag);
 
 	#ifdef _BS2_DEBUG
 		if (rv)
@@ -435,25 +435,24 @@
 
 	looping_music_id=0;		// clear the 'looping' flag
 
-	StopMusic();
+	g_bs2->_sound->StopMusic();
 
 	if (params);
 
 	return(IR_CONT);	//	continue script
 }
 //--------------------------------------------------------------------------------------
-extern void UpdateCompSampleStreaming(void);	// used in Kill_music()
 //--------------------------------------------------------------------------------------
 void Kill_music(void)	// James22aug97
 {
 	uint8 count;
 
 	looping_music_id=0;		// clear the 'looping' flag
-	StopMusic();
+	g_bs2->_sound->StopMusic();
 
 	// THIS BIT CAUSES THE MUSIC TO STOP INSTANTLY!
 	for(count=0; count<16; count++)
-		UpdateCompSampleStreaming();
+		g_bs2->_sound->UpdateCompSampleStreaming();
 }
 //--------------------------------------------------------------------------------------
 int32 FN_check_music_playing(int32 *params)		// James (30july97)
@@ -463,7 +462,7 @@
 	// sets result to no. of seconds of current tune remaining
 	// or 0 if no music playing
 
-	RESULT = MusicTimeRemaining();	// in seconds, rounded up to the nearest second
+	RESULT = g_bs2->_sound->MusicTimeRemaining();	// in seconds, rounded up to the nearest second
 
 	return(IR_CONT);	//	continue script
 }
@@ -472,15 +471,15 @@
 {
 	uint32	rv;	// for drivers return value
 
-	rv = PauseMusic();
+	rv = g_bs2->_sound->PauseMusic();
 	if (rv != RD_OK)
 		Zdebug("ERROR: PauseMusic() returned %.8x in PauseAllSound()", rv);
 
-	rv = PauseSpeech();
+	rv = g_bs2->_sound->PauseSpeech();
 	if (rv != RD_OK)
 		Zdebug("ERROR: PauseSpeech() returned %.8x in PauseAllSound()", rv);
 
-	rv = PauseFx();
+	rv = g_bs2->_sound->PauseFx();
 	if (rv != RD_OK)
 		Zdebug("ERROR: PauseFx() returned %.8x in PauseAllSound()", rv);
 }
@@ -489,15 +488,15 @@
 {
 	uint32	rv;	// for drivers return value
 
-	rv = UnpauseMusic();
+	rv = g_bs2->_sound->UnpauseMusic();
 	if (rv != RD_OK)
 		Zdebug("ERROR: UnpauseMusic() returned %.8x in UnpauseAllSound()", rv);
 
-	rv = UnpauseSpeech();
+	rv = g_bs2->_sound->UnpauseSpeech();
 	if (rv != RD_OK)
 		Zdebug("ERROR: UnpauseSpeech() returned %.8x in UnpauseAllSound()", rv);
 
-	rv = UnpauseFx();
+	rv = g_bs2->_sound->UnpauseFx();
  	if (rv != RD_OK)
 		Zdebug("ERROR: UnpauseFx() returned %.8x in UnpauseAllSound()", rv);
 }

Index: speech.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/speech.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- speech.cpp	28 Jul 2003 14:50:53 -0000	1.8
+++ speech.cpp	29 Jul 2003 12:34:46 -0000	1.9
@@ -1373,7 +1373,7 @@
 		// New fudge to wait for smacker samples to finish (James31july97)
 		// since they can over-run into the game
 
-		if (GetSpeechStatus()!=RDSE_SAMPLEFINISHED)	// has it finished?
+		if (g_bs2->_sound->GetSpeechStatus()!=RDSE_SAMPLEFINISHED)	// has it finished?
 			return (IR_REPEAT);
 		
 	 	//-------------------------
@@ -1584,11 +1584,11 @@
  			//------------------------------
 
 
-			rv = PlayCompSpeech(speechFile, params[S_WAV], SPEECH_VOLUME, speech_pan);	// Load speech but don't start playing yet
+			rv = g_bs2->_sound->PlayCompSpeech(speechFile, params[S_WAV], SPEECH_VOLUME, speech_pan);	// Load speech but don't start playing yet
 			if (rv == RD_OK)
 			{
 				speechRunning=1;	// ok, we've got something to play	(2 means not playing yet - see below)
-				UnpauseSpeech();	// set it playing now (we might want to do this next cycle, don't know yet)
+				g_bs2->_sound->UnpauseSpeech();	// set it playing now (we might want to do this next cycle, don't know yet)
 			}
 			#ifdef _BS2_DEBUG
 			else
@@ -1628,7 +1628,7 @@
 			else if (speechRunning)											// if playing a sample
 			{
 				if	(!unpause_zone)
-				{	if (AmISpeaking()==RDSE_QUIET)								// if we're at a quiet bit
+				{	if (g_bs2->_sound->AmISpeaking()==RDSE_QUIET)								// if we're at a quiet bit
 						ob_graphic->anim_pc=0;									// restart from frame 0 ('closed mouth' frame)
 				}
 			}
@@ -1655,7 +1655,7 @@
 	if (speechRunning==1)	// if playing a sample (note that value of '2' means about to play!)
 	{
 		if	(!unpause_zone)
-		{	if (GetSpeechStatus()==RDSE_SAMPLEFINISHED)	// has it finished?
+		{	if (g_bs2->_sound->GetSpeechStatus()==RDSE_SAMPLEFINISHED)	// has it finished?
 				speechFinished=1;						// James25feb97
 		}
 		else	unpause_zone--;
@@ -1704,7 +1704,7 @@
 
 			if (speechRunning)							// if speech sample playing
 			{
-				StopSpeechBS2();							// halt the sample prematurely
+				g_bs2->_sound->StopSpeechBS2();							// halt the sample prematurely
 			}
 		}
 	}

Index: startup.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/startup.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- startup.cpp	28 Jul 2003 14:50:54 -0000	1.5
+++ startup.cpp	29 Jul 2003 12:34:46 -0000	1.6
@@ -290,8 +290,8 @@
 			FN_stop_music(NULL);	// fade out any music that is currently playing
 			//---------------------------------------------
 
-			UnpauseSpeech();
-			StopSpeechBS2();							// halt the sample prematurely
+			g_bs2->_sound->UnpauseSpeech();
+			g_bs2->_sound->StopSpeechBS2();							// halt the sample prematurely
 
 			//--------------------------------------------------------------
 			// clean out all resources & flags, ready for a total restart (James24mar97)

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- sword2.cpp	28 Jul 2003 09:49:45 -0000	1.6
+++ sword2.cpp	29 Jul 2003 12:34:46 -0000	1.7
@@ -165,7 +165,9 @@
 	Zdebug("CALLING: Init_event_system");
 	Init_event_system();
 	Zdebug("RETURNED.");
-
+	
+	_sound = new BS2Sound;
+	
 	Zdebug("CALLING: Init_fx_queue");
 	Init_fx_queue();			// initialise the sound fx queue
 	Zdebug("RETURNED.");
@@ -284,7 +286,7 @@
   	Zdebug("RETURNED.");
 
 	Zdebug("CALLING: InitialiseSound");
-	rv = InitialiseSound(22050, 2, 16);
+	rv = _sound->InitialiseSound(22050, 2, 16);
  	Zdebug("RETURNED with rv = %.8x", rv);
 	// 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

Index: sword2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sword2.h	28 Jul 2003 07:00:15 -0000	1.2
+++ sword2.h	29 Jul 2003 12:34:46 -0000	1.3
@@ -21,6 +21,7 @@
 #define	_SWORD2
 
 //#include "src\driver96.h"
+#include "driver/d_sound.h"
 
 
 #ifdef _PCF76	// Bodge for PCF76 version so that their demo CD can be labelled "PCF76" rather than "RBSII1"
@@ -60,6 +61,7 @@
 		GameDetector *_detector;
 		uint32 _features;
 		byte _gameId;
+		BS2Sound *_sound;
 	private:
 		bool _quit;
 };





More information about the Scummvm-git-logs mailing list