mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- fixed extended music lookup again.
# Conflicts: # source/core/parsefuncs.h
This commit is contained in:
parent
2820c50f3e
commit
ff0a3df302
1 changed files with 14 additions and 11 deletions
|
@ -133,21 +133,24 @@ FileReader OpenMusic(const char* musicname)
|
|||
if (!reader.isOpen())
|
||||
{
|
||||
int lumpnum = LookupMusic(musicname);
|
||||
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.
|
||||
auto rfn = fileSystem.GetResourceFileName(fileSystem.GetFileContainer(lumpnum));
|
||||
auto rfbase = ExtractFileBase(rfn);
|
||||
FStringf aliasMusicname("music/%s/%s", rfbase.GetChars(), musicname);
|
||||
int newlumpnum = LookupMusic(aliasMusicname);
|
||||
if (newlumpnum >= 0) lumpnum = newlumpnum;
|
||||
}
|
||||
if (lumpnum == -1)
|
||||
if (mus_extendedlookup || lumpnum < 0)
|
||||
{
|
||||
if (lumpnum >= 0)
|
||||
{
|
||||
// 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 rfbase = ExtractFileBase(rfn);
|
||||
FStringf aliasMusicname("music/%s/%s", rfbase.GetChars(), musicname);
|
||||
int newlumpnum = LookupMusic(aliasMusicname);
|
||||
if (newlumpnum >= 0) lumpnum = newlumpnum;
|
||||
}
|
||||
|
||||
// Always look in the 'music' subfolder as well. This gets used by multiple setups to store ripped CD tracks.
|
||||
FStringf aliasMusicname("music/%s", musicname);
|
||||
lumpnum = LookupMusic(aliasMusicname);
|
||||
int newlumpnum = LookupMusic(aliasMusicname, lumpnum >= 0);
|
||||
if (newlumpnum >= 0) lumpnum = newlumpnum;
|
||||
}
|
||||
|
||||
if (lumpnum == -1 && (g_gameType & GAMEFLAG_SW))
|
||||
{
|
||||
// Some Shadow Warrior distributions have the music in a subfolder named 'classic'. Check that, too.
|
||||
|
|
Loading…
Reference in a new issue