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

Method updateQuadFromSprite

core/2d/SpriteBatchNode.cpp:736–757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734}
735
736void 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
759SpriteBatchNode* SpriteBatchNode::addSpriteWithoutQuad(Sprite* child, int z, int aTag)
760{

Callers

nothing calls this directly

Calls 6

increaseAtlasCapacityMethod · 0.95
getTotalQuadsMethod · 0.80
setDirtyMethod · 0.80
getCapacityMethod · 0.45
setBatchNodeMethod · 0.45
updateTransformMethod · 0.45

Tested by

no test coverage detected