Irrlicht have a great VFS subsystem but there is a long-standing problem with IFileSystem::createFileList: it is completely ignoring added zip/pak files so there is no way to enumerate them, which is useful sometimes. I suggest a small patch (well not patch really... but there is not much changes anyway) to address this problem. It is not ideal (but do the work) but can be used as a base for future changes.
So here it is.
PART 1/3. Changes in include/*.h files:
IFileSystem.h
Code: Select all
// WAS: virtual IFileList* createFileList() const = 0;
virtual IFileList* createFileList(bool vfsList = false) const = 0;
NOTE: we can`t use old createFileList declaration without new parameter, since createFileList on real file system enumerates top directories only but vfs enumerate all dirs and files at once. There is a problem - createFileList used recursely (by jumping into every directory in it) can cause infinte loop for vfs file list mixed with old file list, so there is a parameter to distinct this cases
IFileSystem.h
Code: Select all
// new method
// it can be used for many purposes in fact, with this method we can create custom file lists for internal usage, etc
virtual bool addFile(const c8* filePath, bool isDir) = 0;