I’m not sure if I’m the only one seeing this bug but when I tried to load a TMX file I had this issue. my file structure is as shown below:
application
(directory)resource
—>tilemaptexture.png>(directory)levels
—
—>—>00.TMX
obviously I’m trying to load “00.TMX” using relative path. also in “00.TMX” I have “” which means also relative path. so I used `CCFileUtils::setResourcePath(“Resource”);` to change default resource location. now I can easily load “levels00.tmx”.
the problem is when CCTMXTiledMap tries to open texture, I got this error : “unable to load texture ’resource\resource\levels.png” after looking in the code I’ve found out it seems to be a problem with this version (cocos2d-1.0.1-x-0.12.0). in code when parsing TMX file data, you call
tileset~~>m_sSourceImage = CCFileUtils::fullPathFromRelativeFile, pTMXMapInfo~~>getTMXFileName());
which results in adding “resource” before “levels.png”. later to load that texture again you call
texture = CCTextureCache::sharedTextureCache()->addImage(tilesetInfo->m_sSourceImage.c_str());
which also adds “resource” before filename. I guess you have to change `fullPathFromReletiveFile` to something like `relativePathFromRelativeFile`