From b337e232f034b81e09bc6f6900111767c7e02da7 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Tue, 30 Aug 2016 03:48:30 -0700 Subject: [PATCH] C# improvements --- include.xml | 3 ++- lime/_backend/native/NativeApplication.hx | 2 +- lime/math/Matrix4.hx | 8 ++++---- lime/project/ProjectXMLParser.hx | 5 +++++ lime/tools/helpers/LogHelper.hx | 2 ++ tools/CommandLineTools.hx | 16 +++++++++++++--- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/include.xml b/include.xml index ec280f3d7..b30cb3b4c 100644 --- a/include.xml +++ b/include.xml @@ -8,8 +8,9 @@ - + + diff --git a/lime/_backend/native/NativeApplication.hx b/lime/_backend/native/NativeApplication.hx index 0bd8a8791..b86bd3e6a 100644 --- a/lime/_backend/native/NativeApplication.hx +++ b/lime/_backend/native/NativeApplication.hx @@ -131,7 +131,7 @@ class NativeApplication { untyped setImmediate (eventLoop); return 0; - #elseif (cpp || neko || cs) + #elseif lime_cffi var result = lime_application_exec (handle); parent.onExit.dispatch (result); diff --git a/lime/math/Matrix4.hx b/lime/math/Matrix4.hx index a704b7b1b..0091368a7 100644 --- a/lime/math/Matrix4.hx +++ b/lime/math/Matrix4.hx @@ -7,7 +7,7 @@ import lime.utils.Float32Array; abstract Matrix4(Float32Array) from Float32Array to Float32Array { - private static var __identity = [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]; + private static var __identity:Array = [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]; public var determinant (get, never):Float; public var position (get, set):Vector4; @@ -171,7 +171,7 @@ abstract Matrix4(Float32Array) from Float32Array to Float32Array { } - public function copythisFrom( array:Float32Array, index:UInt = 0, transposeValues:Bool = false ) { + public function copythisFrom( array:Float32Array, index:Int = 0, transposeValues:Bool = false ) { if ( transposeValues ) transpose(); @@ -186,7 +186,7 @@ abstract Matrix4(Float32Array) from Float32Array to Float32Array { } - public function copythisTo( array:Float32Array, index:UInt = 0, transposeValues:Bool = false ) { + public function copythisTo( array:Float32Array, index:Int = 0, transposeValues:Bool = false ) { if ( transposeValues ) transpose(); @@ -201,7 +201,7 @@ abstract Matrix4(Float32Array) from Float32Array to Float32Array { } - public function copyRowFrom( row:UInt, vector:Vector4 ) { + public function copyRowFrom( row:Int, vector:Vector4 ) { switch( row ) { diff --git a/lime/project/ProjectXMLParser.hx b/lime/project/ProjectXMLParser.hx index 0f13a7a14..935ff6fa2 100644 --- a/lime/project/ProjectXMLParser.hx +++ b/lime/project/ProjectXMLParser.hx @@ -96,6 +96,11 @@ class ProjectXMLParser extends HXProject { defines.set ("native", "1"); defines.set ("nodejs", "1"); + } else if (targetFlags.exists ("cs")) { + + defines.set ("native", "1"); + defines.set ("cs", "1"); + } else if (target == Platform.FIREFOX) { defines.set ("html5", "1"); diff --git a/lime/tools/helpers/LogHelper.hx b/lime/tools/helpers/LogHelper.hx index d81552f89..27b7e7213 100644 --- a/lime/tools/helpers/LogHelper.hx +++ b/lime/tools/helpers/LogHelper.hx @@ -51,7 +51,9 @@ class LogHelper { if (verbose && e != null) { + #if !cs Lib.rethrow (e); + #end } diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index c3c27c889..440907f8a 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -212,7 +212,7 @@ class CommandLineTools { target = PlatformHelper.hostPlatform; targetFlags.set ("cpp", ""); - + case "neko": target = PlatformHelper.hostPlatform; @@ -222,11 +222,16 @@ class CommandLineTools { target = PlatformHelper.hostPlatform; targetFlags.set ("nodejs", ""); + + case "cs": + target = PlatformHelper.hostPlatform; + targetFlags.set ("cs", ""); + case "iphone", "iphoneos": target = Platform.IOS; - + case "iphonesim": target = Platform.IOS; @@ -1180,7 +1185,7 @@ class CommandLineTools { target = PlatformHelper.hostPlatform; targetFlags.set ("cpp", ""); - + case "neko": target = PlatformHelper.hostPlatform; @@ -1196,6 +1201,11 @@ class CommandLineTools { target = PlatformHelper.hostPlatform; targetFlags.set ("nodejs", ""); + case "cs": + + target = PlatformHelper.hostPlatform; + targetFlags.set ("cs", ""); + case "iphone", "iphoneos": target = Platform.IOS;