From: havoc Date: Sat, 20 Jan 2007 09:14:02 +0000 (+0000) Subject: S_PrecacheSound now clears the SFXFLAG_FILEMISSING flag so that loading will try... X-Git-Tag: xonotic-v0.1.0preview~3700 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=52191260b6e0d2a486e8da890e06e5821804595f S_PrecacheSound now clears the SFXFLAG_FILEMISSING flag so that loading will try again on previously missing files whenever the level changes (particularly important if downloads or gamedir changes have occurred) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6706 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_main.c b/snd_main.c index 6e224f55..b00852da 100644 --- a/snd_main.c +++ b/snd_main.c @@ -949,6 +949,11 @@ sfx_t *S_PrecacheSound (const char *name, qboolean complain, qboolean lock) return NULL; sfx = S_FindName (name); + + // clear the FILEMISSING flag so that S_LoadSound will try again on a + // previously missing file + sfx->flags &= ~ SFXFLAG_FILEMISSING; + if (sfx == NULL) return NULL; diff --git a/snd_mem.c b/snd_mem.c index 15e571b3..108aa779 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -80,7 +80,7 @@ snd_buffer_t *Snd_CreateSndBuffer (const unsigned char *samples, unsigned int sa { size_t newsampleframes, memsize; snd_buffer_t* sb; - + newsampleframes = (double)sampleframes * (double)sb_speed / (double)in_format->speed; memsize = newsampleframes * in_format->channels * in_format->width; @@ -311,6 +311,7 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) return true; // If we weren't able to load it previously, no need to retry + // Note: S_PrecacheSound clears this flag to cause a retry if (sfx->flags & SFXFLAG_FILEMISSING) return false;