cocos2d/cocos2d-x — pull request #2586 by silverscania (2013-05-19 16:01:27+00:00)
Title: Bug in previous modifications made to GL_UNPACK_ALIGNMENT

I previously fixed a bug where the row byte alignment was set incorrectly for other pixel formats.

This introduced a new bug as discussed here: https://github.com/cocos2d/cocos2d-x/commit/e66e7cfcca2676d8e1b3fa44b27e096729c68f5a#commitcomment-3243089

This is because I used the function bitsPerPixelForFormat which returns the wrong result for textures with no alpha (RGB_888) as is noted in the function its self. Perhaps we can fix this function. It is only used elsewhere to log the texture.

In the mean time I have added an extra condition:

```
if(pixelFormat == kCCTexture2DPixelFormat_RGB888)
{
bitsPerPixel = 24;
}
```