Merge branch 'develop' into 8.1.0-Dev

This commit is contained in:
Josh Tynjala
2023-04-24 09:52:11 -07:00
17 changed files with 177 additions and 145 deletions

View File

@@ -444,7 +444,7 @@ class HTML5HTTPRequest
private static function __loadImage(uri:String, promise:Promise<Image>, options:Int):Void
{
var image = new JSImage();
var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()');
if (!__isSameOrigin(uri))
{
@@ -534,7 +534,7 @@ class HTML5HTTPRequest
{
if (request.readyState != 4) return;
if (request.status != null && ((request.status >= 200 && request.status <= 400) || (validStatus0 && request.status == 0)))
if (request.status != null && ((request.status >= 200 && request.status < 400) || (validStatus0 && request.status == 0)))
{
processResponse();
promise.complete(request.responseText);

View File

@@ -1173,7 +1173,7 @@ class HTML5Window
textInput.type = 'text';
#else
// use password instead of text to avoid IME issues on Android
textInput.type = 'password';
textInput.type = Browser.navigator.userAgent.indexOf("Android") >= 0 ? 'password' : 'text';
#end
textInput.style.position = 'absolute';
textInput.style.opacity = "0";

View File

@@ -2308,7 +2308,7 @@ class NativeCFFI
return null;
}
@:hlNative("lime", "hl_al_filteri") private static function lime_al_filteri(filter:CFFIPointer, param:Int, value:Dynamic):Void {}
@:hlNative("lime", "hl_al_filteri") private static function lime_al_filteri(filter:CFFIPointer, param:Int, value:Int):Void {}
@:hlNative("lime", "hl_al_filterf") private static function lime_al_filterf(filter:CFFIPointer, param:Int, value:hl.F32):Void {}

View File

@@ -1421,11 +1421,7 @@ class Image
@:noCompletion private function __fromBase64(base64:String, type:String, onload:Image->Void = null):Void
{
#if (js && html5)
#if (openfljs || genes)
var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()');
#else
var image = new JSImage();
#end
var image_onLoaded = function(event)
{
@@ -1513,11 +1509,7 @@ class Image
@:noCompletion private function __fromFile(path:String, onload:Image->Void = null, onerror:Void->Void = null):Bool
{
#if (js && html5)
#if (openfljs || genes)
var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()');
#else
var image = new JSImage();
#end
#if !display
if (!HTML5HTTPRequest.__isSameOrigin(path))

View File

@@ -155,16 +155,15 @@ class CFFI
if (result == null)
{
var slash = (__sysName().substr(7).toLowerCase() == "windows") ? "\\" : "/";
var haxelib = __findHaxelib("lime");
if (haxelib != "")
{
result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + slash + library, library, method, args);
result = __tryLoad(haxelib + "/ndll/" + __sysName() + "/" + library, library, method, args);
if (result == null)
{
result = __tryLoad(haxelib + slash + "ndll" + slash + __sysName() + "64" + slash + library, library, method, args);
result = __tryLoad(haxelib + "/ndll/" + __sysName() + "64/" + library, library, method, args);
}
}
}
@@ -286,34 +285,35 @@ class CFFI
{
if (!__loadedNekoAPI)
{
var init:Dynamic = null;
try
{
var init = load("lime", "neko_init", 5);
if (init != null)
{
__loaderTrace("Found nekoapi @ " + __moduleNames.get("lime"));
init(function(s) return new String(s), function(len:Int)
{
var r = [];
if (len > 0) r[len - 1] = null;
return r;
}, null, true, false);
}
else if (!lazy)
{
throw("Could not find NekoAPI interface.");
}
init = load("lime", "neko_init", 5);
}
catch (e:Dynamic)
{
if (!lazy)
{
throw("Could not find NekoAPI interface.");
}
}
__loadedNekoAPI = true;
if (init != null)
{
__loaderTrace("Found nekoapi @ " + __moduleNames.get("lime"));
init(function(s) return new String(s), function(len:Int)
{
var r = [];
if (len > 0) r[len - 1] = null;
return r;
}, null, true, false);
__loadedNekoAPI = true;
}
else if (!lazy)
{
var ndllFolder = __findHaxelib("lime") + "/ndll/" + __sysName();
throw "Could not find lime.ndll. This file is provided with Lime's Haxelib releases, but not via Git. "
+ "Please copy it from Lime's latest Haxelib release into either "
+ ndllFolder + " or " + ndllFolder + "64, as appropriate for your system. "
+ "Advanced users may run `lime rebuild cpp` instead.";
}
}
}
#end

View File

@@ -63,52 +63,12 @@ class JNI
public static function callMember(method:Dynamic, jobject:Dynamic, a:Array<Dynamic>):Dynamic
{
switch (a.length)
{
case 0:
return method(jobject);
case 1:
return method(jobject, a[0]);
case 2:
return method(jobject, a[0], a[1]);
case 3:
return method(jobject, a[0], a[1], a[2]);
case 4:
return method(jobject, a[0], a[1], a[2], a[3]);
case 5:
return method(jobject, a[0], a[1], a[2], a[3], a[4]);
case 6:
return method(jobject, a[0], a[1], a[2], a[3], a[4], a[5]);
case 7:
return method(jobject, a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
default:
return null;
}
return Reflect.callMethod(null, method, [jobject].concat(a));
}
public static function callStatic(method:Dynamic, a:Array<Dynamic>):Dynamic
{
switch (a.length)
{
case 0:
return method();
case 1:
return method(a[0]);
case 2:
return method(a[0], a[1]);
case 3:
return method(a[0], a[1], a[2]);
case 4:
return method(a[0], a[1], a[2], a[3]);
case 5:
return method(a[0], a[1], a[2], a[3], a[4]);
case 6:
return method(a[0], a[1], a[2], a[3], a[4], a[5]);
case 7:
return method(a[0], a[1], a[2], a[3], a[4], a[5], a[6]);
default:
return null;
}
return Reflect.callMethod(null, method, a);
}
/**

View File

@@ -149,12 +149,20 @@ class AIRHelper
if (project.debug)
{
args.push("-connect");
if (project.config.exists("air.connect"))
{
args.push("-connect");
args.push(project.config.getString("air.connect"));
}
else if (project.config.exists("air.listen"))
{
args.push("-listen");
args.push(project.config.getString("air.listen"));
}
else
{
args.push("-connect");
}
}
args = args.concat(signingOptions);
@@ -204,9 +212,17 @@ class AIRHelper
Sys.putEnv("AIR_NOANDROIDFLAIR", "true");
}
if (targetPlatform == IOS)
if (targetPlatform == IOS && System.hostPlatform == MAC)
{
Sys.putEnv("AIR_IOS_SIMULATOR_DEVICE", XCodeHelper.getSimulatorName(project));
var simulatorName = XCodeHelper.getSimulatorName(project);
if (simulatorName == null)
{
Log.warn("Skipping AIR_IOS_SIMULATOR_DEVICE environment variable because default simulator not found");
}
else
{
Sys.putEnv("AIR_IOS_SIMULATOR_DEVICE", simulatorName);
}
}
System.runCommand(workingDirectory, project.defines.get("AIR_SDK") + "/bin/adt", args);

View File

@@ -6,7 +6,7 @@ import lime.tools.HXProject;
class XCodeHelper
{
private static inline var DEFAULT_IPAD_SIMULATOR = "ipad-air";
private static inline var DEFAULT_IPHONE_SIMULATOR = "iphone-11";
private static var DEFAULT_IPHONE_SIMULATOR_REGEX = ~/iphone-\d+/g;
private static function extractSimulatorFlagName(line:String):String
{
@@ -92,7 +92,14 @@ class XCodeHelper
}
else
{
currentDevice = devices.get(DEFAULT_IPHONE_SIMULATOR);
for (device in devices.keys())
{
if (DEFAULT_IPHONE_SIMULATOR_REGEX.match(device))
{
currentDevice = devices.get(device);
break;
}
}
}
}
@@ -101,12 +108,22 @@ class XCodeHelper
public static function getSimulatorID(project:HXProject):String
{
return getSelectedSimulator(project).id;
var simulator = getSelectedSimulator(project);
if (simulator == null)
{
return null;
}
return simulator.id;
}
public static function getSimulatorName(project:HXProject):String
{
return getSelectedSimulator(project).name;
var simulator = getSelectedSimulator(project);
if (simulator == null)
{
return null;
}
return simulator.name;
}
private static function getSimulators():String

View File

@@ -492,6 +492,11 @@ class Assets
public static function registerLibrary(name:String, library:AssetLibrary):Void
{
if (name == null || name == "")
{
name = "default";
}
if (libraries.exists(name))
{
if (libraries.get(name) == library)