Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the bug that ect1 texture lost on android #17278

Merged
merged 1 commit into from
Feb 4, 2017
Merged

Conversation

minggo
Copy link
Contributor

@minggo minggo commented Feb 4, 2017

the commit do the following things:

  • reload ect1 related shaders when comes from background
  • reload alpha texture when comes from background

the commit do the following things:
- reload ect1 related shaders when comes from background
- reload alpha texture when comes from background
@minggo minggo added this to the 3.15 milestone Feb 4, 2017
@minggo minggo removed this from the 3.15 milestone Feb 4, 2017
@minggo minggo merged commit c471293 into cocos2d:v3 Feb 4, 2017
@minggo minggo deleted the etc1-issue branch February 4, 2017 10:12
stevetranby added a commit to stevetranby/cocos2d-x that referenced this pull request Feb 13, 2017
* v3:
  fix the bug that ect1 texture lost on android (cocos2d#17278)
  Included the directories such that the extension classes work out of the box in Linux (cocos2d#17259)
  Prevent removal of unknown touch in CCScrollView::onTouchCancelled. (cocos2d#17208)
  Fix implicit conversion warnings (cocos2d#17254)
  Avoid variable shadowing (cocos2d#17264)
  Fix typo in function name (cocos2d#17253)
  [ci skip][AUTO]: updating luabinding & jsbinding & cocos_file.json automatically (cocos2d#17276)
  Fix typo in AudioState (cocos2d#17258)
  Fixed variable order in initializer lists (cocos2d#17274)
  Compilation fix (cocos2d#17209)
  Allow to unbind asynchronous texture loading callback with a custom key. (cocos2d#17206)

# Conflicts:
#	cocos/2d/CCParticleBatchNode.cpp
#	cocos/3d/CCMeshSkin.cpp
#	cocos/3d/CCSkeleton3D.cpp
#	cocos/network/SocketIO.cpp
#	cocos/ui/UIEditBox/Mac/CCUIEditBoxMac.h
@Canon0223
Copy link

        // 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants