Example #1
0
void BatchNode::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
{
    if (_children.empty())
    {
        return;
    }

//    CC_NODE_DRAW_SETUP();

    bool pushed = false;
    for(auto object : _children)
    {
        Armature *armature = dynamic_cast<Armature *>(object);
        if (armature)
        {
            if (!pushed)
            {
                generateGroupCommand();
                pushed = true;
            }
        
            armature->visit(renderer, transform, flags);
        }
        else
        {
            renderer->popGroup();
            pushed = false;
            
            ((Node *)object)->visit(renderer, transform, flags);
        }
    }
}
Example #2
0
void BatchNode::draw()
{
    if (_children.empty())
    {
        return;
    }

    CC_NODE_DRAW_SETUP();

    bool pushed = false;
    for(auto object : _children)
    {
        Armature *armature = dynamic_cast<Armature *>(object);
        if (armature)
        {
            if (!pushed)
            {
                generateGroupCommand();
                pushed = true;
            }
        
            armature->visit();
        }
        else
        {
            Director::getInstance()->getRenderer()->popGroup();
            pushed = false;
            
            ((Node *)object)->visit();
        }
    }
}