AtlasNode * AtlasNode::create(const std::string& tile, int tileWidth, int tileHeight, int itemsToRender) { AtlasNode * ret = new (std::nothrow) AtlasNode(); if (ret->initWithTileFile(tile, tileWidth, tileHeight, itemsToRender)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
AtlasNode * AtlasNode::create(const char *tile, unsigned int tileWidth, unsigned int tileHeight, unsigned int itemsToRender) { AtlasNode * pRet = new AtlasNode(); if (pRet->initWithTileFile(tile, tileWidth, tileHeight, itemsToRender)) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }