X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fmainframe.cpp;h=225a7d5e5fba955486817c08b7dc842f9a0636ed;hb=852882b1cfbbcf418e7b4753ed90c0e911d3f4e1;hp=1d3660f5c7c44060bd22e1c815dc5f80fbabfb2b;hpb=019d4c383607ac3c3eec4d5b7a5832e1c7633ccf;p=xonotic%2Fnetradiant.git diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 1d3660f5..225a7d5e 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -254,11 +254,19 @@ void HomePaths_Realise(){ } #endif -#if GDEF_OS_POSIX +#if (GDEF_OS_POSIX && !GDEF_OS_MACOS) path.clear(); - path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/"; - g_qeglobals.m_userEnginePath = path.c_str(); - break; + path << DirectoryCleaned( g_get_user_data_dir() ) << ( prefix + 1 ) << "/"; + if ( file_exists( path.c_str() ) && file_is_directory( path.c_str() ) ) { + g_qeglobals.m_userEnginePath = path.c_str(); + break; + } + else { + path.clear(); + path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/"; + g_qeglobals.m_userEnginePath = path.c_str(); + break; + } #endif } @@ -437,11 +445,23 @@ void setPakPath( int num, const char* path ){ // App Path CopiedString g_strAppPath; ///< holds the full path of the executable +CopiedString g_strLibPath; +CopiedString g_strDataPath; const char* AppPath_get(){ return g_strAppPath.c_str(); } +const char *LibPath_get() +{ + return g_strLibPath.c_str(); +} + +const char *DataPath_get() +{ + return g_strDataPath.c_str(); +} + /// the path to the local rc-dir const char* LocalRcPath_get( void ){ static CopiedString rc_path; @@ -753,7 +773,7 @@ void Radiant_detachGameToolsPathObserver( ModuleObserver& observer ){ void Radiant_Initialise(){ GlobalModuleServer_Initialise(); - Radiant_loadModulesFromRoot( AppPath_get() ); + Radiant_loadModulesFromRoot( LibPath_get() ); Preferences_Load();