From b424d41c54e434e1806620ff36e2df5e178b47ab Mon Sep 17 00:00:00 2001 From: dresk Date: Sun, 8 Jul 2007 23:54:14 +0000 Subject: [PATCH] Added command cl_soundindexlist which lists the sound index and the corresponding filenames of the sounds. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7474 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cl_main.c b/cl_main.c index 55e86a10..048cb995 100644 --- 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); -- 2.39.2