cocos2d/cocos2d-iphone — pull request #205 by supernes (2012-04-29 14:26:55+00:00)
Title: Fix CCParticleSystem issues with premultiplied alpha textures

Multiple issues exist in the CCParticleSystem implementation when using
textures with premultiplied alpha and/or the Particle Designer software.

- Using a blend func of GL_ONE/GL_ONE_MINUS_SRC_ALPHA (aka "cocos2d
normal") prevents the particles from fading out (endColor.a = 0) due to
over-saturation of the quad vertex color.

- Using a blend func of GL_SRC_ALPHA/GL_ONE_MINUS_SRC_ALPHA (aka
"Particle Designer normal") ignores alpha multiplication and introduces
a black halo when overlapping particles and/or setting them against
non-black backgrounds. Numerous users have sporadically reported
similar issues over the past couple of years.

This fix detects textures with premultiplied alpha and modifies vertex
colors on quad systems accordingly.

The ParticleTest test case has been updated to demonstrate proper
behavior in contrast to the previous version of the implementation. See
code for details.