]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 6e224f55a5fd0e33618e6b11d40b453ae3923100..b00852daca62da1cd36e283926665bae4aaa513f 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 15e571b37c1a368b185ff034a755b4df453ca86f..108aa7795599f903ff15fcd7991c0bd3111ed3c4 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;