sfx = S_PrecacheSound (va ("cdtracks/track%02u.wav", track), false, false);
if (sfx == NULL || !S_IsSoundPrecached (sfx))
sfx = S_PrecacheSound (va ("cdtracks/track%03u.wav", track), false, false);
+ if (sfx == NULL || !S_IsSoundPrecached (sfx))
+ sfx = S_PrecacheSound (va ("cdtracks/track%02u", track), false, false);
+ if (sfx == NULL || !S_IsSoundPrecached (sfx))
+ sfx = S_PrecacheSound (va ("cdtracks/track%03u", track), false, false);
}
else
{
LDFLAGS_UNIXCOMMON=-lm
LDFLAGS_UNIXCL=-L$(UNIX_X11LIBPATH) -lX11 -lXpm -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
-LDFLAGS_UNIXCL_PRELOAD=-lz -ljpeg -lpng -lvorbis -lvorbisfile -lcurl
+LDFLAGS_UNIXCL_PRELOAD=-lz -ljpeg -lpng -lvorbis -lvorbisfile -lcurl -lmodplug
LDFLAGS_UNIXSV_PRELOAD=-lz -lcurl
-LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -lvorbis -lvorbisfile -lcurl
+LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -lvorbis -lvorbisfile -lcurl -lmodplug
CFLAGS_UNIX_PRELOAD=-DPREFER_PRELOAD
LDFLAGS_UNIXSDL=$(SDLCONFIG_LIBS)
Con_DPrintf("S_LoadSound: name \"%s\" is too long\n", sfx->name);
return false;
}
- if (S_LoadWavFile (namebuffer, sfx))
- return true;
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav"))
+ {
+ if (S_LoadWavFile (namebuffer, sfx))
+ return true;
memcpy (namebuffer + len - 3, "ogg", 4);
+ }
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg"))
+ {
if (OGG_LoadVorbisFile (namebuffer, sfx))
return true;
- if (ModPlug_LoadModPlugFile (namebuffer, sfx))
- return true;
+ }
+ else
+ {
+ if (ModPlug_LoadModPlugFile (namebuffer, sfx))
+ return true;
+ }
}
// LordHavoc: then try without the added sound/ as wav and ogg
Con_DPrintf("S_LoadSound: name \"%s\" is too long\n", sfx->name);
return false;
}
- if (S_LoadWavFile (namebuffer, sfx))
- return true;
+ // request foo.wav: tries foo.wav, then foo.ogg
+ // request foo.ogg: tries foo.ogg only
+ // request foo.mod: tries foo.mod only
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav"))
+ {
+ if (S_LoadWavFile (namebuffer, sfx))
+ return true;
memcpy (namebuffer + len - 3, "ogg", 4);
+ }
if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg"))
+ {
if (OGG_LoadVorbisFile (namebuffer, sfx))
return true;
- if (ModPlug_LoadModPlugFile (namebuffer, sfx))
- return true;
+ }
+ else
+ {
+ if (ModPlug_LoadModPlugFile (namebuffer, sfx))
+ return true;
+ }
// Can't load the sound!
sfx->flags |= SFXFLAG_FILEMISSING;