EaseIn* EaseIn::create(ActionInterval *action, float rate)
{
    EaseIn *easeIn = new (std::nothrow) EaseIn();
    if (easeIn && easeIn->initWithAction(action, rate))
    {
        easeIn->autorelease();
        return easeIn;
    }

    delete easeIn;
    return nullptr;
}
Beispiel #2
0
EaseIn* EaseIn::create(ActionInterval *action, float rate)
{
    EaseIn *easeIn = new (std::nothrow) EaseIn();
    if (easeIn)
    {
        if (easeIn->initWithAction(action, rate))
        {
            easeIn->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(easeIn);
        }
    }

    return easeIn;
}
EaseIn* EaseIn::create(ActionInterval *pAction, float fRate)
{
    EaseIn *pRet = new EaseIn();
    if (pRet)
    {
        if (pRet->initWithAction(pAction, fRate))
        {
            pRet->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(pRet);
        }
    }

    return pRet;
}
Object* EaseIn::copyWithZone(Zone *pZone)
{
    Zone* pNewZone = NULL;
    EaseIn* pCopy = NULL;
    if(pZone && pZone->_copyObject) 
    {
        //in case of being called at sub class
        pCopy = (EaseIn*)(pZone->_copyObject);
    }
    else
    {
        pCopy = new EaseIn();
        pNewZone = new Zone(pCopy);
    }

    pCopy->initWithAction((ActionInterval*)(_inner->copy()->autorelease()), _rate);

    CC_SAFE_DELETE(pNewZone);
    return pCopy;
}