CCShatteredTiles3D* CCShatteredTiles3D::create(float duration, const CCSize& gridSize, int nRange, bool bShatterZ) { CCShatteredTiles3D *pAction = new CCShatteredTiles3D(); if (pAction) { if (pAction->initWithDuration(duration, gridSize, nRange, bShatterZ)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCShatteredTiles3D* CCShatteredTiles3D::actionWithRange(int nRange, bool bShatterZ, const ccGridSize& gridSize, ccTime duration) { CCShatteredTiles3D *pAction = new CCShatteredTiles3D(); if (pAction) { if (pAction->initWithRange(nRange, bShatterZ, gridSize, duration)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCObject* CCShatteredTiles3D::copyWithZone(CCZone *pZone) { CCZone* pNewZone = NULL; CCShatteredTiles3D* pCopy = NULL; if(pZone && pZone->m_pCopyObject) { pCopy = (CCShatteredTiles3D*)(pZone->m_pCopyObject); } else { pCopy = new CCShatteredTiles3D(); pZone = pNewZone = new CCZone(pCopy); } //copy super class's member CCTiledGrid3DAction::copyWithZone(pZone); pCopy->initWithDuration(m_fDuration, m_sGridSize, m_nRandrange, m_bShatterZ); CC_SAFE_DELETE(pNewZone); return pCopy; }