mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Return the texture while Spine is using it.
This commit is contained in:
parent
3ba9994652
commit
4defc3146a
@ -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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user