Преглед изворни кода

Adds unique identifiers for the contact points when multitouch is enabled

Brandon Slack пре 14 година
родитељ
комит
b13d655c1a
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      gameplay/src/PlatformiOS.mm

+ 6 - 0
gameplay/src/PlatformiOS.mm

@@ -306,6 +306,8 @@ int getKey(unichar keyCode);
     for(UITouch *t in touches) 
     {
         CGPoint touchLoc = [t locationInView:self];
+        if(self.multipleTouchEnabled == YES) 
+            uniqueTouch = [t hash];
         Game::getInstance()->touchEvent(Touch::TOUCH_PRESS, touchLoc.y,  touchLoc.x, uniqueTouch);
     }
 }
@@ -316,6 +318,8 @@ int getKey(unichar keyCode);
     for(UITouch* t in touches) 
     {
         CGPoint touchLoc = [t locationInView:self];
+        if(self.multipleTouchEnabled == YES) 
+            uniqueTouch = [t hash];
         Game::getInstance()->touchEvent(Touch::TOUCH_RELEASE, touchLoc.y, touchLoc.x, uniqueTouch);
     }
 }
@@ -333,6 +337,8 @@ int getKey(unichar keyCode);
     for(UITouch* t in touches) 
     {
         CGPoint touchLoc = [t locationInView:self];
+        if(self.multipleTouchEnabled == YES) 
+            uniqueTouch = [t hash];
         Game::getInstance()->touchEvent(Touch::TOUCH_MOVE, touchLoc.y,  touchLoc.x, uniqueTouch);
     }
 }