From c27bbaaecc565b8ff222945ce5571a70bbc08cb6 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 26 Feb 2021 18:02:58 -0800 Subject: [PATCH] Fix up log messages in FILESYSTEM_mountassets() The info message when a .data.zip file is mounted is now differentiated from the message when an actual directory is mounted (the .data.zip message specifies ".data.zip"). The error message for an error occurring when loading or mounting a .zip is now capitalized. The "Custom asset directory does not exist" now uses puts(), because there's no need to use printf() here. --- desktop_version/src/FileSystemUtils.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 2a2668d5..f9169b40 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -200,7 +200,7 @@ void FILESYSTEM_mountassets(const char* path) } if (cstr && FILESYSTEM_directoryExists(zippath.c_str())) { - printf("Custom asset directory exists at %s\n", zippath.c_str()); + printf("Custom asset directory is .data.zip at %s\n", zippath.c_str()); FILESYSTEM_mount(zippath.c_str()); graphics.reloadresources(); FILESYSTEM_assetsmounted = true; @@ -209,9 +209,15 @@ void FILESYSTEM_mountassets(const char* path) PHYSFS_File* zip = PHYSFS_openRead(zip_path.c_str()); zip_path += ".data.zip"; if (zip == NULL) { - printf("error loading .zip: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + printf( + "Error loading .zip: %s\n", + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); } else if (PHYSFS_mountHandle(zip, zip_path.c_str(), "/", 0) == 0) { - printf("error mounting .zip: %s\n", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + printf( + "Error mounting .zip: %s\n", + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); } else { graphics.assetdir = zip_path; } @@ -223,7 +229,7 @@ void FILESYSTEM_mountassets(const char* path) graphics.reloadresources(); FILESYSTEM_assetsmounted = true; } else { - printf("Custom asset directory does not exist\n"); + puts("Custom asset directory does not exist"); FILESYSTEM_assetsmounted = false; } }