mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 21:31:03 +00:00
- re-fixed the music lookup.
This commit is contained in:
parent
a53ed46bae
commit
793d2d99ef
1 changed files with 4 additions and 3 deletions
|
@ -133,13 +133,14 @@ FileReader OpenMusic(const char* musicname)
|
||||||
if (!reader.isOpen())
|
if (!reader.isOpen())
|
||||||
{
|
{
|
||||||
int lumpnum = LookupMusic(musicname);
|
int lumpnum = LookupMusic(musicname);
|
||||||
if (mus_extendedlookup && lumpnum < 0)
|
if (mus_extendedlookup && lumpnum >= 0)
|
||||||
{
|
{
|
||||||
// EDuke also looks in a subfolder named after the main game resource. Do this as well if extended lookup is active.
|
// EDuke also looks in a subfolder named after the main game resource. Do this as well if extended lookup is active.
|
||||||
auto rfn = fileSystem.GetResourceFileName(fileSystem.GetFileContainer(lumpnum));
|
auto rfn = fileSystem.GetResourceFileName(fileSystem.GetFileContainer(lumpnum));
|
||||||
auto rfbase = ExtractFileBase(rfn);
|
auto rfbase = ExtractFileBase(rfn);
|
||||||
FStringf aliasMusicname("music/%s/%s", rfbase.GetChars(), musicname);
|
FStringf aliasMusicname("music/%s/%s", rfbase.GetChars(), musicname);
|
||||||
lumpnum = LookupMusic(aliasMusicname);
|
int newlumpnum = LookupMusic(aliasMusicname);
|
||||||
|
if (newlumpnum >= 0) lumpnum = newlumpnum;
|
||||||
}
|
}
|
||||||
if (lumpnum == -1)
|
if (lumpnum == -1)
|
||||||
{
|
{
|
||||||
|
@ -149,7 +150,7 @@ FileReader OpenMusic(const char* musicname)
|
||||||
}
|
}
|
||||||
if (lumpnum == -1 && (g_gameType & GAMEFLAG_SW))
|
if (lumpnum == -1 && (g_gameType & GAMEFLAG_SW))
|
||||||
{
|
{
|
||||||
// Some Shadow Warrioe distributions have the music in a subfolder named 'classic'. Check that, too.
|
// Some Shadow Warrior distributions have the music in a subfolder named 'classic'. Check that, too.
|
||||||
FStringf aliasMusicname("classic/music/%s", musicname);
|
FStringf aliasMusicname("classic/music/%s", musicname);
|
||||||
lumpnum = fileSystem.FindFile(aliasMusicname);
|
lumpnum = fileSystem.FindFile(aliasMusicname);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue