| 734 | } |
| 735 | |
| 736 | void SpriteBatchNode::updateQuadFromSprite(Sprite* sprite, ssize_t index) |
| 737 | { |
| 738 | AXASSERT(sprite != nullptr, "Argument must be non-nil"); |
| 739 | AXASSERT(dynamic_cast<Sprite*>(sprite) != nullptr, "CCSpriteBatchNode only supports Sprites as children"); |
| 740 | |
| 741 | // make needed room |
| 742 | while (index >= _textureAtlas->getCapacity() || _textureAtlas->getCapacity() == _textureAtlas->getTotalQuads()) |
| 743 | { |
| 744 | this->increaseAtlasCapacity(); |
| 745 | } |
| 746 | |
| 747 | // |
| 748 | // update the quad directly. Don't add the sprite to the scene graph |
| 749 | // |
| 750 | sprite->setBatchNode(this); |
| 751 | sprite->setAtlasIndex(static_cast<unsigned int>(index)); |
| 752 | |
| 753 | sprite->setDirty(true); |
| 754 | |
| 755 | // UpdateTransform updates the textureAtlas quad |
| 756 | sprite->updateTransform(); |
| 757 | } |
| 758 | |
| 759 | SpriteBatchNode* SpriteBatchNode::addSpriteWithoutQuad(Sprite* child, int z, int aTag) |
| 760 | { |
nothing calls this directly
no test coverage detected