Example #1
0
  private void updateBlendFunc() {
    assert !usesSpriteSheet_
        : "CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a CCSpriteSheet";

    // it's possible to have an untextured sprite
    if (texture_ == null || !texture_.hasPremultipliedAlpha()) {
      blendFunc_.src = GL10.GL_SRC_ALPHA;
      blendFunc_.dst = GL10.GL_ONE_MINUS_SRC_ALPHA;
      setOpacityModifyRGB(false);
    } else {
      blendFunc_.src = ccConfig.CC_BLEND_SRC;
      blendFunc_.dst = ccConfig.CC_BLEND_DST;
      setOpacityModifyRGB(true);
    }
  }