GAFAsset* GAFAsset::create(const std::string& gafFilePath, GAFTextureLoadDelegate_t delegate, GAFLoader* customLoader /*= nullptr*/) { GAFAsset * ret = new GAFAsset(); if (ret && ret->initWithGAFFile(gafFilePath, delegate, customLoader)) { ret->autorelease(); return ret; } CC_SAFE_RELEASE(ret); return nullptr; }
GAFAsset * GAFAsset::create(const std::string& jsonPath) { GAFAsset *pRet = new GAFAsset(); if (pRet && pRet->initWithImageData(jsonPath.c_str())) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }
GAFAsset* GAFAsset::createWithBundle(const std::string& zipfilePath, const std::string& entryFile, GAFTextureLoadDelegate_t delegate /*= NULL*/) { GAFAsset * ret = new GAFAsset(); if (ret && ret->initWithGAFBundle(zipfilePath, entryFile, delegate)) { ret->autorelease(); return ret; } CC_SAFE_RELEASE(ret); return nullptr; }