0.0 0


May be?

  • char **pBuffer = data.getFileData;
  • char**pBuffer = (char*) data.getFileData(xmlFilename, “rb”, &size);


The param “r” or “rb” is finally passed to “fopen”
XML files are raw string data, so we had better don’t use “b” flag which stands for “binary” data.
What’s the trouble you met at parsing XML file?


For example,


TMXIsoZorder::TMXIsoZorder() { CCTMXTiledMap *map = CCTMXTiledMap::tiledMapWithTMXFile("TileMaps/iso-test-zorder.tmx"); //...

iso-test-zorder.tmx read incorrect and “map” not valid.


Which platform you met this problem?
I just tested it on cocos2d-win32 & cocos2d-iphone-cpp, TMXIsoZorder is working correctly.


cocos2d-win32, debug/release, vs2008, windows7


The screenshot is running this unit test on cocos2d-win32 0.7.2, debug, vs2008, winxp sp2. It works corretly on both “r” & “rb”.

So on your situaltion, only “rb” works well and “r” lead to failure?