From ced26d5c64eea3d31b3fa104a8305d37cec99e49 Mon Sep 17 00:00:00 2001 From: Valerio Santinelli Date: Fri, 2 Oct 2015 23:36:35 +0200 Subject: [PATCH 1/5] Enabled ARC for iOS and tvOS targets --- lime/tools/platforms/IOSPlatform.hx | 15 ++++++++------- lime/tools/platforms/TVOSPlatform.hx | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lime/tools/platforms/IOSPlatform.hx b/lime/tools/platforms/IOSPlatform.hx index e73dd0739..f736d6949 100644 --- a/lime/tools/platforms/IOSPlatform.hx +++ b/lime/tools/platforms/IOSPlatform.hx @@ -224,7 +224,8 @@ class IOSPlatform extends PlatformTarget { context.OBJC_ARC = true; } - + LogHelper.info("OBJC_ARC:" + context.OBJC_ARC); + //context.ENABLE_BITCODE = (project.config.getFloat ("ios.deployment", 5.1) >= 6); context.ENABLE_BITCODE = project.config.getBool ("ios.enable-bitcode", false); context.IOS_COMPILER = project.config.getString ("ios.compiler", "clang"); @@ -331,12 +332,12 @@ class IOSPlatform extends PlatformTarget { var commands = []; - if (armv6) commands.push ([ "-Dios", "-DHXCPP_CPP11" ]); - if (armv7) commands.push ([ "-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARMV7" ]); - if (armv7s) commands.push ([ "-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARMV7S" ]); - if (arm64) commands.push ([ "-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARM64" ]); - if (i386) commands.push ([ "-Dios", "-Dsimulator", "-DHXCPP_CPP11" ]); - if (x86_64) commands.push ([ "-Dios", "-Dsimulator", "-DHXCPP_M64", "-DHXCPP_CPP11" ]); + if (armv6) commands.push ([ "-Dios", "-DHXCPP_CPP11", "-DOBJC_ARC" ]); + if (armv7) commands.push ([ "-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARMV7", "-DOBJC_ARC" ]); + if (armv7s) commands.push ([ "-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARMV7S", "-DOBJC_ARC" ]); + if (arm64) commands.push ([ "-Dios", "-DHXCPP_CPP11", "-DHXCPP_ARM64", "-DOBJC_ARC" ]); + if (i386) commands.push ([ "-Dios", "-Dsimulator", "-DHXCPP_CPP11", "-DOBJC_ARC" ]); + if (x86_64) commands.push ([ "-Dios", "-Dsimulator", "-DHXCPP_M64", "-DHXCPP_CPP11", "-DOBJC_ARC" ]); CPPHelper.rebuild (project, commands); diff --git a/lime/tools/platforms/TVOSPlatform.hx b/lime/tools/platforms/TVOSPlatform.hx index 4c51a9bb4..f57b64ef8 100644 --- a/lime/tools/platforms/TVOSPlatform.hx +++ b/lime/tools/platforms/TVOSPlatform.hx @@ -313,9 +313,9 @@ class TVOSPlatform extends PlatformTarget { var commands = []; - if (arm64) commands.push ([ "-Dtvos", "-Dappletvos", "-DHXCPP_CPP11", "-DHXCPP_ARM64" ]); - if (i386) commands.push ([ "-Dtvos", "-Dappletvsim", "-Dsimulator", "-DHXCPP_CPP11" ]); - if (x86_64) commands.push ([ "-Dtvos", "-Dappletvsim", "-Dsimulator", "-DHXCPP_M64", "-DHXCPP_CPP11" ]); + if (arm64) commands.push ([ "-Dtvos", "-Dappletvos", "-DHXCPP_CPP11", "-DHXCPP_ARM64", "-DOBJC_ARC" ]); + if (i386) commands.push ([ "-Dtvos", "-Dappletvsim", "-Dsimulator", "-DHXCPP_CPP11", "-DOBJC_ARC" ]); + if (x86_64) commands.push ([ "-Dtvos", "-Dappletvsim", "-Dsimulator", "-DHXCPP_M64", "-DHXCPP_CPP11", "-DOBJC_ARC" ]); CPPHelper.rebuild (project, commands); From 4c3eeed57efdb411b2de177916e39bc685a17060 Mon Sep 17 00:00:00 2001 From: Valerio Santinelli Date: Fri, 2 Oct 2015 23:37:16 +0200 Subject: [PATCH 2/5] iOS native target --- project/Build.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/project/Build.xml b/project/Build.xml index ef57f07a9..0d074f8ee 100644 --- a/project/Build.xml +++ b/project/Build.xml @@ -365,6 +365,25 @@ + + + + + + + + +
+ + + + + + + + + + From c624bb493590f4261303179a4a09854d62ce4a8e Mon Sep 17 00:00:00 2001 From: Valerio Santinelli Date: Fri, 2 Oct 2015 23:40:01 +0200 Subject: [PATCH 3/5] Wrong check in default assets library --- templates/haxe/DefaultAssetLibrary.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/haxe/DefaultAssetLibrary.hx b/templates/haxe/DefaultAssetLibrary.hx index 579571601..a8fe0078b 100644 --- a/templates/haxe/DefaultAssetLibrary.hx +++ b/templates/haxe/DefaultAssetLibrary.hx @@ -712,7 +712,7 @@ class DefaultAssetLibrary extends AssetLibrary { if (!className.exists (asset.id)) { - #if ios || tvos + #if (ios || tvos) path.set (asset.id, "assets/" + asset.path); #else path.set (asset.id, asset.path); From 5a5aa4030a7c85b2eed4b88e068a3b3f56414751 Mon Sep 17 00:00:00 2001 From: Valerio Santinelli Date: Sat, 3 Oct 2015 00:03:05 +0200 Subject: [PATCH 4/5] Removed debug logging of ARC --- lime/tools/platforms/IOSPlatform.hx | 1 - 1 file changed, 1 deletion(-) diff --git a/lime/tools/platforms/IOSPlatform.hx b/lime/tools/platforms/IOSPlatform.hx index f736d6949..a80efe8cd 100644 --- a/lime/tools/platforms/IOSPlatform.hx +++ b/lime/tools/platforms/IOSPlatform.hx @@ -224,7 +224,6 @@ class IOSPlatform extends PlatformTarget { context.OBJC_ARC = true; } - LogHelper.info("OBJC_ARC:" + context.OBJC_ARC); //context.ENABLE_BITCODE = (project.config.getFloat ("ios.deployment", 5.1) >= 6); context.ENABLE_BITCODE = project.config.getBool ("ios.enable-bitcode", false); From 8a765e45d3f58da0503f569c16ed77ec41344116 Mon Sep 17 00:00:00 2001 From: Valerio Santinelli Date: Mon, 5 Oct 2015 19:08:34 +0200 Subject: [PATCH 5/5] Added mappings for iOS/tvOS MFI game controllers --- lime/ui/Window.hx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lime/ui/Window.hx b/lime/ui/Window.hx index 76979db13..f20f3e579 100644 --- a/lime/ui/Window.hx +++ b/lime/ui/Window.hx @@ -224,6 +224,18 @@ class Window { ]; + Gamepad.addMappings (mappings); + + #elseif (ios || tvos) + + var mappings = [ + + "4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,", + "4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,", + "4d466947616d65706164030000000000,MFi Apple TV Remote,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,", + + ]; + Gamepad.addMappings (mappings); #end