CCObject* CCActionInterval::copyWithZone(CCZone *pZone) { CCZone* pNewZone = NULL; CCActionInterval* pCopy = NULL; if(pZone && pZone->m_pCopyObject) { //in case of being called at sub class pCopy = (CCActionInterval*)(pZone->m_pCopyObject); } else { // action's base class , must be called using __super::copyWithZone(), after overriding from derived class CCAssert(0, ""); pCopy = new CCActionInterval(); pZone = pNewZone = new CCZone(pCopy); } CCFiniteTimeAction::copyWithZone(pZone); CC_SAFE_DELETE(pNewZone); pCopy->initWithDuration(m_fDuration); return pCopy; }
CCActionInterval* CCActionInterval::create(float d){ CCActionInterval *pAction = new CCActionInterval(); pAction->initWithDuration(d); // pAction->autorelease(); return pAction; }
// // IntervalAction // CCActionInterval* CCActionInterval::actionWithDuration(ccTime d) { CCActionInterval *pAction = new CCActionInterval(); pAction->initWithDuration(d); pAction->autorelease(); return pAction; }