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 6587918..d9a25fa 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 47398c6..c01c479 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 684102e..4f44d24 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