| 628 | } |
| 629 | |
| 630 | void ProgressTimer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags) |
| 631 | { |
| 632 | if (_vertexData.empty() || !_sprite) |
| 633 | return; |
| 634 | |
| 635 | const ax::Mat4& projectionMat = _director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); |
| 636 | Mat4 finalMat = projectionMat * transform; |
| 637 | _programState->setUniform(_locMVP1, finalMat.m, sizeof(finalMat.m)); |
| 638 | _programState->setTexture(_locTex1, 0, _sprite->getTexture()->getBackendTexture()); |
| 639 | |
| 640 | if (_type == Type::BAR) |
| 641 | { |
| 642 | if (!_reverseDirection) |
| 643 | { |
| 644 | _customCommand.init(_globalZOrder, _sprite->getBlendFunc()); |
| 645 | renderer->addCommand(&_customCommand); |
| 646 | } |
| 647 | else |
| 648 | { |
| 649 | _customCommand.init(_globalZOrder, _sprite->getBlendFunc()); |
| 650 | renderer->addCommand(&_customCommand); |
| 651 | |
| 652 | _customCommand2.init(_globalZOrder, _sprite->getBlendFunc()); |
| 653 | _programState2->setUniform(_locMVP2, finalMat.m, sizeof(finalMat.m)); |
| 654 | _programState2->setTexture(_locTex2, 0, _sprite->getTexture()->getBackendTexture()); |
| 655 | renderer->addCommand(&_customCommand2); |
| 656 | } |
| 657 | } |
| 658 | else |
| 659 | { |
| 660 | _customCommand.init(_globalZOrder, _sprite->getBlendFunc()); |
| 661 | renderer->addCommand(&_customCommand); |
| 662 | } |
| 663 | } |
| 664 | |
| 665 | } |
nothing calls this directly
no test coverage detected