Horde3D
http://horde3d.org/forums/

Porting GameEngine to RapidXML
http://horde3d.org/forums/viewtopic.php?f=6&t=1248
Page 1 of 1

Author:  MistaED [ 14.09.2010, 08:09 ]
Post subject:  Porting GameEngine to RapidXML

Hi all,

I thought it might be a good time to move the GameEngine to use the rapidXML lib instead because Horde3D now uses it and I'm worried about conflicts and I like consistency. So far I'm doing this process, but I am stuck trying to find a replacement for this guy:
Code:
XMLSTR createXMLString(int nFormat=1, int *pnSize=NULL) const;

It is used to extract single GameEntity nodes from scene files. I think I need to read up more on how templates work looking at rapidxml.h & rapidxml_print.h. The other parts have been an easy enough transition using utXML.h it's just that one which I'm stuck on. I'm guessing some function implementation in the XMLNode class needs to be made?

Thanks!

Author:  Felix [ 15.09.2010, 13:02 ]
Post subject:  Re: Porting GameEngine to RapidXML

Hi MistaED,

don't know if i understood your question right.
I can explain the function:
Code:
XMLSTR createXMLString(int nFormat=1, int *pnSize=NULL) const;
It simply creates a string which contains the xml structure of the current node and all of its children.

The only place where it is currently used is in GameEngineCore\GameEngine.cpp(147). where the children of the Extra node of the *.scn file is converted to a string to call createGameEntity(const char* xmlString).
But as this function at first parses the string to an xml node again, it would be cleaner to implement an overloaded function createGameEntity(const XMLNode&) where you can pass the node directly.
By that you won't actually need to reimplement the createXMLString() function, but I also think such a function could be useful anyway. Doesn't rapid xml provide something like that?

Author:  MistaED [ 15.09.2010, 13:26 ]
Post subject:  Re: Porting GameEngine to RapidXML

Hi Felix,

Yeah I found something in rapidxml_print.h and noticed Horde3D does what I'm looking for so I hope it solves that. I'm very close now to having the game engine run on linux/my phone... :)

Thanks for the reply

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/