CCWaves* CCWaves::actionWithWaves(int wav, float amp, bool h, bool v, const ccGridSize& gridSize, ccTime duration) { CCWaves *pAction = new CCWaves(); if (pAction) { if (pAction->initWithWaves(wav, amp, h, v, gridSize, duration)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCWaves* CCWaves::create(float duration, const CCSize& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical) { CCWaves *pAction = new CCWaves(); if (pAction) { if (pAction->initWithDuration(duration, gridSize, waves, amplitude, horizontal, vertical)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCObject* CCWaves::copyWithZone(CCZone *pZone) { CCZone* pNewZone = NULL; CCWaves* pCopy = NULL; if(pZone && pZone->m_pCopyObject) { //in case of being called at sub class pCopy = (CCWaves*)(pZone->m_pCopyObject); } else { pCopy = new CCWaves(); pZone = pNewZone = new CCZone(pCopy); } CCGrid3DAction::copyWithZone(pZone); pCopy->initWithWaves(m_nWaves, m_fAmplitude, m_bHorizontal, m_bVertical, m_sGridSize, m_fDuration); CC_SAFE_DELETE(pNewZone); return pCopy; }