| 417 | } |
| 418 | |
| 419 | void SpriteBatchNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) |
| 420 | { |
| 421 | // Optimization: Fast Dispatch |
| 422 | if (_textureAtlas->getTotalQuads() == 0) |
| 423 | { |
| 424 | return; |
| 425 | } |
| 426 | |
| 427 | for (const auto& child : _children) |
| 428 | { |
| 429 | child->updateTransform(); |
| 430 | } |
| 431 | |
| 432 | const auto& matrixProjection = _director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); |
| 433 | auto programState = _quadCommand.getPipelineDescriptor().programState; |
| 434 | programState->setUniform(_mvpMatrixLocaiton, matrixProjection.m, sizeof(matrixProjection.m)); |
| 435 | _quadCommand.init(_globalZOrder, _textureAtlas->getTexture(), _blendFunc, _textureAtlas->getQuads(), |
| 436 | _textureAtlas->getTotalQuads(), transform, flags); |
| 437 | renderer->addCommand(&_quadCommand); |
| 438 | } |
| 439 | |
| 440 | void SpriteBatchNode::increaseAtlasCapacity() |
| 441 | { |
nothing calls this directly
no test coverage detected