Эх сурвалжийг харах

Fixed texture atlas capacity expansion.

NathanSweet 12 жил өмнө
parent
commit
5bab2830a9

+ 1 - 1
spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m

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

+ 1 - 1
spine-cocos2dx/src/spine/spine-cocos2dx.cpp

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