Narendrabrsoft / cocos2d-android-1

Automatically exported from code.google.com/p/cocos2d-android-1
0 stars 0 forks source link

TileMap Render Problem #81

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. adding tile map to a CCScene
2.
3.

What is the expected output? What do you see instead?
expect to see the good_map.png see bad_map.png

What version of the product are you using? On what operating system?
cocos2dVersion = "cocos2d v0.99.4"; Android 2.1 HTC wildfire and also the 
simulator under windows-7

Please provide any additional information below.
when I comment out the gl.glColorPointer(4, GL10.GL_FLOAT, 0, colors); in the 
CCSprite draw method it renders properly

Original issue reported on code.google.com by bruceaus...@gmail.com on 20 Jun 2011 at 6:20

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks to Petr Boklashov this problem is fixed

Comment 9 by pboklas...@gmail.com, Jul 12, 2011 Hello Weikuan,

   I found probably better, more logical, way to fix the issue in CCTextureAtlas draw method:

        if (withColorArray_) {
            gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
            gl.glColorPointer(4, GL10.GL_FLOAT, 0, colors.bytes);
        }
        else
            // Disable color buffer if it hasn't been initialized
            gl.glDisableClientState(GL10.GL_COLOR_ARRAY);

Best Regards, Petr Boklashov.
Comment 10 by project member zhouweik...@gmail.com, Jul 13, 2011
 It seems Client state for color array is enabled as default, so we should
also enable it after the draw?
Comment 11 by pboklas...@gmail.com, Jul 13, 2011 
Yes, you'r right, it needs to be enabled after the draw.

Original comment by bruceaus...@gmail.com on 1 Aug 2011 at 3:04