[quake3-commits] r1748 - in trunk: . code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Nov 9 20:55:54 EST 2009


Author: thilo
Date: 2009-11-09 20:55:54 -0500 (Mon, 09 Nov 2009)
New Revision: 1748

Modified:
   trunk/README
   trunk/code/client/snd_dma.c
   trunk/code/client/snd_main.c
Log:
 - Add stopmusic command
 - Make cvar s_muted read-only


Modified: trunk/README
===================================================================
--- trunk/README	2009-11-10 01:08:15 UTC (rev 1747)
+++ trunk/README	2009-11-10 01:55:54 UTC (rev 1748)
@@ -198,6 +198,7 @@
 New commands
   video [filename]        - start video capture (use with demo command)
   stopvideo               - stop video capture
+  stopmusic               - stop background music
 
   print                   - print out the contents of a cvar
   unset                   - unset a user created cvar

Modified: trunk/code/client/snd_dma.c
===================================================================
--- trunk/code/client/snd_dma.c	2009-11-10 01:08:15 UTC (rev 1747)
+++ trunk/code/client/snd_dma.c	2009-11-10 01:55:54 UTC (rev 1748)
@@ -33,10 +33,6 @@
 #include "snd_codec.h"
 #include "client.h"
 
-void S_Play_f(void);
-void S_SoundList_f(void);
-void S_Music_f(void);
-
 void S_Update_( void );
 void S_Base_StopAllSounds(void);
 void S_Base_StopBackgroundTrack( void );
@@ -1315,7 +1311,9 @@
 	}
 	Com_DPrintf( "S_StartBackgroundTrack( %s, %s )\n", intro, loop );
 
-	if ( !intro[0] ) {
+	if(!*intro)
+	{
+		S_Base_StopBackgroundTrack();
 		return;
 	}
 

Modified: trunk/code/client/snd_main.c
===================================================================
--- trunk/code/client/snd_main.c	2009-11-10 01:08:15 UTC (rev 1747)
+++ trunk/code/client/snd_main.c	2009-11-10 01:55:54 UTC (rev 1748)
@@ -448,6 +448,20 @@
 
 }
 
+/*
+=================
+S_Music_f
+=================
+*/
+void S_StopMusic_f( void )
+{
+	if(!si.StopBackgroundTrack)
+		return;
+
+	si.StopBackgroundTrack();
+}
+
+
 //=============================================================================
 
 /*
@@ -464,7 +478,7 @@
 
 	s_volume = Cvar_Get( "s_volume", "0.8", CVAR_ARCHIVE );
 	s_musicVolume = Cvar_Get( "s_musicvolume", "0.25", CVAR_ARCHIVE );
-	s_muted = Cvar_Get("s_muted", "0", CVAR_TEMP);
+	s_muted = Cvar_Get("s_muted", "0", CVAR_ROM);
 	s_doppler = Cvar_Get( "s_doppler", "1", CVAR_ARCHIVE );
 	s_backend = Cvar_Get( "s_backend", "", CVAR_ROM );
 	s_muteWhenMinimized = Cvar_Get( "s_muteWhenMinimized", "0", CVAR_ARCHIVE );
@@ -479,6 +493,7 @@
 
 		Cmd_AddCommand( "play", S_Play_f );
 		Cmd_AddCommand( "music", S_Music_f );
+		Cmd_AddCommand( "stopmusic", S_StopMusic_f );
 		Cmd_AddCommand( "s_list", S_SoundList );
 		Cmd_AddCommand( "s_stop", S_StopAllSounds );
 		Cmd_AddCommand( "s_info", S_SoundInfo );
@@ -525,6 +540,7 @@
 
 	Cmd_RemoveCommand( "play" );
 	Cmd_RemoveCommand( "music");
+	Cmd_RemoveCommand( "stopmusic");
 	Cmd_RemoveCommand( "s_list" );
 	Cmd_RemoveCommand( "s_stop" );
 	Cmd_RemoveCommand( "s_info" );



More information about the quake3-commits mailing list