cocos2d/cocos2d-x — pull request #1133 by NatWeiss (2012-07-27 02:23:01+00:00)
Title: Fixed CCTouch IDs so they have unique values.

When using CCTouch objects and the ccTouchesBegan() / ccTouchesEnded() functions, it is very important to have a unique ID so that if multiple touches are enabled, an end touch correctly corresponds with a begin touch.

The way CCEGLProtocol was written, it calls CCTouch's setTouchInfo() with the index into it's own private static touches container as the ID of the CCTouch. Since the touches container is frequently cleaned up, this causes most of CCTouch IDs to be zero.

This pull request fixes that by using the provided id variable in the call to setTouchInfo(). Now, ccTouchesBegan() gets CCTouch objects with unique ID values that correctly correspond with ID values sent to ccTouchesEnded().