From: havoc Date: Sun, 30 Mar 2003 19:18:05 +0000 (+0000) Subject: no longer complains about missing ambient liquid sounds in nexuiz X-Git-Tag: xonotic-v0.1.0preview~6693 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=38a6d5886112027efd65fa160c1902a0d3b3fd20;p=xonotic%2Fdarkplaces.git no longer complains about missing ambient liquid sounds in nexuiz git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2887 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_dma.c b/snd_dma.c index 6587918d..d9a25faf 100644 --- 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]; diff --git a/snd_mem.c b/snd_mem.c index 47398c6e..c01c479b 100644 --- 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 684102ee..4f44d240 100644 --- 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