*/
void CL_InitTEnts (void)
{
- cl_sfx_wizhit = S_PrecacheSound ("wizard/hit.wav");
- cl_sfx_knighthit = S_PrecacheSound ("hknight/hit.wav");
- cl_sfx_tink1 = S_PrecacheSound ("weapons/tink1.wav");
- cl_sfx_ric1 = S_PrecacheSound ("weapons/ric1.wav");
- cl_sfx_ric2 = S_PrecacheSound ("weapons/ric2.wav");
- cl_sfx_ric3 = S_PrecacheSound ("weapons/ric3.wav");
- cl_sfx_r_exp3 = S_PrecacheSound ("weapons/r_exp3.wav");
+ cl_sfx_wizhit = S_PrecacheSound ("wizard/hit.wav", false);
+ cl_sfx_knighthit = S_PrecacheSound ("hknight/hit.wav", false);
+ cl_sfx_tink1 = S_PrecacheSound ("weapons/tink1.wav", false);
+ cl_sfx_ric1 = S_PrecacheSound ("weapons/ric1.wav", false);
+ cl_sfx_ric2 = S_PrecacheSound ("weapons/ric2.wav", false);
+ cl_sfx_ric3 = S_PrecacheSound ("weapons/ric3.wav", false);
+ cl_sfx_r_exp3 = S_PrecacheSound ("weapons/r_exp3.wav", false);
}
/*
// provides a tick sound until washed clean
- ambient_sfx[AMBIENT_WATER] = S_PrecacheSound ("ambience/water1.wav");
- ambient_sfx[AMBIENT_SKY] = S_PrecacheSound ("ambience/wind2.wav");
+ ambient_sfx[AMBIENT_WATER] = S_PrecacheSound ("ambience/water1.wav", false);
+ ambient_sfx[AMBIENT_SKY] = S_PrecacheSound ("ambience/wind2.wav", false);
S_StopAllSounds (true);
}
*/
sfx_t *S_FindName (char *name)
{
- int i;
- sfx_t *sfx;
+ int i;
+ sfx_t *sfx;
if (!name)
Host_Error ("S_FindName: NULL\n");
Host_Error ("Sound name too long: %s", name);
// see if already loaded
- for (i=0 ; i < num_sfx ; i++)
+ for (i = 0;i < num_sfx;i++)
if (!strcmp(known_sfx[i].name, name))
- {
return &known_sfx[i];
- }
if (num_sfx == MAX_SFX)
Sys_Error ("S_FindName: out of sfx_t");
-
+
sfx = &known_sfx[i];
strcpy (sfx->name, name);
num_sfx++;
-
+
return sfx;
}
==================
*/
-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;
// cache it in
if (precache.integer)
- S_LoadSound (sfx);
+ S_LoadSound (sfx, complain);
return sfx;
}
return; // not audible at all
// new channel
- sc = S_LoadSound (sfx);
+ sc = S_LoadSound (sfx, true);
if (!sc)
{
target_chan->sfx = NULL;
ss = &channels[total_channels];
total_channels++;
- sc = S_LoadSound (sfx);
+ sc = S_LoadSound (sfx, true);
if (!sc)
return;
}
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++;
}
}
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++;
}
}
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;
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);
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);
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);