If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
charl3s7
Posts: 11 Joined: Sat Oct 03, 2009 3:17 am
Post
by charl3s7 » Mon Oct 05, 2009 1:32 am
Code:
Code: Select all
while(xml && xml->read())
{
if(!strcmp("mainwindow",xml->getNodeName())){
messageText = xml->getAttributeValue("title");
fullscreen = xml->getAttributeValueAsInt("fullscreen");
}
if(!strcmp("mdl",xml->getNodeName())){
std::string map = xml->getAttributeValue("src");
IMeshSceneNode* mesh = smgr->addMeshSceneNode(smgr->getMesh(mp));
}
}
config.xml
Code: Select all
<?xml version="1.0"?>
<config>
<mdl src="map/main.x"/>
<mainwindow title="Game Test" fullscreen=1></mainwindow>
</config>
What I'm trying to do is load "src" from the mdl tag and make an object with it. But I don't know how to convert the xml->getAttributeValue("src"); to c8. Help?
//Charles
Eigen
Competition winner
Posts: 375 Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:
Post
by Eigen » Mon Oct 05, 2009 5:20 am
You could do:
Code: Select all
if(!strcmp("mdl",xml->getNodeName())){
stringc modelfile = stringc( xml->getAttributeValue("src") );
IMeshSceneNode* mesh = smgr->addMeshSceneNode(smgr->getMesh(modelfile.c_str()));
}