Return the texture while Spine is using it.

This commit is contained in:
NathanSweet 2014-05-16 12:10:27 +02:00
parent 3ba9994652
commit 4defc3146a

View File

@ -35,12 +35,14 @@ USING_NS_CC;
void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) { void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) {
Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path); Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path);
texture->retain();
self->rendererObject = texture; self->rendererObject = texture;
self->width = texture->getPixelsWide(); self->width = texture->getPixelsWide();
self->height = texture->getPixelsHigh(); self->height = texture->getPixelsHigh();
} }
void _spAtlasPage_disposeTexture (spAtlasPage* self) { void _spAtlasPage_disposeTexture (spAtlasPage* self) {
((Texture2D*)self->rendererObject)->release();
} }
char* _spUtil_readFile (const char* path, int* length) { char* _spUtil_readFile (const char* path, int* length) {