MARK: Texture protocol
| 1674 | |
| 1675 | // MARK: Texture protocol |
| 1676 | void Sprite::updateBlendFunc() |
| 1677 | { |
| 1678 | AXASSERT(_renderMode != RenderMode::QUAD_BATCHNODE, |
| 1679 | "CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a SpriteBatchNode"); |
| 1680 | |
| 1681 | // it is possible to have an untextured sprite |
| 1682 | backend::BlendDescriptor& blendDescriptor = _trianglesCommand.getPipelineDescriptor().blendDescriptor; |
| 1683 | blendDescriptor.blendEnabled = true; |
| 1684 | |
| 1685 | if (!_texture || !_texture->hasPremultipliedAlpha()) |
| 1686 | { |
| 1687 | _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED; |
| 1688 | setOpacityModifyRGB(false); |
| 1689 | } |
| 1690 | else |
| 1691 | { |
| 1692 | _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; |
| 1693 | setOpacityModifyRGB(true); |
| 1694 | } |
| 1695 | } |
| 1696 | |
| 1697 | std::string Sprite::getDescription() const |
| 1698 | { |
nothing calls this directly
no test coverage detected