Secretchronicles/SMC — pull request #176 by brianvanderburg2 (2014-09-02 21:47:28+00:00)
Title: Feature packages physfs (WIP)

This is the continuation of #139 using the official repository.

This feature uses PhysFS to create a form of a virtual file system. Archives need to be mounted before the VFS can read inside them. Until they are mounted, VFS will see them as a file. Once they are mounted, VFS sees the archive as a directory. Packages are automatically mounted during the scan if needed.

I've tested this on Linux using Debian 7 and everything seems to work fine. It works just like the package manager current does: levels, worlds, and campaigns come from the current package, graphics, sounds, and music use the current package and dependencies (so called resource packages), and scripts can be loaded from a package by specifying the name. I've also already merged the packages anywhere code into this branch.

There is one main problem. It is quite slow. Using normal packages seems to be quite fast, but when this feature is compiled, loading some levels is slow and loading the level editor is slow. Perhaps the VFS object needs to cache certain results such as File_Exist tests and Find results.

I don't believe this breaks any compatibility with the current devel code, but due to the slowness issue, I don't plan on merging this any time soon and would like for others to test it if possible. Also, any ideas on how to solve the slowness issue.