CCTMXTiledMap can not load texture file using reletive path, if resource path is changed manually

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`

Hello,

I can confirm this issue also exists on cocos2dx for android - when using the default resources path, it adds additional ‘assets/’ directory to the front of it.

Regards,
km