]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
no longer complains about missing ambient liquid sounds in nexuiz
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 30 Mar 2003 19:18:05 +0000 (19:18 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 30 Mar 2003 19:18:05 +0000 (19:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2887 d7cf8633-e32d-0410-b094-e92efae38249

snd_dma.c
snd_mem.c
sound.h

index 6587918d63916921cb5350d61106f65d5c7e6d8c..d9a25fafcf1704be87ea8015d3bcb463889225ec 100644 (file)
--- a/snd_dma.c
+++ b/snd_dma.c
@@ -285,6 +285,7 @@ sfx_t *S_FindName (char *name)
                Sys_Error ("S_FindName: out of sfx_t");
 
        sfx = &known_sfx[i];
+       memset(sfx, 0, sizeof(*sfx));
        strcpy (sfx->name, name);
 
        num_sfx++;
@@ -683,6 +684,8 @@ void S_UpdateAmbientSounds (void)
 // calc ambient sound levels
        for (ambient_channel = 0 ; ambient_channel< NUM_AMBIENTS ; ambient_channel++)
        {
+               if (ambient_sfx[ambient_channel] && ambient_sfx[ambient_channel]->silentlymissing)
+                       continue;
                chan = &channels[ambient_channel];
                chan->sfx = ambient_sfx[ambient_channel];
 
index 47398c6e0bde95f92279ed238d5c60dd82543410..c01c479b4c4449409df0707adf89cde2d5ba5afb 100644 (file)
--- a/snd_mem.c
+++ b/snd_mem.c
@@ -232,6 +232,7 @@ sfxcache_t *S_LoadSound (sfx_t *s, int complain)
 
        if (!data)
        {
+               s->silentlymissing = !complain;
                if (complain)
                        Con_Printf ("Couldn't load %s\n", namebuffer);
                return NULL;
diff --git a/sound.h b/sound.h
index 684102eece285082e775d662d857da8e09af6d3e..4f44d24049fe947b220659ce6d2ceb1a6c02b532 100644 (file)
--- a/sound.h
+++ b/sound.h
@@ -46,6 +46,7 @@ typedef struct sfx_s
        char    name[MAX_QPATH];
        mempool_t       *mempool;
        sfxcache_t      *sfxcache;
+       int silentlymissing; // true if missing and loaded with complain = false
 } sfx_t;
 
 typedef struct