void CCActionManager::removeAllActionsFromTarget(CAObject *pTarget)
{
    // explicit null handling
    if (pTarget == NULL)
    {
        return;
    }

    tHashElement *pElement = NULL;
    HASH_FIND_INT(m_pTargets, &pTarget, pElement);
    if (pElement)
    {
        if (ccArrayContainsObject(pElement->actions, pElement->currentAction) && (! pElement->currentActionSalvaged))
        {
            pElement->currentAction->retain();
            pElement->currentActionSalvaged = true;
        }

        ccArrayRemoveAllObjects(pElement->actions);
        if (m_pCurrentTarget == pElement)
        {
            m_bCurrentTargetSalvaged = true;
        }
        else
        {
            deleteHashElement(pElement);
        }
    }
    else
    {
//        CCLOG("CrossApp: removeAllActionsFromTarget: Target not found");
    }
}
 void CCParallaxScrollNode::removeAllChildrenWithCleanup(bool cleanup)
 {
     ccArrayRemoveAllObjects(scrollOffsets);
     if (batch) {
         batch->removeAllChildrenWithCleanup(cleanup);
     }
 }
void ActionManager::removeAllActionsFromTarget(Node *target)
{
    // explicit null handling
    if (target == nullptr)
    {
        return;
    }

    tHashElement *element = nullptr;
    HASH_FIND_PTR(_targets, &target, element);
    if (element)
    {
        if (ccArrayContainsObject(element->actions, element->currentAction) && (! element->currentActionSalvaged))
        {
            element->currentAction->retain();
            element->currentActionSalvaged = true;
        }

        ccArrayRemoveAllObjects(element->actions);
        if (_currentTarget == element)
        {
            _currentTargetSalvaged = true;
        }
        else
        {
            deleteHashElement(element);
        }
    }
}
void ActionManager::removeAllActionsFromTarget(Object *target)
{
    // explicit null handling
    if (target == NULL)
    {
        return;
    }

    tHashElement *element = NULL;
    HASH_FIND_PTR(m_pTargets, &target, element);
    if (element)
    {
        if (ccArrayContainsObject(element->actions, element->currentAction) && (! element->currentActionSalvaged))
        {
            element->currentAction->retain();
            element->currentActionSalvaged = true;
        }

        ccArrayRemoveAllObjects(element->actions);
        if (m_pCurrentTarget == element)
        {
            m_bCurrentTargetSalvaged = true;
        }
        else
        {
            deleteHashElement(element);
        }
    }
    else
    {
//        CCLOG("cocos2d: removeAllActionsFromTarget: Target not found");
    }
}
Beispiel #5
0
// 释放方法
void ccArrayFree(ccArray*& arr)
{
    if( arr == NULL ) 
    {
        return;
    }
	ccArrayRemoveAllObjects(arr);
	
	free(arr->arr);
	free(arr);

    arr = NULL;
}
Beispiel #6
0
/** Frees array after removing all remaining objects. Silently ignores nullptr arr. */
void ccArrayFree(ccArray*& arr)
{
    if( arr == nullptr ) 
    {
        return;
    }
	ccArrayRemoveAllObjects(arr);
	
	free(arr->arr);
	free(arr);

    arr = nullptr;
}
void ParallaxNode::removeAllChildrenWithCleanup(bool cleanup)
{
    ccArrayRemoveAllObjects(_parallaxArray);
    Node::removeAllChildrenWithCleanup(cleanup);
}
Beispiel #8
0
void CCArray::removeAllObjects()
{
    ccArrayRemoveAllObjects(data);
}