override visit don't call visit on it's children
| 170 | // override visit |
| 171 | // don't call visit on it's children |
| 172 | void SpriteBatchNode::visit(Renderer* renderer, const Mat4& parentTransform, uint32_t parentFlags) |
| 173 | { |
| 174 | AX_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); |
| 175 | |
| 176 | // CAREFUL: |
| 177 | // This visit is almost identical to CocosNode#visit |
| 178 | // with the exception that it doesn't call visit on it's children |
| 179 | // |
| 180 | // The alternative is to have a void Sprite#visit, but |
| 181 | // although this is less maintainable, is faster |
| 182 | // |
| 183 | if (!_visible) |
| 184 | { |
| 185 | return; |
| 186 | } |
| 187 | |
| 188 | sortAllChildren(); |
| 189 | |
| 190 | uint32_t flags = processParentFlags(parentTransform, parentFlags); |
| 191 | |
| 192 | if (isVisitableByVisitingCamera()) |
| 193 | { |
| 194 | // IMPORTANT: |
| 195 | // To ease the migration to v3.0, we still support the Mat4 stack, |
| 196 | // but it is deprecated and your code should not rely on it |
| 197 | _director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); |
| 198 | _director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform); |
| 199 | |
| 200 | draw(renderer, _modelViewTransform, flags); |
| 201 | |
| 202 | _director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); |
| 203 | // FIX ME: Why need to set _orderOfArrival to 0?? |
| 204 | // Please refer to https://github.com/cocos2d/cocos2d-x/pull/6920 |
| 205 | // setOrderOfArrival(0); |
| 206 | |
| 207 | AX_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, "CCSpriteBatchNode - visit"); |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | void SpriteBatchNode::addChild(Node* child, int zOrder, int tag) |
| 212 | { |
nothing calls this directly
no test coverage detected