How to repeat:
- Touch the screen with three fingers: 1 2 3.
- Release 2nd finger
- Release 3rd finger
Result: the method CCTouchDispatcher::touchesEnded will not be called for the 3rd touch.
Resolution (patch) for Cocos2dxGLSurfaceView.java:
@@ -282,7 +282,7 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_POINTER_DOWN:
- final int idPointerDown = event.getAction() >> MotionEvent.ACTION_POINTER_ID_SHIFT;
+ final int idPointerDown = event.getPointerId(event.getAction() >> MotionEvent.ACTION_POINTER_ID_SHIFT);
final float xPointerDown = event.getX(idPointerDown);
final float yPointerDown = event.getY(idPointerDown);
@@ -318,7 +318,7 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
break;
case MotionEvent.ACTION_POINTER_UP:
- final int idPointerUp = event.getAction() >> MotionEvent.ACTION_POINTER_ID_SHIFT;
+ final int idPointerUp = event.getPointerId(event.getAction() >> MotionEvent.ACTION_POINTER_ID_SHIFT);
final float xPointerUp = event.getX(idPointerUp);
final float yPointerUp = event.getY(idPointerUp);
After this patch everything works ok.