- fixed bad search path setup on macOS

This cannot include „Raze“ in the app_support path strings because some of these parts point to elsewhere. The two places where it is needed must be explicit.
This commit is contained in:
Christoph Oelckers 2022-04-19 14:02:51 +02:00
parent c4bfee070e
commit 6354c1889d
2 changed files with 10 additions and 9 deletions

View file

@ -71,17 +71,17 @@ void M_GetMacSearchDirectories(FString& user_docs, FString& user_app_support, FS
? "~/" GAME_DIR ? "~/" GAME_DIR
: (path + "/" GAME_DIR); : (path + "/" GAME_DIR);
#define LIBRARY_APPSUPPORT "/Library/Application Support/" #define LIBRARY_APPSUPPORT "/Library/Application Support"
path = M_GetMacAppSupportPath(); path = M_GetMacAppSupportPath();
user_app_support = path.IsEmpty() user_app_support = path.IsEmpty()
? "~" LIBRARY_APPSUPPORT GAME_DIR ? "~" LIBRARY_APPSUPPORT
: (path + "/" GAME_DIR); : (path);
path = GetSpecialPath(NSApplicationSupportDirectory, YES, NSLocalDomainMask); path = GetSpecialPath(NSApplicationSupportDirectory, YES, NSLocalDomainMask);
local_app_support = path.IsEmpty() local_app_support = path.IsEmpty()
? LIBRARY_APPSUPPORT GAME_DIR ? LIBRARY_APPSUPPORT
: (path + "/" GAME_DIR); : (path);
#undef LIBRARY_APPSUPPORT #undef LIBRARY_APPSUPPORT
} }

View file

@ -83,6 +83,7 @@ FGameConfigFile::FGameConfigFile ()
SetValueForKey ("Path", user_app_support + "/EDuke32", true); SetValueForKey ("Path", user_app_support + "/EDuke32", true);
SetValueForKey ("Path", user_app_support + "/JFDuke32", true); SetValueForKey ("Path", user_app_support + "/JFDuke32", true);
SetValueForKey ("Path", user_app_support + "/NBlood", true); SetValueForKey ("Path", user_app_support + "/NBlood", true);
SetValueForKey("Path", user_app_support + "/Raze/*", true);
SetValueForKey ("Path", "$PROGDIR", true); SetValueForKey ("Path", "$PROGDIR", true);
SetValueForKey ("Path", "$PROGDIR/*", true); SetValueForKey ("Path", "$PROGDIR/*", true);
SetValueForKey ("Path", local_app_support + "/EDuke32", true); SetValueForKey ("Path", local_app_support + "/EDuke32", true);
@ -125,9 +126,9 @@ FGameConfigFile::FGameConfigFile ()
SetSection ("FileSearch.Directories", true); SetSection ("FileSearch.Directories", true);
#ifdef __APPLE__ #ifdef __APPLE__
SetValueForKey ("Path", user_docs, true); SetValueForKey ("Path", user_docs, true);
SetValueForKey ("Path", user_app_support, true); SetValueForKey ("Path", user_app_support + "/" GAME_DIR, true);
SetValueForKey ("Path", "$PROGDIR", true); SetValueForKey ("Path", "$PROGDIR", true);
SetValueForKey ("Path", local_app_support, true); SetValueForKey ("Path", local_app_support + "/" GAME_DIR, true);
#elif !defined(__unix__) #elif !defined(__unix__)
SetValueForKey ("Path", "$PROGDIR", true); SetValueForKey ("Path", "$PROGDIR", true);
SetValueForKey ("Path", "$GAMEDIR", true); SetValueForKey ("Path", "$GAMEDIR", true);
@ -149,9 +150,9 @@ FGameConfigFile::FGameConfigFile ()
SetSection("SoundfontSearch.Directories", true); SetSection("SoundfontSearch.Directories", true);
#ifdef __APPLE__ #ifdef __APPLE__
SetValueForKey("Path", user_docs + "/soundfonts", true); SetValueForKey("Path", user_docs + "/soundfonts", true);
SetValueForKey("Path", user_app_support + "/soundfonts", true); SetValueForKey("Path", user_app_support + "/" GAME_DIR "/soundfonts", true);
SetValueForKey("Path", "$PROGDIR/soundfonts", true); SetValueForKey("Path", "$PROGDIR/soundfonts", true);
SetValueForKey("Path", local_app_support + "/soundfonts", true); SetValueForKey("Path", local_app_support + "/" GAME_DIR "/soundfonts", true);
#elif !defined(__unix__) #elif !defined(__unix__)
SetValueForKey("Path", "$PROGDIR/soundfonts", true); SetValueForKey("Path", "$PROGDIR/soundfonts", true);
#else #else