Resource Manager
The resource manager is a fundamental part of knowledge, it is used to load every single file for the engine. When you are allocating the resource manager you pass as the argument the path of the file resources.cfg, example:
k::resourceManager* rscMgr = new k::resourceManager("./media/resources.cfg");
When the resource manager instance gets created, every file load in the engine will use the root path as the resources.cfg path.
Resources.cfg File
The resources.cfg file structure is very basic. Like every other script in the engine, keywords are separated by spaces or tabs. The file is separated in sections as following:
group
A group is a resouce manager unit you can refer to automatically load resources on a directory. The Group have the following properties:
root (options are: "the directory path, like ./")
The root directory where the group is going to start looking for resources in relation to the root directory of resources.cfg
recursive (default: "true", options are: "true" | "false")
If the resource manager should look on subdirectories.
loadModels (default: "true, options are: "true" | "false")
If the resource manager should auto-load md3 and md5 models.
loadTextures (default: "true, options are: "true" | "false")
If the resource manager should auto-load textures.
loadScripts (default: "true, options are: "true" | "false")
If the resource manager should auto-load tev scripts.
loadMaterials (default: "true, options are: "true" | "false")
If the resource manager should auto-load materials.
Example Resource File:
group common
{
root ./
recursive false
}
group lightmap
{
root ./lightmap/
recursive true
}
group skies
{
root ./skies/
recursive false
}
group model
{
root ./model/
recursive true
}