I'm using IFileSystem::addFolderFileArchive() in my code to add a folder that contains all my media. Then I use the standard ways to access mesh files and textures. That worked pretty well until a few days ago, when there were some changes in Irrlicht-SVN (I'm using trunk) to the file system classes. Then it stopped working.
The first thing I did was change to IFileSystem::addFileArchive("media/",true,true,EFAT_FOLDER), which I understand is now the recommended way. That did not fix my problem.
I've created a simple test application from 01.HelloWorld example by adding "../../media" as a folder archive and removing the path to the sydney mesh. It fails to load too. Also the addFileArchive("../../media/") call returns false, which I understand means it failed.
Here is the patch against the latest svn trunk to the HelloWorld example:
Code: Select all
Index: examples/01.HelloWorld/main.cpp
===================================================================
--- examples/01.HelloWorld/main.cpp (revision 2450)
+++ examples/01.HelloWorld/main.cpp (working copy)
@@ -144,6 +144,7 @@
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
+ IFileSystem* fs = device->getFileSystem();
/*
We add a hello world label to the window, using the GUI environment.
@@ -165,7 +166,8 @@
other supported file format. By the way, that cool Quake 2 model
called sydney was modelled by Brian Collins.
*/
- IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
+ printf("Adding ../../media: %d\n",fs->addFileArchive("../../media/",true,true,EFAT_FOLDER));
+ IAnimatedMesh* mesh = smgr->getMesh("sydney.md2");
if (!mesh)
{
device->drop();