Fixed texture atlas capacity expansion.

This commit is contained in:
NathanSweet 2013-04-08 04:26:09 +02:00
parent 9f198b4998
commit 5bab2830a9
2 changed files with 2 additions and 2 deletions

View File

@ -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++];

View File

@ -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++);