memsize = newsampleframes * in_format->channels * in_format->width;
memsize += sizeof (*sb) - sizeof (sb->samples);
memsize = newsampleframes * in_format->channels * in_format->width;
memsize += sizeof (*sb) - sizeof (sb->samples);
if (developer_loading.integer)
Con_Printf("loading sound %s\n", sfx->name);
if (developer_loading.integer)
Con_Printf("loading sound %s\n", sfx->name);
// LordHavoc: if the sound filename does not begin with sound/, try adding it
if (strncasecmp(sfx->name, "sound/", 6))
{
// LordHavoc: if the sound filename does not begin with sound/, try adding it
if (strncasecmp(sfx->name, "sound/", 6))
{
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav"))
{
if (S_LoadWavFile (namebuffer, sfx))
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav"))
{
if (S_LoadWavFile (namebuffer, sfx))
memcpy (namebuffer + len - 3, "ogg", 4);
}
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg"))
{
if (OGG_LoadVorbisFile (namebuffer, sfx))
memcpy (namebuffer + len - 3, "ogg", 4);
}
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg"))
{
if (OGG_LoadVorbisFile (namebuffer, sfx))
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav"))
{
if (S_LoadWavFile (namebuffer, sfx))
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav"))
{
if (S_LoadWavFile (namebuffer, sfx))
memcpy (namebuffer + len - 3, "ogg", 4);
}
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg"))
{
if (OGG_LoadVorbisFile (namebuffer, sfx))
memcpy (namebuffer + len - 3, "ogg", 4);
}
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg"))
{
if (OGG_LoadVorbisFile (namebuffer, sfx))
}
// Can't load the sound!
sfx->flags |= SFXFLAG_FILEMISSING;
if (complain)
Con_DPrintf("failed to load sound \"%s\"\n", sfx->name);
}
// Can't load the sound!
sfx->flags |= SFXFLAG_FILEMISSING;
if (complain)
Con_DPrintf("failed to load sound \"%s\"\n", sfx->name);