mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 23:04:36 +01:00
add saving of screenshots in subfolder
This commit is contained in:
@@ -440,13 +440,34 @@ char* osinterface_get_orct2_homefolder()
|
||||
|
||||
path[0] = '\0';
|
||||
|
||||
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, 0, path))) { // find home folder
|
||||
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL | CSIDL_FLAG_CREATE, NULL, 0, path)))
|
||||
strcat(path, "\\OpenRCT2");
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
char *osinterface_get_orct2_homesubfolder(const char *subFolder)
|
||||
{
|
||||
char *path = osinterface_get_orct2_homefolder();
|
||||
strcat(path, "\\");
|
||||
strcat(path, subFolder);
|
||||
return path;
|
||||
}
|
||||
|
||||
int osinterface_directory_exists(const char *path)
|
||||
{
|
||||
DWORD dwAttrib = GetFileAttributes(path);
|
||||
return dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_DIRECTORY);
|
||||
}
|
||||
|
||||
int osinterface_ensure_directory_exists(const char *path)
|
||||
{
|
||||
if (osinterface_directory_exists(path))
|
||||
return 1;
|
||||
|
||||
return CreateDirectory(path, NULL);
|
||||
}
|
||||
|
||||
char osinterface_get_path_separator()
|
||||
{
|
||||
return '\\';
|
||||
|
||||
Reference in New Issue
Block a user