Skip to content

Commit

Permalink
- fixed bad search path setup on macOS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
coelckers committed Apr 19, 2022
1 parent c4bfee0 commit 6354c18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions source/common/platform/posix/osx/i_specialpaths.mm
Expand Up @@ -71,17 +71,17 @@ void M_GetMacSearchDirectories(FString& user_docs, FString& user_app_support, FS
? "~/" GAME_DIR
: (path + "/" GAME_DIR);

#define LIBRARY_APPSUPPORT "/Library/Application Support/"
#define LIBRARY_APPSUPPORT "/Library/Application Support"

path = M_GetMacAppSupportPath();
user_app_support = path.IsEmpty()
? "~" LIBRARY_APPSUPPORT GAME_DIR
: (path + "/" GAME_DIR);
? "~" LIBRARY_APPSUPPORT
: (path);

path = GetSpecialPath(NSApplicationSupportDirectory, YES, NSLocalDomainMask);
local_app_support = path.IsEmpty()
? LIBRARY_APPSUPPORT GAME_DIR
: (path + "/" GAME_DIR);
? LIBRARY_APPSUPPORT
: (path);

#undef LIBRARY_APPSUPPORT
}
Expand Down
9 changes: 5 additions & 4 deletions source/core/gameconfigfile.cpp
Expand Up @@ -83,6 +83,7 @@ FGameConfigFile::FGameConfigFile ()
SetValueForKey ("Path", user_app_support + "/EDuke32", true);
SetValueForKey ("Path", user_app_support + "/JFDuke32", 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", local_app_support + "/EDuke32", true);
Expand Down Expand Up @@ -125,9 +126,9 @@ FGameConfigFile::FGameConfigFile ()
SetSection ("FileSearch.Directories", true);
#ifdef __APPLE__
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", local_app_support, true);
SetValueForKey ("Path", local_app_support + "/" GAME_DIR, true);
#elif !defined(__unix__)
SetValueForKey ("Path", "$PROGDIR", true);
SetValueForKey ("Path", "$GAMEDIR", true);
Expand All @@ -149,9 +150,9 @@ FGameConfigFile::FGameConfigFile ()
SetSection("SoundfontSearch.Directories", true);
#ifdef __APPLE__
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", local_app_support + "/soundfonts", true);
SetValueForKey("Path", local_app_support + "/" GAME_DIR "/soundfonts", true);
#elif !defined(__unix__)
SetValueForKey("Path", "$PROGDIR/soundfonts", true);
#else
Expand Down

0 comments on commit 6354c18

Please sign in to comment.