From 7a5794b314aba899dac5f104e628b25258bd2837 Mon Sep 17 00:00:00 2001 From: Jake Traynham Date: Thu, 18 Jul 2013 11:07:58 -0500 Subject: [PATCH] Added NewUI Support in iOS build --- ios/ViewController.mm | 26 +++++++++++++++++++++----- native | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ios/ViewController.mm b/ios/ViewController.mm index d80f955385..6786488f69 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -266,15 +266,31 @@ ViewController* sharedViewController; float scaledX = (int)(x * dp_xscale) * scale; float scaledY = (int)(y * dp_yscale) * scale; + + TouchInput input; input_state.pointer_x[pointerId] = scaledX; input_state.pointer_y[pointerId] = scaledY; - if (code == 1) { - input_state.pointer_down[pointerId] = true; - } else if (code == 2) { - input_state.pointer_down[pointerId] = false; - } + input.x = scaledX; + input.y = scaledY; + switch (code) { + case 1 : + input_state.pointer_down[pointerId] = true; + input.flags = TOUCH_DOWN; + break; + + case 2 : + input_state.pointer_down[pointerId] = false; + input.flags = TOUCH_UP; + break; + + default : + input.flags = TOUCH_MOVE; + break; + } input_state.mouse_valid = true; + input.id = pointerId; + NativeTouch(input); } - (NSDictionary*)touchDictBy:(UITouch*)touch diff --git a/native b/native index cd8987b33b..d5d969fc6a 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit cd8987b33bbe299af0383609db28fecd6546bffe +Subproject commit d5d969fc6a2332e7ac930aa397bd109f9e771d2c