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); } } }
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(); } } }