TMX Tile Cracks in the Test App

TMX Tile Cracks in the Test App
0.0 0



I’m running the Test app on an android device (LG Optimus V) and I’m seeing cracks develop between tiles in the “TMX Iso object test” after the GL Context is lost and then recreated. I’m seeing the same issue with my own cocos2dx app using TMX.

I do not see cracks develop on the iOS simulator.
I’m using the GLES20 branch from Github (commit# 498a208 dated Jun 26, 2012)

Steps to reproduce:

  1. Run the Test app and navigate to the “TileMapTest”.

  2. Navigate to the “TMX Iso object test”.

  3. Adjust the screen as shown in the following image:

  4. Press the “Home” button on the android device to force the GL context to be lost.

  5. Run the Test app again. The displayed image will show cracks between the tiles as shown in the following image:


pre.png (26.5 KB)


Thank you.
#1377 is created for it.

Now i have not idea about this issue.
If you have any idea please help us.
Thank you.


Here is what I’ve found:

When a TMXLayer is initially created, CCTMXLayer::setupTiles() is called and executes m_pobTextureAtlas->getTexture()->setAliasTexParameters();
However, when the GL Context is lost and is recreated it appears that the texture (referenced by m_pobTextureAtlas->getTexture() is not recreated with AliasTexParameters. The cracks between the tiles occur because the tiles are being drawn Antialiased instead of Aliased.

I have confirmed that if I manually call CCTMXLayer::getTextureAtlas()->getTexture()->setAliasTexParameters() after a GL context switch then cracks between TMX Tiles no longer appear on Android.

I also updated issue #1377


Thank you Ed.