CCShaky3D* CCShaky3D::actionWithRange(int range, bool shakeZ, const ccGridSize& gridSize, ccTime duration) { CCShaky3D *pAction = new CCShaky3D(); if (pAction) { if (pAction->initWithRange(range, shakeZ, gridSize, duration)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCShaky3D* CCShaky3D::create(float duration, const CCSize& gridSize, int range, bool shakeZ) { CCShaky3D *pAction = new CCShaky3D(); if (pAction) { if (pAction->initWithDuration(duration, gridSize, range, shakeZ)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCObject* CCShaky3D::copyWithZone(CCZone *pZone) { CCZone* pNewZone = NULL; CCShaky3D* pCopy = NULL; if(pZone && pZone->m_pCopyObject) { //in case of being called at sub class pCopy = (CCShaky3D*)(pZone->m_pCopyObject); } else { pCopy = new CCShaky3D(); pZone = pNewZone = new CCZone(pCopy); } CCGrid3DAction::copyWithZone(pZone); pCopy->initWithRange(m_nRandrange, m_bShakeZ, m_sGridSize, m_fDuration); CC_SAFE_DELETE(pNewZone); return pCopy; }