DeccelAmplitude* DeccelAmplitude::create(Action *action, float duration)
{
    DeccelAmplitude *ret = new (std::nothrow) DeccelAmplitude();
    if (ret && ret->initWithAction(action, duration))
    {
        ret->autorelease();
        return ret;
    }

    delete ret;
    return nullptr;
}
Example #2
0
DeccelAmplitude* DeccelAmplitude::create(Action *action, float duration)
{
    DeccelAmplitude *ret = new (std::nothrow) DeccelAmplitude();
    if (ret)
    {
        if (ret->initWithAction(action, duration))
        {
            ret->autorelease();
        }
        else
        {
            CC_SAFE_DELETE(ret);
        }
    }

    return ret;
}