Menu

v 0.891 File System and virtualization

With the new functionality in v 0.891, a file containing a virtual file system (or a virtual directory if you will) can be created, for example with the following code:

GkFileSystem::CreateVirtualFileSystem(L"..\\GameData\\", L"..\\GameData.dat");

Assuming the example project of the release, this line creates a file "GameData.dat", which contains all the contents of the folder "..\GameData\", including subfolders. This file can then be used as a virtual file system's source with:

GkFileSystem::SetSource(L"..\\GameData.dat", FileSystemMode_Virtual);

After setting it as a source, the game will use its contents to load its resources. And because the file system in the file has exactly the same structure as the physical directory, the game should smoothly load and run with no further changes needed.

Note that now, the example game project has the following line in its MainWindow's constructor, in order to set the file system:

GkFileSystem::SetSource(L"..\\GameData\\", FileSystemMode_Physical);

An encryption of the virtual file system source file is planned. I just have to find the time.

Posted by Ivan 2014-04-29

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.