mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 00:04:43 +01:00
Title Sequence editor
This commit is contained in:
@@ -90,6 +90,7 @@ int platform_directory_exists(const char *path);
|
||||
int platform_original_game_data_exists(const char *path);
|
||||
time_t platform_file_get_modified_time(char* path);
|
||||
int platform_ensure_directory_exists(const char *path);
|
||||
int platform_directory_delete(const char *path);
|
||||
int platform_lock_single_instance();
|
||||
int platform_enumerate_files_begin(const char *pattern);
|
||||
int platform_enumerate_files_next(int handle, file_info *outFileInfo);
|
||||
|
||||
@@ -116,6 +116,28 @@ int platform_ensure_directory_exists(const char *path)
|
||||
return CreateDirectory(path, NULL);
|
||||
}
|
||||
|
||||
int platform_directory_delete(const char *path)
|
||||
{
|
||||
char pszFrom[MAX_PATH];
|
||||
strcpy(pszFrom, path);
|
||||
// Needs to be double-null terminated for some weird reason
|
||||
pszFrom[strlen(path) + 1] = 0;
|
||||
|
||||
SHFILEOPSTRUCTA fileop;
|
||||
fileop.hwnd = NULL; // no status display
|
||||
fileop.wFunc = FO_DELETE; // delete operation
|
||||
fileop.pFrom = pszFrom; // source file name as double null terminated string
|
||||
fileop.pTo = NULL; // no destination needed
|
||||
fileop.fFlags = FOF_NOCONFIRMATION|FOF_SILENT; // do not prompt the user
|
||||
|
||||
fileop.fAnyOperationsAborted = FALSE;
|
||||
fileop.lpszProgressTitle = NULL;
|
||||
fileop.hNameMappings = NULL;
|
||||
|
||||
int ret = SHFileOperationA(&fileop);
|
||||
return (ret == 0);
|
||||
}
|
||||
|
||||
int platform_lock_single_instance()
|
||||
{
|
||||
HANDLE mutex, status;
|
||||
|
||||
Reference in New Issue
Block a user