- added M_GetDocumentsPath function.

This commit is contained in:
Christoph Oelckers 2017-12-03 21:03:44 +01:00
commit a945418ba6
4 changed files with 73 additions and 0 deletions

View file

@ -215,3 +215,24 @@ FString M_GetSavegamesPath()
return path;
}
//===========================================================================
//
// M_GetDocumentsPath Unix
//
// Returns the path to the default documents directory.
//
//===========================================================================
FString M_GetDocumentsPath()
{
FString path;
char cpath[PATH_MAX];
FSRef folder;
if (noErr == FSFindFolder(kUserDomain, kDocumentsFolderType, kCreateFolder, &folder) &&
noErr == FSRefMakePath(&folder, (UInt8*)cpath, PATH_MAX))
{
path << cpath << "/" GAME_DIR "/";
}
return path;
}

View file

@ -218,3 +218,16 @@ FString M_GetSavegamesPath()
{
return NicePath("~/" GAME_DIR);
}
//===========================================================================
//
// M_GetDocumentsPath Unix
//
// Returns the path to the default documents directory.
//
//===========================================================================
FString M_GetDocumentsPath()
{
return NicePath("~/" GAME_DIR);
}