From: havoc Date: Sat, 29 Jun 2002 04:00:11 +0000 (+0000) Subject: no longer complains about missing sounds loaded by the engine (wind2, water1, etc... X-Git-Tag: RELEASE_0_2_0_RC1~458 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=cca6f0cbe16bbb8d62d264bed54da2e6e6a7ed75 no longer complains about missing sounds loaded by the engine (wind2, water1, etc), only the QC git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1969 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index ef85680c..fcc03231 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -459,7 +459,7 @@ void CL_ParseServerInfo (void) S_BeginPrecaching (); for (i=1 ; iname, name); num_sfx++; - + return sfx; } @@ -318,9 +316,9 @@ S_PrecacheSound ================== */ -sfx_t *S_PrecacheSound (char *name) +sfx_t *S_PrecacheSound (char *name, int complain) { - sfx_t *sfx; + sfx_t *sfx; if (!sound_started || nosound.integer) return NULL; @@ -329,7 +327,7 @@ sfx_t *S_PrecacheSound (char *name) // cache it in if (precache.integer) - S_LoadSound (sfx); + S_LoadSound (sfx, complain); return sfx; } @@ -477,7 +475,7 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f return; // not audible at all // new channel - sc = S_LoadSound (sfx); + sc = S_LoadSound (sfx, true); if (!sc) { target_chan->sfx = NULL; @@ -638,7 +636,7 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) ss = &channels[total_channels]; total_channels++; - sc = S_LoadSound (sfx); + sc = S_LoadSound (sfx, true); if (!sc) return; @@ -921,7 +919,7 @@ void S_Play(void) } else strcpy(name, Cmd_Argv(i)); - sfx = S_PrecacheSound(name); + sfx = S_PrecacheSound(name, true); S_StartSound(hash++, 0, sfx, listener_origin, 1.0, 1.0); i++; } @@ -944,7 +942,7 @@ void S_Play2(void) } else strcpy(name, Cmd_Argv(i)); - sfx = S_PrecacheSound(name); + sfx = S_PrecacheSound(name, true); S_StartSound(hash++, 0, sfx, listener_origin, 1.0, 0.0); i++; } @@ -968,7 +966,7 @@ void S_PlayVol(void) } else strcpy(name, Cmd_Argv(i)); - sfx = S_PrecacheSound(name); + sfx = S_PrecacheSound(name, true); vol = atof(Cmd_Argv(i+1)); S_StartSound(hash++, 0, sfx, listener_origin, vol, 1.0); i+=2; @@ -1009,7 +1007,7 @@ void S_LocalSound (char *sound) if (!sound_started) return; - sfx = S_PrecacheSound (sound); + sfx = S_PrecacheSound (sound, true); if (!sfx) { Con_Printf ("S_LocalSound: can't precache %s\n", sound); diff --git a/snd_mem.c b/snd_mem.c index 4e2a94ec..9c355a12 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -211,7 +211,7 @@ void ResampleSfx (sfxcache_t *sc, qbyte *data, char *name) S_LoadSound ============== */ -sfxcache_t *S_LoadSound (sfx_t *s) +sfxcache_t *S_LoadSound (sfx_t *s, int complain) { char namebuffer[256]; qbyte *data; @@ -231,7 +231,8 @@ sfxcache_t *S_LoadSound (sfx_t *s) if (!data) { - Con_Printf ("Couldn't load %s\n", namebuffer); + if (complain) + Con_Printf ("Couldn't load %s\n", namebuffer); return NULL; } diff --git a/snd_mix.c b/snd_mix.c index a31b4ce5..d388a36f 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -353,7 +353,7 @@ void S_PaintChannels(int endtime) continue; if (!ch->leftvol && !ch->rightvol) continue; - sc = S_LoadSound (ch->sfx); + sc = S_LoadSound (ch->sfx, true); if (!sc) continue; diff --git a/sound.h b/sound.h index a37b2e8d..ebc0a849 100644 --- a/sound.h +++ b/sound.h @@ -98,7 +98,7 @@ void S_ClearBuffer (void); void S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void S_ExtraUpdate (void); -sfx_t *S_PrecacheSound (char *sample); +sfx_t *S_PrecacheSound (char *sample, int complain); void S_TouchSound (char *sample); void S_ClearPrecache (void); void S_BeginPrecaching (void); @@ -167,7 +167,7 @@ extern qboolean snd_initialized; extern int snd_blocked; void S_LocalSound (char *s); -sfxcache_t *S_LoadSound (sfx_t *s); +sfxcache_t *S_LoadSound (sfx_t *s, int complain); wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength);