TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile) { TMXTiledMap *ret = new (std::nothrow) TMXTiledMap(); if (ret->initWithTMXFile(tmxFile)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile, bool isHalf) { TMXTiledMap *ret = new TMXTiledMap(); if (ret->initWithTMXFile(tmxFile, isHalf)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
NS_CC_BEGIN // implementation TMXTiledMap TMXTiledMap * TMXTiledMap::create(const std::string& tmxFile) { TMXTiledMap *ret = new TMXTiledMap(); if (ret->initWithTMXFile(tmxFile)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }