Browse Source

Mac updates for #1276

Josh Engebretson 9 years ago
parent
commit
e84c883bb2

+ 10 - 5
Source/AtomicApp/AppBase.cpp

@@ -62,11 +62,6 @@ namespace Atomic
             arguments_ = GetArguments();
         }
         
-        // Seed the default Settings path
-        FileSystem* fileSystem = GetSubsystem<FileSystem>();
-        String settingspath = fileSystem->GetProgramDir() + "Settings/";
-        AddEngineConfigSearchPath(settingspath);
-
     }
 
     AppBase::~AppBase()
@@ -154,6 +149,16 @@ namespace Atomic
     {
         FileSystem* fileSystem = GetSubsystem<FileSystem>();
 
+        // if we haven't defined any search paths, insert default
+        if (!engineConfigSearchPaths_.Size())
+        {
+#ifdef ATOMIC_PLATFORM_OSX
+        AddEngineConfigSearchPath(fileSystem->GetProgramDir() + "../Resources/Settings/");
+#else
+        AddEngineConfigSearchPath(fileSystem->GetProgramDir() + "Settings/");
+#endif
+        }
+
         for (unsigned i = 0; i < engineConfigSearchPaths_.Size(); i++)
         {
             const String& path = engineConfigSearchPaths_[i];

+ 5 - 0
Source/AtomicNET/NETNative/NETAtomicPlayer.cpp

@@ -119,7 +119,12 @@ namespace Atomic
     void NETAtomicPlayer::ReadEngineConfig()
     {
         FileSystem* fileSystem = GetSubsystem<FileSystem>();
+
+#ifdef ATOMIC_PLATFORM_OSX
+        String filename = fileSystem->GetProgramDir() + "../Resources/Settings/Engine.json";
+#else
         String filename = fileSystem->GetProgramDir() + "Settings/Engine.json";
+#endif
 
         if (!fileSystem->FileExists(filename))
             return;

+ 5 - 0
Source/AtomicPlayer/Application/AtomicPlayer.cpp

@@ -227,7 +227,12 @@ void AtomicPlayerApp::HandleJSError(StringHash eventType, VariantMap& eventData)
 void AtomicPlayerApp::ReadEngineConfig()
 {
     FileSystem* fileSystem = GetSubsystem<FileSystem>();
+
+#ifdef ATOMIC_PLATFORM_OSX
+    String filename = fileSystem->GetProgramDir() + "../Resources/Settings/Engine.json";
+#else
     String filename = fileSystem->GetProgramDir() + "Settings/Engine.json";
+#endif
 
     if (!fileSystem->FileExists(filename))
         return;

+ 3 - 1
Source/ToolCore/Build/BuildMac.cpp

@@ -125,6 +125,8 @@ void BuildMac::Build(const String& buildPath)
         return;
     if (!BuildCreateDirectory(buildPath_ + "/Contents/Resources"))
         return;
+    if (!BuildCreateDirectory(buildPath_ + "/Contents/Resources/Settings"))
+        return;
 
     String resourcePackagePath = buildPath_ + "/Contents/Resources/AtomicResources" + PAK_EXTENSION;
     GenerateResourcePackage(resourcePackagePath);
@@ -146,7 +148,7 @@ void BuildMac::Build(const String& buildPath)
     if (fileSystem->FileExists(engineJSON))
     {
 
-        if (!BuildCopyFile(engineJSON, buildPath_ + "/Contents/MacOS/Settings/Engine.json"))
+        if (!BuildCopyFile(engineJSON, buildPath_ + "/Contents/Resources/Settings/Engine.json"))
             return;
 
     }