stringw gameMain::getString(int id)
{
// Note: This function must be called after initializing
// IrrlichtDevice *g_device or else an
// 'access violation' error will occur.
stringw text;
g_device->getFileSystem()->addZipFileArchive("data.zip");
IrrXMLReader* xml = createIrrXMLReader("data.zip/language/english.xml");
if (xml == 0)
return L"Error";
while (xml->read())
{
switch (xml->getNodeType())
{
case EXN_TEXT:
if (strcmp("string", xml->getNodeName()) &&
xml->getAttributeValueAsInt("id") == id)
{
if (xml->getNodeData())
text = xml->getNodeData();
else
text = L"Empty String";
}
break;
}
}
delete xml;
return text;
}
This function I have made for my project works if I do not try to read the xml from a zip archive, but when I do it just doesn't seem to work it just ends up calling the xml == 0 IF statement that I have in that function.
So is there any way to get this working?
Last edited by ericaus on Wed Oct 07, 2009 7:54 am, edited 2 times in total.
Brainsaw wrote:Did you add the archive to the filesystem with the "addZipFileArchive" method? If so check the parameters, I got some headache from that.
yeah, I placed addZipFileArchive before calling IrrXMLReader* xml although the xml doesn't want to load from the archive file.
Strangely I can get other things like loadGUI and getFont, and getTexture to load from the zip archive.
edit::
Oh, I think I might of figured it out, lol. Instead of doing,