コード例 #1
0
CCWavesTiles3D* CCWavesTiles3D::actionWithWaves(int wav, float amp, const ccGridSize& gridSize, ccTime duration)
{
    CCWavesTiles3D *pAction = new CCWavesTiles3D();

    if (pAction)
    {
        if (pAction->initWithWaves(wav, amp, gridSize, duration))
        {
            pAction->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(pAction);
        }
    }

    return pAction;
}
コード例 #2
0
CCObject* CCWavesTiles3D::copyWithZone(CCZone *pZone)
{
    CCZone* pNewZone = NULL;
    CCWavesTiles3D* pCopy = NULL;
    if(pZone && pZone->m_pCopyObject)
    {
        pCopy = (CCWavesTiles3D*)(pZone->m_pCopyObject);
    }
    else
    {
        pCopy = new CCWavesTiles3D();
        pZone = pNewZone = new CCZone(pCopy);
    }

    CCTiledGrid3DAction::copyWithZone(pZone);

    pCopy->initWithWaves(m_nWaves, m_fAmplitude, m_sGridSize, m_fDuration);

    CC_SAFE_DELETE(pNewZone);
    return pCopy;
}