Browse Source

to be Java conform: cast to jlong instead of long

revvv 5 years ago
parent
commit
df8bbf8650
1 changed files with 4 additions and 4 deletions
  1. 4 4
      jme3-ios/ios-data/templates/project/jme-ios/jmeAppDelegate.m

+ 4 - 4
jme3-ios/ios-data/templates/project/jme-ios/jmeAppDelegate.m

@@ -276,8 +276,8 @@ getEnv(JavaVM* vm)
     	UITouch *touch = [touches anyObject];
     	UITouch *touch = [touches anyObject];
     	CGPoint position = [touch locationInView: nil];
     	CGPoint position = [touch locationInView: nil];
         float scale = _glview.contentScaleFactor;
         float scale = _glview.contentScaleFactor;
-        // NOTE: cast to long is only required for x86_64/simulator, otherwise JmeAppHarness receives non-sense values (Avian!?)
-        (*e)->CallVoidMethod(e, self.harness, self.injectTouchBegin, 0, (long) touch.timestamp, position.x * scale, position.y * scale);
+        // NOTE: cast to jlong is required, otherwise JmeAppHarness receives non-sense values
+        (*e)->CallVoidMethod(e, self.harness, self.injectTouchBegin, 0, (jlong) touch.timestamp, position.x * scale, position.y * scale);
         if ((*e)->ExceptionCheck(e)) {
         if ((*e)->ExceptionCheck(e)) {
             NSLog(@"Could not invoke iOS Harness injectTouchBegin");
             NSLog(@"Could not invoke iOS Harness injectTouchBegin");
             (*e)->ExceptionDescribe(e);
             (*e)->ExceptionDescribe(e);
@@ -293,7 +293,7 @@ getEnv(JavaVM* vm)
     	UITouch *touch = [touches anyObject];
     	UITouch *touch = [touches anyObject];
     	CGPoint position = [touch locationInView: nil];
     	CGPoint position = [touch locationInView: nil];
         float scale = _glview.contentScaleFactor;
         float scale = _glview.contentScaleFactor;
-        (*e)->CallVoidMethod(e, self.harness, self.injectTouchMove, 0, (long) touch.timestamp, position.x * scale, position.y * scale);
+        (*e)->CallVoidMethod(e, self.harness, self.injectTouchMove, 0, (jlong) touch.timestamp, position.x * scale, position.y * scale);
         if ((*e)->ExceptionCheck(e)) {
         if ((*e)->ExceptionCheck(e)) {
             NSLog(@"Could not invoke iOS Harness injectTouchMove");
             NSLog(@"Could not invoke iOS Harness injectTouchMove");
             (*e)->ExceptionDescribe(e);
             (*e)->ExceptionDescribe(e);
@@ -309,7 +309,7 @@ getEnv(JavaVM* vm)
     	UITouch *touch = [touches anyObject];
     	UITouch *touch = [touches anyObject];
     	CGPoint position = [touch locationInView: nil];
     	CGPoint position = [touch locationInView: nil];
         float scale = _glview.contentScaleFactor;
         float scale = _glview.contentScaleFactor;
-        (*e)->CallVoidMethod(e, self.harness, self.injectTouchEnd, 0, (long) touch.timestamp, position.x * scale, position.y * scale);
+        (*e)->CallVoidMethod(e, self.harness, self.injectTouchEnd, 0, (jlong) touch.timestamp, position.x * scale, position.y * scale);
         if ((*e)->ExceptionCheck(e)) {
         if ((*e)->ExceptionCheck(e)) {
             NSLog(@"Could not invoke iOS Harness injectTouchEnd");
             NSLog(@"Could not invoke iOS Harness injectTouchEnd");
             (*e)->ExceptionDescribe(e);
             (*e)->ExceptionDescribe(e);