Fix for kCCTexture2DPixelFormat_A8 pixel format?

Fix for kCCTexture2DPixelFormat_A8 pixel format?
0.0 0


In CCTexture2D.cpp @ line 406 the comment says “The code can not work, how to convert to A8?”.

Well, I needed alpha textures to work so I decided to take a quick look at it, but I don’t really understand why the comment is there, because there’s nothing wrong with A8 textures when you add “unsigned char*” in front of the “outPixel8” variable :slight_smile:
(and the “pixelFormat = kCCTexture2D_PixelFormat_RGBA8888” line needs to be removed as well, of course)

So, why is it disabled? :slight_smile:


Feature #450 is fixed by Ming. But I think he forget to remove this line of comment.


In PerformanceParticleTest, it changes the format to kCCTexture2DPixelFormat_A8 whether the realformat is not the A8, and it doesn’t work correctly.


Hmm, it doesn’t work indeed, you’re right.

But it does work if you set m_bHasPremultipliedAlpha to false when the format is kCCTexture2DPixelFormat_A8.

Did I just fix the bug? :slight_smile:


Cool, I will try it.