Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cocos/2d/CCRenderTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,11 @@ bool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat

#if CC_ENABLE_PREMULTIPLIED_ALPHA != 0
_sprite->setBlendFunc(BlendFunc::ALPHA_PREMULTIPLIED);
_sprite->setOpacityModifyRGB(true);
#else
_sprite->setBlendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED);
_sprite->setOpacityModifyRGB(false);
#endif
_sprite->setOpacityModifyRGB(true);

glBindRenderbuffer(GL_RENDERBUFFER, oldRBO);
glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);
Expand Down
4 changes: 0 additions & 4 deletions cocos/2d/CCSprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ bool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated)
_recursiveDirty = false;
setDirty(false);

_opacityModifyRGB = true;

_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;

_flippedX = _flippedY = false;

// default transform anchor: center
Expand Down