mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
Extend S_UpgradeFormat so that "filename.ext" first searches for "filename_ext.flac" and "filename_ext.ogg" before "filename.flac" and "filename.ogg".
This fixes DUKETEAM playing grabbag.ogg instead of grabbag_voc.ogg when Megaton paths have been detected. git-svn-id: https://svn.eduke32.com/eduke32@5251 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
25543b521b
commit
62d36cede8
1 changed files with 28 additions and 3 deletions
|
@ -1078,10 +1078,14 @@ int32_t S_UpgradeFormat(const char *fn, char searchfirst)
|
|||
Bstrcpy(testfn, fn);
|
||||
extension = Bstrrchr(testfn, '.');
|
||||
|
||||
if (extension)
|
||||
if (extension != NULL)
|
||||
{
|
||||
char * const fn_end = Bstrrchr(testfn, '\0');
|
||||
*extension = '_';
|
||||
|
||||
#ifdef HAVE_FLAC
|
||||
Bstrcpy(extension, ".flac");
|
||||
char const * const extFLAC = ".flac";
|
||||
Bstrcpy(fn_end, extFLAC);
|
||||
fp = kopen4loadfrommod(testfn, searchfirst);
|
||||
if (fp >= 0)
|
||||
{
|
||||
|
@ -1091,7 +1095,28 @@ int32_t S_UpgradeFormat(const char *fn, char searchfirst)
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_VORBIS
|
||||
Bstrcpy(extension, ".ogg");
|
||||
char const * const extOGG = ".ogg";
|
||||
Bstrcpy(fn_end, extOGG);
|
||||
fp = kopen4loadfrommod(testfn, searchfirst);
|
||||
if (fp >= 0)
|
||||
{
|
||||
Bfree(testfn);
|
||||
return fp;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FLAC
|
||||
Bstrcpy(extension, extFLAC);
|
||||
fp = kopen4loadfrommod(testfn, searchfirst);
|
||||
if (fp >= 0)
|
||||
{
|
||||
Bfree(testfn);
|
||||
return fp;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VORBIS
|
||||
Bstrcpy(extension, extOGG);
|
||||
fp = kopen4loadfrommod(testfn, searchfirst);
|
||||
if (fp >= 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue