Armature *Armature::create(const char *name, Bone *parentBone) { Armature *armature = new Armature(); if (armature && armature->init(name, parentBone)) { armature->autorelease(); return armature; } CC_SAFE_DELETE(armature); return NULL; }
Armature *Armature::create() { Armature *armature = new Armature(); if (armature && armature->init()) { armature->autorelease(); return armature; } CC_SAFE_DELETE(armature); return NULL; }
Armature *Armature::create(const std::string& name, Bone *parentBone) { Armature *armature = new Armature(); if (armature && armature->init(name, parentBone)) { armature->autorelease(); return armature; } CC_SAFE_DELETE(armature); return nullptr; }
Armature *Armature::create(const std::string& name) { Armature *armature = new (std::nothrow) Armature(); if (armature && armature->init(name)) { armature->autorelease(); return armature; } CC_SAFE_DELETE(armature); return nullptr; }
void TestPerformance::addArmature(int number) { for (int i = 0; i<number; i++) { armatureCount++; Armature *armature = nullptr; armature = new (std::nothrow) Armature(); armature->init("Cowboy"); armature->getAnimation()->playWithIndex(0); armature->setPosition(50 + armatureCount * 2, 150); armature->setScale(0.1f); addArmatureToParent(armature); armature->release(); } refreshTitle(); }
void TestPerformance::update(float delta) { frames ++; times += delta; if (frames / times > 58) { Armature *armature = NULL; armature = new Armature(); armature->init("Knight_f/Knight"); armature->getAnimation()->playByIndex(0); armature->setPosition(50 + armatureCount * 2, 150); armature->setScale(0.6f); addArmature(armature); armature->release(); char pszCount[255]; sprintf(pszCount, "%s %i", subtitle().c_str(), armatureCount); LabelTTF *label = (LabelTTF *)getChildByTag(10001); label->setString(pszCount); } }