TMXMapInfo * TMXMapInfo::createWithXML(const std::string& tmxString, const std::string& resourcePath) { TMXMapInfo *ret = new (std::nothrow) TMXMapInfo(); if (ret->initWithXML(tmxString, resourcePath)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
TMXMapInfo * TMXMapInfo::create(const std::string& tmxFile) { TMXMapInfo *ret = new (std::nothrow) TMXMapInfo(); if (ret->initWithTMXFile(tmxFile)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }