mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 05:21:02 +00:00
- added a separate section for soundfont search paths.
This commit is contained in:
parent
2ac101fa51
commit
67a6ec01e1
3 changed files with 31 additions and 4 deletions
|
@ -157,6 +157,26 @@ FGameConfigFile::FGameConfigFile ()
|
|||
SetValueForKey ("Path", "$DOOMWADDIR", true);
|
||||
}
|
||||
|
||||
// Set default search paths if none present
|
||||
if (!SetSection("SoundfontSearch.Directories"))
|
||||
{
|
||||
SetSection("SoundfontSearch.Directories", true);
|
||||
#ifdef __APPLE__
|
||||
SetValueForKey("Path", user_docs + "/soundfonts", true);
|
||||
SetValueForKey("Path", user_app_support + "/soundfonts", true);
|
||||
SetValueForKey("Path", "$PROGDIR/soundfonts", true);
|
||||
SetValueForKey("Path", local_app_support + "/soundfonts", true);
|
||||
#elif !defined(__unix__)
|
||||
SetValueForKey("Path", "$PROGDIR/soundfonts", true);
|
||||
#else
|
||||
SetValueForKey("Path", "$HOME/" GAME_DIR "/soundfonts", true);
|
||||
SetValueForKey("Path", "/usr/local/share/doom/soundfonts", true);
|
||||
SetValueForKey("Path", "/usr/local/share/games/doom/soundfonts", true);
|
||||
SetValueForKey("Path", "/usr/share/doom/soundfonts", true);
|
||||
SetValueForKey("Path", "/usr/share/games/doom/soundfonts", true);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Add some self-documentation.
|
||||
SetSectionNote("IWADSearch.Directories",
|
||||
"# These are the directories to automatically search for IWADs.\n"
|
||||
|
@ -165,6 +185,9 @@ FGameConfigFile::FGameConfigFile ()
|
|||
"# These are the directories to search for wads added with the -file\n"
|
||||
"# command line parameter, if they cannot be found with the path\n"
|
||||
"# as-is. Layout is the same as for IWADSearch.Directories\n");
|
||||
SetSectionNote("SoundfontSearch.Directories",
|
||||
"# These are the directories to search for soundfonts that let listed in the menu.\n"
|
||||
"# Layout is the same as for IWADSearch.Directories\n");
|
||||
}
|
||||
|
||||
FGameConfigFile::~FGameConfigFile ()
|
||||
|
@ -234,6 +257,7 @@ void FGameConfigFile::DoAutoloadSetup (FIWadManager *iwad_man)
|
|||
CreateStandardAutoExec("Doom.AutoExec", true);
|
||||
|
||||
// Move search paths back to the top.
|
||||
MoveSectionToStart("SoundfontSearch.Directories");
|
||||
MoveSectionToStart("FileSearch.Directories");
|
||||
MoveSectionToStart("IWADSearch.Directories");
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@ void FSoundFontManager::CollectSoundfonts()
|
|||
void *file;
|
||||
|
||||
|
||||
if (GameConfig != NULL && GameConfig->SetSection ("FileSearch.Directories"))
|
||||
if (GameConfig != NULL && GameConfig->SetSection ("SoundfontSearch.Directories"))
|
||||
{
|
||||
const char *key;
|
||||
const char *value;
|
||||
|
@ -352,18 +352,18 @@ void FSoundFontManager::CollectSoundfonts()
|
|||
FString dir;
|
||||
|
||||
dir = NicePath(value);
|
||||
FixPathSeperator(dir);
|
||||
if (dir.IsNotEmpty())
|
||||
{
|
||||
if (dir.Back() != '/') dir += '/';
|
||||
FString path = dir + "soundfonts/";
|
||||
FString mask = path + '*';
|
||||
FString mask = dir + '*';
|
||||
if ((file = I_FindFirst(mask, &c_file)) != ((void *)(-1)))
|
||||
{
|
||||
do
|
||||
{
|
||||
if (!(I_FindAttr(&c_file) & FA_DIREC))
|
||||
{
|
||||
FStringf name("%s%s", path.GetChars(), I_FindName(&c_file));
|
||||
FStringf name("%s%s", dir.GetChars(), I_FindName(&c_file));
|
||||
ProcessOneFile(name);
|
||||
}
|
||||
} while (I_FindNext(file, &c_file) == 0);
|
||||
|
|
|
@ -86,4 +86,7 @@ void EnterCriticalSection(FInternalCriticalSection *c)
|
|||
void LeaveCriticalSection(FInternalCriticalSection *c)
|
||||
{
|
||||
c->Leave();
|
||||
|
||||
MemoryBarrier();
|
||||
MemoryFence();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue