Tried out the new irrlicht version, and found a problem.
here is the code:
Code: Select all
char path[256];
sprintf(path,"data\\npc\\%i.foo",temp.modelID);
if (!device->getFileSystem()->addFileArchive(path, true, false, EFAT_ZIP))
printf("Phail on loading zip archive of npc!\n");
// do something with it
if (!dev->getFileSystem()->removeFileArchive(dev->getFileSystem()->getAbsolutePath(path)))
{
for (int i = 0; i < dev->getFileSystem()->getFileArchiveCount(); i++)
{
printf("%s\n", dev->getFileSystem()->getFileArchive(i)->getFileList()->getPath().c_str());
}
printf("Didn't found archive: %s\n", dev->getFileSystem()->getAbsolutePath(path).c_str());
}
Code: Select all
c:/Documents and Settings/Honya/Dokumentumok/Visual Studio 2008/Projects/FooServer/FooClient/data/npc/1.foo
Didn!t found archive: c:\Documents and Settings\Honya\Dokumentumok\Visual Studio 2008\Projects\FooServer\FooClient\data\npc\1.foo
looks like the getAbsolutePath use \ and the fileArchive use /
after looking into the code, found another possible bug:
Code: Select all
for (i = 0; i < FileArchives.size(); ++i)
{
if (filename == FileArchives[i]->getFileList()->getPath())
return true;
}
and, it would be good, if it wouldnt return bool, but the index of the loaded archive, and -1 if couldnt load. because on removeFileArchive you can use the index, but from where do you know it!?
yes we can walkaround if we get the count of the fileArchives, coz it uses push_back, but what if found same archive? you wont get the right index.