MCPcopy Create free account
hub / github.com/axmolengine/axmol / draw

Method draw

core/2d/SpriteBatchNode.cpp:419–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419void 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
440void SpriteBatchNode::increaseAtlasCapacity()
441{

Callers

nothing calls this directly

Calls 7

getTotalQuadsMethod · 0.80
getQuadsMethod · 0.80
updateTransformMethod · 0.45
setUniformMethod · 0.45
initMethod · 0.45
getTextureMethod · 0.45
addCommandMethod · 0.45

Tested by

no test coverage detected