cocos2d-x
cocos2d-x copied to clipboard
fix the bug that ect1 texture lost on android
- cocos2d-x version:3.9
- devices test on:android
- developing environments
- NDK version:
- Xcode version:
- VS version:
- browser type and version:
Steps to Reproduce:
#17278 not fix the bug
// etc1 support check whether alpha texture exists & load it
auto alphaFile = vt->_fileName + TextureCache::getETC1AlphaFileSuffix();
Texture2D::PixelFormat oldPixelFormat = Texture2D::getDefaultAlphaPixelFormat();
reloadTexture(vt->_texture->getAlphaTexture(), alphaFile, vt->_pixelFormat);
//After reload alphaTexture, you should setAlphaTexture,Like: vt->_texture->setAlphaTexture(vt->_texture->getAlphaTexture());
//otherwise,ect1 texture will lost still