Projects > cpp > Issues > Bug #2492

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Cocos2d-x V3 - Tilemap Image Source Path

Bug #2492 [Rejected]
ricardo 2013-08-06 22:41 . Updated over 11 years ago

Issue reported by Daniel Bartley here: http://www.cocos2d-x.org/boards/6/topics/32713

The issue is with TMXTiledMap in release 3.0alpha0-pre.

The source image used in the tmx file should be relative to the that file, but in this version CCTMXLayer looks in the main resource folder.

The error occurs in the file CCTMXLayer.cpp, TMXLayer::initWithTilesetInfo(TMXTilesetInfo tilesetInfo, TMXLayerInfolayerInfo, TMXMapInfo *mapInfo)

Version 3:

texture = TextureCache::getInstance()->addImage(tilesetInfo->_sourceImage.c_str());

Version 2 (worked properly):

texture = CCTextureCache::sharedTextureCache()->addImage(tilesetInfo->m_sSourceImage.c_str());

m_sSourceImage contained the full path to the image file, where _sourceImage only has the file name.

The code to reproduce the problem is simply:

map = TMXTiledMap::create("tmx/level1.tmx");
this->addChild(map);

Note: The tmx file and image file have to be in a sub-folder to reproduce the error, if you move the tmx and source image into the main resource folder it works.

ricardo 2013-08-06 22:47
  • Project changed from cocos2d-x to cpp
ricardo 2013-08-06 22:47
  • Target version set to 3.0-alpha0
zhangxm 2013-08-22 03:28
  • Assignee set to boyu0
boyu0 2013-08-28 07:57
  • Status changed from New to Closed
  • % Done changed from 0 to 100

This bug is in the version 3.0alpha0-pre, and it fixed at the commit:
https://github.com/dumganhar/cocos2d-x/commit/07d357a858ca54517cf95485c80a81512ae7b9a9

boyu0 2013-08-28 08:09
  • Status changed from Closed to Rejected
  • % Done changed from 100 to 0

Atom PDF

Status:Rejected
Start date:2013-08-06
Priority:Normal
Due date:
Assignee:boyu0
% Done:

0%

Category:all, blackberry
Target version:3.0-alpha0