diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-12-02 19:39:19 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-12-02 19:39:19 +0100 |
| commit | e953d6fc634ed445332f9fdc47c9c4a6a205ea75 (patch) | |
| tree | 87dd3d8e9903e6e6f6ce73a5dc6a81eff7a05eb5 /project-base/src | |
| parent | fd7c29424979f43bdc0c330f4c6f471c205dc78c (diff) | |
save file writing
Diffstat (limited to 'project-base/src')
| -rw-r--r-- | project-base/src/windows/platform.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/project-base/src/windows/platform.c b/project-base/src/windows/platform.c index 119e08e..6e2c9b9 100644 --- a/project-base/src/windows/platform.c +++ b/project-base/src/windows/platform.c @@ -307,6 +307,19 @@ void platform_create_config_directory(char *directory) } } +char* platform_get_save_location(char *buffer, char *directory) +{ + if(SUCCEEDED(SHGetFolderPathA(0, CSIDL_LOCAL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, buffer))) + { + string_appendn(buffer, "\\", MAX_INPUT_LENGTH); + string_appendn(buffer, directory, MAX_INPUT_LENGTH); + string_appendn(buffer, "\\", MAX_INPUT_LENGTH); + return buffer; + } + + return 0; +} + char* platform_get_config_save_location(char *buffer, char *directory) { if(SUCCEEDED(SHGetFolderPathA(0, CSIDL_LOCAL_APPDATA|CSIDL_FLAG_CREATE, NULL, 0, buffer))) @@ -1298,6 +1311,7 @@ bool platform_write_file_content(char *path, const char *mode, char *buffer, s32 //done: fclose(file); + return true; done_failure: return result; } |
