S_PrecacheSound now clears the SFXFLAG_FILEMISSING flag so that loading will try...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 20 Jan 2007 09:14:02 +0000 (09:14 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 20 Jan 2007 09:14:02 +0000 (09:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6706 d7cf8633-e32d-0410-b094-e92efae38249

snd_main.c
snd_mem.c

index 6e224f5..b00852d 100644 (file)
@@ -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;
 
index 15e571b..108aa77 100644 (file)
--- 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;