mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-11 09:38:44 +08:00
Fixed texture atlas capacity expansion.
This commit is contained in:
parent
9f198b4998
commit
5bab2830a9
@ -132,7 +132,7 @@ void _Cocos2dRegionAttachment_draw (Attachment* attachment, Slot* slot) {
|
||||
|
||||
// Cocos2d doesn't handle batching for us, so we'll just force a single texture per skeleton.
|
||||
skeleton->node->textureAtlas = self->textureAtlas;
|
||||
if (self->textureAtlas.capacity <= skeleton->node->quadCount) {
|
||||
while (self->textureAtlas.capacity <= skeleton->node->quadCount) {
|
||||
if (![self->textureAtlas resizeCapacity:self->textureAtlas.capacity * 2]) return;
|
||||
}
|
||||
[self->textureAtlas updateQuad:quad atIndex:skeleton->node->quadCount++];
|
||||
|
||||
@ -293,7 +293,7 @@ void _Cocos2dxRegionAttachment_draw (Attachment* attachment, Slot* slot) {
|
||||
|
||||
// cocos2dx doesn't handle batching for us, so we'll just force a single texture per skeleton.
|
||||
skeleton->node->textureAtlas = self->textureAtlas;
|
||||
if (self->textureAtlas->getCapacity() <= skeleton->node->quadCount) {
|
||||
while (self->textureAtlas->getCapacity() <= skeleton->node->quadCount) {
|
||||
if (!self->textureAtlas->resizeCapacity(self->textureAtlas->getCapacity() * 2)) return;
|
||||
}
|
||||
self->textureAtlas->updateQuad(quad, skeleton->node->quadCount++);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user