From 13aa866ef306da3ff96c5fb6772e7997f1afb758 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sat, 5 Jun 2021 14:30:03 +0200 Subject: [PATCH] Get rid of the prefix game definition and path nonsense --- radiant/main.cpp | 3 +- radiant/mainframe.cpp | 67 +---------------------------------- radiant/qe3.cpp | 14 -------- resources/games/platform.game | 1 - 4 files changed, 3 insertions(+), 82 deletions(-) diff --git a/radiant/main.cpp b/radiant/main.cpp index 1820a10..1265468 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -332,7 +332,8 @@ void streams_init() void paths_init() { - g_strSettingsPath = environment_get_home_path(); + //g_strSettingsPath = environment_get_home_path(); + g_strSettingsPath = environment_get_app_path(); Q_mkdir(g_strSettingsPath.c_str()); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 77c1a52..ae8e6a1 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -204,72 +204,7 @@ static qSHGetKnownFolderPath_t *qSHGetKnownFolderPath; void HomePaths_Realise() { - do { - const char *prefix = g_pGameDescription->getKeyValue("prefix"); - if (!string_empty(prefix)) { - StringOutputStream path(256); - -#if GDEF_OS_MACOS - path.clear(); - path << DirectoryCleaned( g_get_home_dir() ) << "Library/Application Support" << ( prefix + 1 ) << "/"; - if ( file_is_directory( path.c_str() ) ) { - g_qeglobals.m_userEnginePath = path.c_str(); - break; - } - path.clear(); - path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/"; -#endif - -#if GDEF_OS_WINDOWS - TCHAR mydocsdir[MAX_PATH + 1]; - wchar_t *mydocsdirw; - HMODULE shfolder = LoadLibrary( "shfolder.dll" ); - if ( shfolder ) { - qSHGetKnownFolderPath = (qSHGetKnownFolderPath_t *) GetProcAddress( shfolder, "SHGetKnownFolderPath" ); - } - else{ - qSHGetKnownFolderPath = NULL; - } - CoInitializeEx( NULL, COINIT_APARTMENTTHREADED ); - if ( qSHGetKnownFolderPath && qSHGetKnownFolderPath( qFOLDERID_SavedGames, qKF_FLAG_CREATE | qKF_FLAG_NO_ALIAS, NULL, &mydocsdirw ) == S_OK ) { - memset( mydocsdir, 0, sizeof( mydocsdir ) ); - wcstombs( mydocsdir, mydocsdirw, sizeof( mydocsdir ) - 1 ); - CoTaskMemFree( mydocsdirw ); - path.clear(); - path << DirectoryCleaned( mydocsdir ) << ( prefix + 1 ) << "/"; - if ( file_is_directory( path.c_str() ) ) { - g_qeglobals.m_userEnginePath = path.c_str(); - CoUninitialize(); - FreeLibrary( shfolder ); - break; - } - } - CoUninitialize(); - if ( shfolder ) { - FreeLibrary( shfolder ); - } - if ( SHGetFolderPath( NULL, CSIDL_PERSONAL, NULL, 0, mydocsdir ) ) { - path.clear(); - 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(); - break; - } - } -#endif - -#if GDEF_OS_POSIX - path.clear(); - path << DirectoryCleaned(g_get_home_dir()) << prefix << "/"; - g_qeglobals.m_userEnginePath = path.c_str(); - break; -#endif - } - - g_qeglobals.m_userEnginePath = EnginePath_get(); - } while (0); - + g_qeglobals.m_userEnginePath = EnginePath_get(); Q_mkdir(g_qeglobals.m_userEnginePath.c_str()); { diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 93cad88..a7eccbd 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -86,13 +86,6 @@ void QE_InitVFS() // if we have a mod dir if (!string_equal(gamename, basegame)) { - // ~/./ - if (userRoot && !g_disableHomePath) { - StringOutputStream userGamePath(256); - userGamePath << userRoot << gamename << '/'; - GlobalFileSystem().initDirectory(userGamePath.c_str()); - } - // / if (!g_disableEnginePath) { StringOutputStream globalGamePath(256); @@ -101,13 +94,6 @@ void QE_InitVFS() } } - // ~/./ - if (userRoot && !g_disableHomePath) { - StringOutputStream userBasePath(256); - userBasePath << userRoot << basegame << '/'; - GlobalFileSystem().initDirectory(userBasePath.c_str()); - } - // / if (!g_disableEnginePath) { StringOutputStream globalBasePath(256); diff --git a/resources/games/platform.game b/resources/games/platform.game index 21f8712..d625dcb 100644 --- a/resources/games/platform.game +++ b/resources/games/platform.game @@ -9,7 +9,6 @@ engine_win32="nuclide.bat" engine_linux="nuclide" engine_macos="Nuclide.app" - prefix=".tw" basegame="platform" basegamename="Nuclide" unknowngamename="Game dir"