I think there are something missed in CCTMXXMLParser

I try to build map by using tiled map editor.
but I shoud have to see error message (“TMX: unsupported compression method”)

Tiled map editor default map setting was Base64/Zlib
but i didn’t know about that.

so… I wasted about 1hour…… OTL

there are two way to fix it.

change layer data as Base64/GZip (edit~~>preferences)
or change the code.
I compared original cocos2d source with cocos2d-x
I found some missed code.

CCTMXXMLParser.h
enum {
TMXLayerAttribNone = 1 << 0,
TMXLayerAttribBase64 = 1 << 1,
TMXLayerAttribGzip = 1 << 2,
TMXLayerAttribZlib = 1 << 4, // !
};

CCTMXXMLParser.cpp
line 386

if
{
int layerAttribs = pTMXMapInfo~~>getLayerAttribs();
pTMXMapInfo~~>setLayerAttribs;
pTMXMapInfo~~>setStoringCharacters(true);

if( compression “gzip” )
{
layerAttribs = pTMXMapInfo->getLayerAttribs();
pTMXMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribGzip);
}

            else if( compression  “zlib”) // 

{
layerAttribs = pTMXMapInfo~~>getLayerAttribs;
pTMXMapInfo~~>setLayerAttribs(layerAttribs | TMXLayerAttribZlib);
}
CCAssert( compression “” || compression “gzip” || compression == “zlib”, “TMX: unsupported compression method” );

Thank you.
After changing the codes, did you resolve it?

oops……
It doesn’t work well.

I think use base64/gzip is better.

Bug #659 created.