From 452ef3b5113274474dc08094fec6e289fd0c4e9f Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 26 Feb 2021 18:10:09 -0800 Subject: [PATCH] Rename FILESYSTEM_directoryExists() to FILESYSTEM_exists() The function is literally just an alias for PHYSFS_exists(), which does not exclusively check for directories. Plus, the function is also used to check if a non-directory file exists. Why is this function named "directoryExists"?! --- desktop_version/src/FileSystemUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 2ae0f06c..62f03be3 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -164,7 +164,7 @@ char *FILESYSTEM_getUserLevelDirectory(void) return levelDir; } -static bool FILESYSTEM_directoryExists(const char *fname) +static bool FILESYSTEM_exists(const char *fname) { return PHYSFS_exists(fname); } @@ -199,7 +199,7 @@ void FILESYSTEM_mountassets(const char* path) zip_path = cstr; } - if (cstr && FILESYSTEM_directoryExists(zippath.c_str())) { + if (cstr && FILESYSTEM_exists(zippath.c_str())) { printf("Custom asset directory is .data.zip at %s\n", zippath.c_str()); FILESYSTEM_mount(zippath.c_str()); graphics.reloadresources(); @@ -223,7 +223,7 @@ void FILESYSTEM_mountassets(const char* path) } FILESYSTEM_assetsmounted = true; graphics.reloadresources(); - } else if (FILESYSTEM_directoryExists(dirpath.c_str())) { + } else if (FILESYSTEM_exists(dirpath.c_str())) { printf("Custom asset directory exists at %s\n",dirpath.c_str()); FILESYSTEM_mount(dirpath.c_str()); graphics.reloadresources();