CCSpriteBatchNode and HTC Evo with Android

Hello all cocos2d friend,
I have a problem with CCSpriteBatchNode and my device HTC Evo. I am using several batch layers - one for background, one for foreground and one for UI. Sometimes occurs that UI layer is missing several sprites in the batch (particulary I have frame composed from edge sprites and inside sprite - missing are several edge sprites but not all and always the same ones).

When I render these sprites without batch, it works ok. The interesting thing is that when I jump to HOME and then back to the game, the batch is repaired! I figured out that the problem is fixed by calling method setupVBO(); after resume. So I thought that the problem will be somewhere in VBO. I created complete dumping of that batch and its texture atlas and data seems to be ok.
The problem will not occur on any simulated device. I have not another device to test.

Do you have any suggestions please?

Thanks for your time.

Jiri Formanek
Mingle Games

Hi, I’ve been encountering the same issue on a Samsung Galaxy S+ (I9001), started a thread a while back but got no answer here: http://www.cocos2d-x.org/boards/6/topics/21244
My initial thought was that the sprite batch is not growing but after some debugging I think that’s the problem.

In the meantime I have a flag that specifies if I should use spritebatches or not and all spritebatches have been replaced with CCNode. I’m losing some performance but at least we’re moving forward.
Maybe someone might suggest how to further investigate this

Sorry it’s not much of a help but at least I’m not the only one with this issue:)

Good luck

I have something similar on HTC Wildifre with Cocos2d-x 2.1.1 - some characters in the CCLabelBMFont (child of CCSpriteBatchNode) do not show themselves, but after going home and back everything is ok.

Cristian Cristea wrote:

Hi, I’ve been encountering the same issue on a Samsung Galaxy S+ (I9001), started a thread a while back but got no answer here: http://www.cocos2d-x.org/boards/6/topics/21244
My initial thought was that the sprite batch is not growing but after some debugging I think that’s the problem.
>
In the meantime I have a flag that specifies if I should use spritebatches or not and all spritebatches have been replaced with CCNode. I’m losing some performance but at least we’re moving forward.
Maybe someone might suggest how to further investigate this
>
Sorry it’s not much of a help but at least I’m not the only one with this issue:)
>
Good luck

Thank you very much:-) It seems that you are correct. I fixed the problem by individual setting of batch capacity to prevent resizing. I have batch nodes quite static so this is not problem for this case but there must be some bug in resizing of texture atlas…

`victor I’m having the same issue and I managed to resolve it for dynamic texts by first initializing the label with the highest number of char count it could take (for example my score label has a default value of “000000”) and a setString to “0” afterwards. This avoids the issue but still I’m afraid there is a bug in there on some of the devices.

`jiri at first I thought the same way but as some of the batches are quite dynamic in size the issue is still there even if I initialize the spritebatch with 1000 or more elements, though sprites were being displayed so I concluded the safest way for now is to disable spritebatches on those particular models

What I observed since we are on a quite extensive beta and also thanks to your feed is that the issue appears on Adreno 200 and Adreno 205 GPUs (Samsung I9001, HTC Evo, LG P500, HTC Desire)

http://www.gsmarena.com/lg_optimus_one_p500-3516.php
http://www.gsmarena.com/samsung_i9001_galaxy_s_plus-3908.php
http://www.gsmarena.com/htc_evo_4g-3427.php
http://www.gsmarena.com/htc_wildfire_s-3777.php
http://www.gsmarena.com/htc_desire-3077.php

I know that are more than 70 devices using Adreno 200 but still, I’m just guessing:)

I haven’t seen this issue on HTC Desire S and ZTE Blade (Adreno 205 and 200), at least, not related to CCSpriteBatchNode.
I’ll keep an eye on it, to see if it ever happends.

What I did see, is something similar, in which some sprites of the batch were missing.
My problem was not initializing some class attributes on object creation, which randomly took some values which triggered the effect.
C++, as opposed to Java or C# does not initialize variables to a default value (such as zero, or false). Don’t forget.

Have same issue on Samsung GT-S7500 Galaxy Ace Plus

but after going home and back everything is ok.
Yes, it helps.

same issues on HTC EVO 3D X515m (cocos2dx 2.0.4)

I’m using HTC One V. After sharing something on facebook, then the app resumed, I got this error

D/cocos2d-x debug info(15430): OpenGL error 0x0502 in \proj.android…/cocos2d/cocos/2d/CCTextureAtlas.cpp drawNumberOfQuads 701
E/Adreno200-ES20(15430): : GLINVALIDVALUE

Is it related to this thread?