diff --git a/src/m_specialpaths.cpp b/src/m_specialpaths.cpp index 1f17f90c2..b4fcba3c3 100644 --- a/src/m_specialpaths.cpp +++ b/src/m_specialpaths.cpp @@ -12,9 +12,16 @@ #include "cmdlib.h" #include "m_misc.h" -#if defined(_WIN32) +#if !defined(__APPLE__) && !defined(_WIN32) +#include +#include +#include "i_system.h" +#endif #include "version.h" // for GAMENAME + +#if defined(_WIN32) + typedef HRESULT (WINAPI *GKFP)(REFKNOWNFOLDERID, DWORD, HANDLE, PWSTR *); //=========================================================================== @@ -195,7 +202,7 @@ FString M_GetConfigPath(bool for_reading) // Construct a user-specific config name if (UseKnownFolders() && GetKnownFolder(CSIDL_APPDATA, FOLDERID_RoamingAppData, true, path)) { - path << '/' << GAME_DIR; + path += "/" GAME_DIR; CreatePath(path); path += "/zdoom.ini"; } @@ -534,7 +541,7 @@ FString M_GetCachePath(bool create) FString path = NicePath("~/.config/zdoom/cache"); if (create) { - CreatePath(create); + CreatePath(path); } return path; } @@ -564,16 +571,16 @@ FString M_GetCajunPath(const char *botfilename) { FString path; - // Check first in ~/.config/zdoom./botfilename. - path = GetUserFile(BOTFILENAME); - if (!FileExists(tmp)) + // Check first in ~/.config/zdoom/botfilename. + path = GetUserFile(botfilename); + if (!FileExists(path)) { - // Then check in SHARE_DIR/botfilename. (Some allowance for Macs - // should probably be made here.) - path = SHARE_DIR BOTFILENAME; + // Then check in SHARE_DIR/botfilename. + path = SHARE_DIR; + path << botfilename; if (!FileExists(path)) { - path =""; + path = ""; } } return path; @@ -604,7 +611,7 @@ FString M_GetConfigPath(bool for_reading) FString M_GetScreenshotsPath() { - return "~/" GAME_DIR "/screenshots/"; + return NicePath("~/" GAME_DIR "/screenshots/"); } //=========================================================================== @@ -617,7 +624,7 @@ FString M_GetScreenshotsPath() FString M_GetSavegamesPath() { - return = "~/" GAME_DIR; + return NicePath("~/" GAME_DIR); } #endif diff --git a/src/version.h b/src/version.h index b0717fbf8..66e2f8938 100644 --- a/src/version.h +++ b/src/version.h @@ -91,12 +91,10 @@ const char *GetVersionString(); #define FORUM_URL "http://forum.zdoom.org" #define BUGS_FORUM_URL "http://forum.zdoom.org/index.php?c=3" -#ifdef __unix__ -#define GAME_DIR ".config/zdoom" -#elif defined(__APPLE__) +#if defined(__APPLE__) || defined(_WIN32) #define GAME_DIR GAMENAME #else -#define GAME_DIR "zdoom" +#define GAME_DIR ".config/zdoom" #endif