]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/mainframe.cpp
untested changes so DP might work with this again. Who knows if they even compile.
[xonotic/netradiant.git] / radiant / mainframe.cpp
index 31f4635cd6f9315c7ec42f3b7d75df6af0f031ba..4b580bc310059de753833dd17b84475a3bcb7669 100644 (file)
@@ -189,7 +189,22 @@ void VFS_Destroy()
 #endif
 void HomePaths_Realise()
 {
-#if defined(POSIX)
+#if defined(__APPLE__)
+  const char* prefix = g_pGameDescription->getKeyValue("prefix");
+  if(!string_empty(prefix))
+  {
+    StringOutputStream path(256);
+    path << DirectoryCleaned(g_get_home_dir()) << "Library/Application Support" << (prefix+1) << "/";
+    if(!file_is_directory(path.c_str()))
+    {
+      path.clear();
+      path << DirectoryCleaned(g_get_home_dir()) << prefix << "/";
+    }
+    g_qeglobals.m_userEnginePath = path.c_str();
+    Q_mkdir(g_qeglobals.m_userEnginePath.c_str());
+  }
+  else
+#elif defined(POSIX)
   const char* prefix = g_pGameDescription->getKeyValue("prefix");
   if(!string_empty(prefix))
   {
@@ -207,7 +222,7 @@ void HomePaths_Realise()
     TCHAR mydocsdir[MAX_PATH + 1];
     if(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir))
     {
-      path << DirectoryCleaned(mydocsdir) << "My Games/" << prefix << "/";
+      path << DirectoryCleaned(mydocsdir) << "My Games/" << (prefix+1) << "/";
       // win32: only add it if it already exists
       if(file_is_directory(path.c_str()))
         g_qeglobals.m_userEnginePath = path.c_str();