Hi all,
In my game I have decided to use a number of simple, un-textured particle systems for various effects. Because the particle systems included with Cocos2D necessarily have some overhead due to the fact that they're meant to be textured, I've written my own particle system for these effects to gain some extra speed. It's very similar to the original Cocos2D particle systems, but without the ability to render textures and some of the more complex attributes.
It's working pretty well, but I'm having an odd problem. All of particles are being rendered on screen at twice the x/y values they're supposed to be rendered at. So for instance, if a particle is positioned at (160, 240) - the center of the screen - it will be rendered at (320, 480) - the top right. I can't for the life of me figure out why this is occurring. I've checked with GDB and confirmed that the particles do indeed have the correct x/y values, but somehow when I pass them to OpenGL they get messed up.
My assumption is that the array I use to store the particle positions is getting bit-shifted to the left somehow. However, I can't find anything in my code that would cause this. I'm pretty much lost.
Here's the code: http://pastie.org/610543
Thanks for any help you can provide. Also, while it's not done yet, but please feel free to use it if you think it would help in your project.