The xml document named default.xml is:
IE parses it fine and doesnt return any errors.<?xml version="1.0"?>
<map numObjects="0" addWater="1">
<heightmap>./data/maps/HM-257.jpg</heightmap>
<texturemap>./data/textures/maps/HM-257.bmp</texturemap>
<detailmap>./data/textures/env/detailmap.jpg</detailmap>
</map>
The in-game reading is done using:
I know IrrReader is initialized and the file is found because the irrReader != 0.cout<<"Filename to be opened by loadMap: "<<fileName<<endl;
IXMLReaderUTF8* irrReader = irrDevice->getFileSystem()->createXMLReaderUTF8(fileName);
if(irrReader == 0)
cout<<"File couldnt be opened for reading...xml"<<endl;
string<c8> heightMap;
string<c8> textureMap;
string<c8> detailMap;
int numObjects;
int addWater;
while(irrReader && irrReader->read()){
switch(irrReader->getNodeType()){
case EXN_TEXT:
if(!strcmp("heightmap", irrReader->getNodeName())) //!strcmp is the same as strcmp == 0
heightMap = irrReader->getNodeData();
if(!strcmp("texturemap", irrReader->getNodeName()))
textureMap = irrReader->getNodeData();
if(!strcmp("detailmap", irrReader->getNodeName()))
detailMap = irrReader->getNodeData();
break;
case EXN_ELEMENT:
if(!strcmp("map", irrReader->getNodeName())){
numObjects = irrReader->getAttributeValueAsInt("numObjects");
addWater = irrReader->getAttributeValueAsInt("addWater");
}
break;
}
}
cout<<"Weee: "<<heightMap.c_str()<<endl;
delete irrReader;
For some reason nothing is read into the variables heightMap, textureMap, nor any of the others. Is there is a reason for this?