]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Added command cl_soundindexlist which lists the sound index and the corresponding...
authordresk <dresk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 Jul 2007 23:54:14 +0000 (23:54 +0000)
committerdresk <dresk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 Jul 2007 23:54:14 +0000 (23:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7474 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c

index 55e86a107861d772f4c822edba05432a96b5a8dd..048cb9957b8c38870f5b17b21ae395c006840575 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "csprogs.h"
 #include "r_shadow.h"
 #include "libcurl.h"
+#include "snd_main.h"
 
 // we need to declare some mouse variables here, because the menu system
 // references them even when on a unix system.
@@ -462,6 +463,24 @@ static void CL_ModelIndexList_f(void)
        }
 }
 
+/*
+===============
+CL_SoundIndexList_f
+
+List all sounds in the client soundindex
+===============
+*/
+static void CL_SoundIndexList_f(void)
+{
+       int nSoundIndexCnt = 1;
+
+       while(cl.sound_precache[nSoundIndexCnt] && nSoundIndexCnt != MAX_SOUNDS)
+       { // Valid Sound
+               Con_Printf("%i : %s\n", nSoundIndexCnt, cl.sound_precache[nSoundIndexCnt]->name);
+               nSoundIndexCnt++;
+       }
+}
+
 //static const vec3_t nomodelmins = {-16, -16, -16};
 //static const vec3_t nomodelmaxs = {16, 16, 16};
 void CL_UpdateRenderEntity(entity_render_t *ent)
@@ -2215,6 +2234,8 @@ void CL_Init (void)
 
        // Support Client-side Model Index List
        Cmd_AddCommand ("cl_modelindexlist", CL_ModelIndexList_f, "list all models in the client modelindex");
+       // Support Client-side Sound Index List
+       Cmd_AddCommand ("cl_soundindexlist", CL_SoundIndexList_f, "list all sounds in the client soundindex");
 
        Cvar_RegisterVariable (&cl_autodemo);
        Cvar_RegisterVariable (&cl_autodemo_nameformat);