When sounds can't be found, don't spam the same message over and over again.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2401 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-10-05 22:11:17 +00:00
parent 83bcdc0cc7
commit dc4ca9b290
5 changed files with 16 additions and 0 deletions

View File

@ -922,6 +922,7 @@ void CL_ClearState (void)
CL_AllowIndependantSendCmd(false); //model stuff could be a problem.
S_StopAllSounds (true);
S_ResetFailedLoad();
Cvar_ApplyLatches(CVAR_SERVEROVERRIDE);

View File

@ -432,6 +432,7 @@ void CL_FinishDownload(char *filename, char *tempname)
break;
}
}
S_ResetFailedLoad(); //okay, so this can still get a little spammy in bad places...
//this'll do the magic for us
Skin_FlushSkin(filename);

View File

@ -720,6 +720,13 @@ sfx_t *S_FindName (char *name)
return sfx;
}
void S_ResetFailedLoad(void)
{
int i;
for (i=0 ; i < num_sfx ; i++)
known_sfx[i].failedload = false;
}
/*
==================

View File

@ -785,6 +785,9 @@ sfxcache_t *S_LoadSound (sfx_t *s)
char *name = s->name;
if (s->failedload)
return NULL; //it failed to load once before, don't bother trying again.
// see if still in memory
sc = Cache_Check (&s->cache);
if (sc)
@ -854,6 +857,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
{
//FIXME: check to see if qued for download.
Con_DPrintf ("Couldn't load %s\n", namebuffer);
s->failedload = true;
return NULL;
}
@ -866,6 +870,8 @@ sfxcache_t *S_LoadSound (sfx_t *s)
return sc;
}
}
s->failedload = true;
return NULL;
}

View File

@ -48,6 +48,7 @@ typedef struct {
typedef struct sfx_s
{
char name[MAX_OSPATH];
qboolean failedload; //no more super-spammy
cache_user_t cache;
sfxdecode_t *decoder;
} sfx_t;