Forum > C++ > Port iphone game to android in C++

Port iphone game to android in C++

By zohaib Posted 2011-07-04 04:35 Comments 29
mots_g
  • Posts: 1

#26 RE: 2011-07-18 08:17

Hi All
I came across this post when I found the that CCSAXParser take a lot of time to load .plist files. Glad to know a solution exists! Thanks everyone for it (I’m yet to integrate it).

However, I have a suggestion to make. I’ve read that TinyXML is sometimes quite buggy and has memory leaks in it as pointed out here: http://stackoverflow.com/questions/170686/best-open-xml-parser-for-c

Also, they state that PugiXML/RapidXML are much faster than TinyXML.
So why not port the new CCSAXParser using some other parser, maybe PugiXML or RapidXML?

Please note that I’ve not used TinyXML on my own but had just come across the post and hence felt like making the suggestion.

Regards,
Mots

Eyesiah
  • Posts: 61

#27 RE: 2011-07-18 08:56

I ran the bog-standard windows CRT leak detector over my app after finishing it, in the win32 port, and there were no leaks detected in tinyxml (or elsewhere, I’m pleased to report). The main reason i chose tinyxml was that I had familiarity with it, and it compiled and worked on the android without needing adjusting at all. But of course, there may well be better solutions :)

feiting_schatt
  • Posts: 11

#28 RE: 2012-05-07 18:03

RapidXML is no good since Android C++ doesn’t allow hpp file and try/catch blocks, both of which are RapidXML. But yes, it is very fast.

Edit: We fixed the android issue, just call ParseDeep instead of Parse, and use the CCFileData type to grab a buffer to the file’s contents instead from the file. Then, you don’t have to deal with compression, send the buffer into Parse Deep, and pass in 0 as the next parameter

feiting_schatt
  • Posts: 11

#29 RE: 2012-05-07 20:35

Ignore this… hit post instead of edit earlier

Copyright © 2010 - 2013 Cocos2d-x.orgClustrmaps