diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index 4a17497f..d0190b1c 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -198,6 +198,20 @@ void FILESYSTEM_mount(const char *fname) } } +void FILESYSTEM_loadZip(const char* filename) +{ + PHYSFS_File* zip = PHYSFS_openRead(filename); + + if (!PHYSFS_mountHandle(zip, filename, "levels", 1)) + { + printf( + "Could not mount %s: %s\n", + filename, + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) + ); + } +} + bool FILESYSTEM_assetsmounted = false; void FILESYSTEM_mountassets(const char* path) diff --git a/desktop_version/src/FileSystemUtils.h b/desktop_version/src/FileSystemUtils.h index ff306641..ffb641a0 100644 --- a/desktop_version/src/FileSystemUtils.h +++ b/desktop_version/src/FileSystemUtils.h @@ -13,6 +13,7 @@ char *FILESYSTEM_getUserSaveDirectory(void); char *FILESYSTEM_getUserLevelDirectory(void); void FILESYSTEM_mount(const char *fname); +void FILESYSTEM_loadZip(const char* filename); extern bool FILESYSTEM_assetsmounted; void FILESYSTEM_mountassets(const char *path); void FILESYSTEM_unmountassets(void); diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 772f9e30..7ee8e81f 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -4,7 +4,6 @@ #include "editor.h" #include -#include #include #include #include @@ -82,16 +81,7 @@ static void levelZipCallback(const char* filename) { if (endsWith(filename, ".zip")) { - PHYSFS_File* zip = PHYSFS_openRead(filename); - - if (!PHYSFS_mountHandle(zip, filename, "levels", 1)) - { - printf( - "Could not mount %s: %s\n", - filename, - PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode()) - ); - } + FILESYSTEM_loadZip(filename); } }