Quintus/SMC — pull request #106 by brianvanderburg2 (2014-06-26 18:45:21+00:00)
Title: Basic packages implementatin WIP

I'm currently messing around with a very simple packages implementation that is a major work in progress/planning status. Currently I have the following implemented.

A cPackage_Manager class along side cResource_Manager. The idea is that cPackage_Manager would be used for things that could be from packages while cResource_Manager is for things that are global/not from packages, such as GUI elements, etc.

The package manager works by implementing a search path. Any package can (in the future) define other packages that it uses, and a search path is built from that package all the way up to the core data when setting the active active package.

Currently, methods are provided for asking where something is. For reading, this searches the search path until it finds something that exists. For writing, this is always the user directory of the current package, or core.

The only thing that currently uses this is level loading. If a change is made to package_manager.cpp to force set the package during construction, then when a level is loaded, it will use the paths to that package first, then the core if that does not exist.

Right now this is entirely file/directory based. In the future, I could imaging replacing the Get_...._Path methods with Open_..._Path methods. Such a method would determine if the package is a directory or archive, and return a base stream that can read regardless of if the package is a directory or an archive file, perhaps using something like PhysicFS. However, this would require any used libraries to support loading from some input stream and not just a file name. SDL_image, SDL_mixer, libxml++, and so on.