Merge branch 'develop' into 8.2.0-Dev
This commit is contained in:
@@ -458,6 +458,12 @@
|
||||
|
||||
<section if="mac">
|
||||
<vflag name="-install_name" value="@executable_path/lime.hdll" if="LIME_HASHLINK"/>
|
||||
<!--
|
||||
starting in xcode 15, rpath doesn't automatically include
|
||||
/usr/local/lib, but we need it for neko
|
||||
-->
|
||||
<vflag name="-rpath" value="/usr/local/lib" />
|
||||
<vflag name="-rpath" value="/opt/homebrew/lib" if="HXCPP_ARM64"/>
|
||||
|
||||
<vflag name="-l" value="iconv" />
|
||||
<vflag name="-framework" value="IOKit" />
|
||||
|
||||
@@ -155,15 +155,15 @@ class CFFI
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
var haxelib = __findHaxelib("lime");
|
||||
var ndllFolder = __findNDLLFolder();
|
||||
|
||||
if (haxelib != "")
|
||||
if (ndllFolder != "")
|
||||
{
|
||||
result = __tryLoad(haxelib + "/ndll/" + __sysName() + "/" + library, library, method, args);
|
||||
result = __tryLoad(ndllFolder + __sysName() + "/" + library, library, method, args);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result = __tryLoad(haxelib + "/ndll/" + __sysName() + "64/" + library, library, method, args);
|
||||
result = __tryLoad(ndllFolder + __sysName() + "64/" + library, library, method, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,39 +213,27 @@ class CFFI
|
||||
#end
|
||||
}
|
||||
|
||||
private static function __findHaxelib(library:String):String
|
||||
private static function __findNDLLFolder():String
|
||||
{
|
||||
#if (sys && !macro && !html5)
|
||||
var process = new Process("haxelib", ["path", "lime"]);
|
||||
|
||||
try
|
||||
{
|
||||
var proc = new Process("haxelib", ["path", library]);
|
||||
|
||||
if (proc != null)
|
||||
while (true)
|
||||
{
|
||||
var stream = proc.stdout;
|
||||
var line = StringTools.trim(process.stdout.readLine());
|
||||
|
||||
try
|
||||
if (StringTools.startsWith(line, "-L "))
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
var s = stream.readLine();
|
||||
|
||||
if (s.substr(0, 1) != "-")
|
||||
{
|
||||
stream.close();
|
||||
proc.close();
|
||||
__loaderTrace("Found haxelib " + s);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
process.close();
|
||||
return Path.addTrailingSlash(line.substr(3));
|
||||
}
|
||||
catch (e:Dynamic) {}
|
||||
|
||||
stream.close();
|
||||
proc.close();
|
||||
}
|
||||
}
|
||||
catch (e:Dynamic) {}
|
||||
|
||||
process.close();
|
||||
#end
|
||||
|
||||
return "";
|
||||
@@ -317,7 +305,7 @@ class CFFI
|
||||
}
|
||||
else if (!lazy)
|
||||
{
|
||||
var ndllFolder = __findHaxelib("lime") + "/ndll/" + __sysName();
|
||||
var ndllFolder = __findNDLLFolder() + __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. "
|
||||
|
||||
@@ -105,6 +105,11 @@ class HXProject extends Script
|
||||
initializeStatics();
|
||||
|
||||
var classRef = Type.resolveClass(inputData.name);
|
||||
if (classRef == null)
|
||||
{
|
||||
Log.error('Unable to find class ${ inputData.name } in ${ inputData.projectFile }');
|
||||
return;
|
||||
}
|
||||
var instance = Type.createInstance(classRef, []);
|
||||
|
||||
var serializer = new Serializer();
|
||||
@@ -379,7 +384,7 @@ class HXProject extends Script
|
||||
|
||||
var path = FileSystem.fullPath(Path.withoutDirectory(projectFile));
|
||||
var name = Path.withoutDirectory(Path.withoutExtension(projectFile));
|
||||
name = name.substr(0, 1).toUpperCase() + name.substr(1);
|
||||
name = name.charAt(0).toUpperCase() + name.substr(1);
|
||||
|
||||
var tempDirectory = FileSystem.fullPath(System.getTemporaryDirectory());
|
||||
var classFile = Path.combine(tempDirectory, name + ".hx");
|
||||
@@ -426,6 +431,7 @@ class HXProject extends Script
|
||||
name: name,
|
||||
target: HXProject._target,
|
||||
debug: HXProject._debug,
|
||||
projectFile: projectFile,
|
||||
targetFlags: HXProject._targetFlags,
|
||||
templatePaths: HXProject._templatePaths,
|
||||
userDefines: HXProject._userDefines,
|
||||
|
||||
@@ -512,7 +512,7 @@ class ProjectXMLParser extends HXProject
|
||||
|
||||
var asset = new Asset(path + childPath, targetPath + childTargetPath, childType, childEmbed);
|
||||
asset.library = childLibrary;
|
||||
|
||||
|
||||
if (childElement.has.id)
|
||||
{
|
||||
asset.id = substitute(childElement.att.id);
|
||||
@@ -1194,12 +1194,28 @@ class ProjectXMLParser extends HXProject
|
||||
|
||||
if (element.has.width)
|
||||
{
|
||||
splashScreen.width = Std.parseInt(substitute(element.att.width));
|
||||
var parsedValue = Std.parseInt(substitute(element.att.width));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown width=\"" + element.att.width + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
splashScreen.width = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (element.has.height)
|
||||
{
|
||||
splashScreen.height = Std.parseInt(substitute(element.att.height));
|
||||
var parsedValue = Std.parseInt(substitute(element.att.height));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown height=\"" + element.att.height + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
splashScreen.height = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
splashScreens.push(splashScreen);
|
||||
@@ -1271,16 +1287,37 @@ class ProjectXMLParser extends HXProject
|
||||
{
|
||||
if (!isValidElement(childElement, "")) continue;
|
||||
|
||||
switch (childElement.name)
|
||||
if (childElement.name == "imageset")
|
||||
{
|
||||
case "imageset":
|
||||
var name = substitute(childElement.att.name);
|
||||
var imageset = new LaunchStoryboard.ImageSet(name);
|
||||
var name = substitute(childElement.att.name);
|
||||
var imageset = new LaunchStoryboard.ImageSet(name);
|
||||
|
||||
if (childElement.has.width) imageset.width = Std.parseInt(substitute(childElement.att.width));
|
||||
if (childElement.has.height) imageset.height = Std.parseInt(substitute(childElement.att.height));
|
||||
if (childElement.has.width)
|
||||
{
|
||||
var parsedValue = Std.parseInt(substitute(childElement.att.width));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown width=\"" + element.att.width + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
imageset.width = parsedValue;
|
||||
}
|
||||
}
|
||||
if (childElement.has.height)
|
||||
{
|
||||
var parsedValue = Std.parseInt(substitute(childElement.att.height));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown height=\"" + element.att.height + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
imageset.height = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
launchStoryboard.assets.push(imageset);
|
||||
launchStoryboard.assets.push(imageset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1300,22 +1337,54 @@ class ProjectXMLParser extends HXProject
|
||||
|
||||
if (element.has.size)
|
||||
{
|
||||
icon.size = icon.width = icon.height = Std.parseInt(substitute(element.att.size));
|
||||
var parsedValue = Std.parseInt(substitute(element.att.size));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown size=\"" + element.att.size + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
icon.size = icon.width = icon.height = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (element.has.width)
|
||||
{
|
||||
icon.width = Std.parseInt(substitute(element.att.width));
|
||||
var parsedValue = Std.parseInt(substitute(element.att.width));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown width=\"" + element.att.width + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
icon.width = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (element.has.height)
|
||||
{
|
||||
icon.height = Std.parseInt(substitute(element.att.height));
|
||||
var parsedValue = Std.parseInt(substitute(element.att.height));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown height=\"" + element.att.height + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
icon.height = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (element.has.priority)
|
||||
{
|
||||
icon.priority = Std.parseInt(substitute(element.att.priority));
|
||||
var parsedValue = Std.parseInt(substitute(element.att.priority));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown priority=\"" + element.att.priority + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
icon.priority = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
icons.push(icon);
|
||||
@@ -1593,11 +1662,6 @@ class ProjectXMLParser extends HXProject
|
||||
dependency.forceLoad = parseBool(element.att.resolve("force-load"));
|
||||
}
|
||||
|
||||
if (element.has.resolve("web-worker"))
|
||||
{
|
||||
dependency.webWorker = parseBool(element.att.resolve("web-worker"));
|
||||
}
|
||||
|
||||
var i = dependencies.length;
|
||||
|
||||
while (i-- > 0)
|
||||
@@ -1621,16 +1685,45 @@ class ProjectXMLParser extends HXProject
|
||||
switch (name)
|
||||
{
|
||||
case "minimum-sdk-version":
|
||||
config.set("android.minimum-sdk-version", Std.parseInt(value));
|
||||
var parsedValue = Std.parseInt(value);
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown " + name + "=\"" + value + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
config.set("android.minimum-sdk-version", parsedValue);
|
||||
}
|
||||
|
||||
case "target-sdk-version":
|
||||
config.set("android.target-sdk-version", Std.parseInt(value));
|
||||
var parsedValue = Std.parseInt(value);
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown " + name + "=\"" + value + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
config.set("android.target-sdk-version", parsedValue);
|
||||
}
|
||||
|
||||
case "install-location":
|
||||
config.set("android.install-location", value);
|
||||
|
||||
case "extension", "permission":
|
||||
config.push("android." + name, value, true);
|
||||
case "extension":
|
||||
var extensions = config.getArrayString("android.extension");
|
||||
|
||||
if (extensions == null || extensions.indexOf(value) == -1)
|
||||
{
|
||||
config.push("android.extension", value);
|
||||
}
|
||||
|
||||
case "permission":
|
||||
var permissions = config.getArrayString("android.permission");
|
||||
|
||||
if (permissions == null || permissions.indexOf(value) == -1)
|
||||
{
|
||||
config.push("android.permission", value);
|
||||
}
|
||||
|
||||
case "gradle-version":
|
||||
config.set("android.gradle-version", value);
|
||||
@@ -1779,7 +1872,15 @@ class ProjectXMLParser extends HXProject
|
||||
|
||||
if (element.has.id)
|
||||
{
|
||||
id = Std.parseInt(substitute(element.att.id));
|
||||
var parsedValue = Std.parseInt(substitute(element.att.id));
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown id=\"" + element.att.id + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
id = parsedValue;
|
||||
}
|
||||
}
|
||||
|
||||
while (id >= windows.length)
|
||||
@@ -1811,7 +1912,15 @@ class ProjectXMLParser extends HXProject
|
||||
}
|
||||
else
|
||||
{
|
||||
windows[id].background = Std.parseInt(value);
|
||||
var parsedValue = Std.parseInt(value);
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown " + name + "=\"" + value + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
windows[id].background = parsedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1824,7 +1933,15 @@ class ProjectXMLParser extends HXProject
|
||||
}
|
||||
|
||||
case "height", "width", "fps", "antialiasing":
|
||||
Reflect.setField(windows[id], name, Std.parseInt(value));
|
||||
var parsedValue = Std.parseInt(value);
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown " + name + "=\"" + value + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
Reflect.setField(windows[id], name, parsedValue);
|
||||
}
|
||||
|
||||
case "parameters", "title":
|
||||
Reflect.setField(windows[id], name, Std.string(value));
|
||||
@@ -1833,7 +1950,15 @@ class ProjectXMLParser extends HXProject
|
||||
Reflect.setField(windows[id], "allowHighDPI", value == "true");
|
||||
|
||||
case "color-depth":
|
||||
Reflect.setField(windows[id], "colorDepth", Std.parseInt(value));
|
||||
var parsedValue = Std.parseInt(value);
|
||||
if (parsedValue == null)
|
||||
{
|
||||
Log.warn("Ignoring unknown " + name + "=\"" + value + "\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
Reflect.setField(windows[id], "colorDepth", parsedValue);
|
||||
}
|
||||
|
||||
default:
|
||||
if (Reflect.hasField(WindowData.expectedFields, name))
|
||||
|
||||
Reference in New Issue
Block a user