コード例 #1
0
ファイル: CCActionTiledGrid.cpp プロジェクト: IppClub/Dorothy
CCShakyTiles3D* CCShakyTiles3D::create(float duration, const CCSize& gridSize, int nRange, bool bShakeZ)
{
    CCShakyTiles3D *pAction = new CCShakyTiles3D();

    if (pAction)
    {
        if (pAction->initWithDuration(duration, gridSize, nRange, bShakeZ))
        {
            pAction->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(pAction);
        }
    }

    return pAction;    
}
コード例 #2
0
ファイル: CCActionTiledGrid.cpp プロジェクト: IppClub/Dorothy
CCObject* CCShakyTiles3D::copyWithZone(CCZone *pZone)
{
    CCZone* pNewZone = NULL;
    CCShakyTiles3D* pCopy = NULL;
    if(pZone && pZone->m_pCopyObject) 
    {
        //in case of being called at sub class
        pCopy = (CCShakyTiles3D*)(pZone->m_pCopyObject);
    }
    else
    {
        pCopy = new CCShakyTiles3D();
        pZone = pNewZone = new CCZone(pCopy);
    }
    
    CCTiledGrid3DAction::copyWithZone(pZone);

    pCopy->initWithDuration(m_fDuration, m_sGridSize, m_nRandrange, m_bShakeZ);
    
    CC_SAFE_DELETE(pNewZone);
    return pCopy;
}