Eval, HXP, asset library fixes

This commit is contained in:
Joshua Granick
2018-07-25 20:27:05 -07:00
parent 536450620f
commit 534c6cd7ce
17 changed files with 1083 additions and 1006 deletions

View File

@@ -19,7 +19,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
package haxe.io; #if (!hl && !js)
package haxe.io; #if (!hl && !js && !eval)
#if cpp
@@ -968,4 +968,41 @@ class Bytes {
}
#elseif eval
extern class Bytes {
function new(length:Int,b:BytesData):Void;
public var length(default,null):Int;
public function get( pos : Int ) : Int;
public function set( pos : Int, v : Int ) : Void;
public function blit( pos : Int, src : Bytes, srcpos : Int, len : Int ) : Void;
public function fill( pos : Int, len : Int, value : Int ):Void;
public function sub( pos : Int, len : Int ) : Bytes;
public function compare( other : Bytes ) : Int;
public function getDouble( pos : Int ) : Float;
public function getFloat( pos : Int ) : Float;
public function setDouble( pos : Int, v : Float ) : Void;
public function setFloat( pos : Int, v : Float ) : Void;
public function getUInt16( pos : Int ) : Int;
public function setUInt16( pos : Int, v : Int ) : Void;
public function getInt32( pos : Int ) : Int;
public function getInt64( pos : Int ) : haxe.Int64;
public function setInt32( pos : Int, v : Int ) : Void;
public function setInt64( pos : Int, v : haxe.Int64 ) : Void;
public function getString( pos : Int, len : Int ) : String;
public function toString() : String;
public function toHex() : String;
public function getData() : BytesData;
public static function alloc( length : Int ) : Bytes;
@:pure
public static function ofString( s : String ) : Bytes;
public static function ofData( b : BytesData ) : Bytes;
public static function fastGet( b : BytesData, pos : Int ) : Int;
static function __init__():Void {
haxe.io.Error;
}
}
#end

View File

@@ -109,7 +109,7 @@ class JPEG {
#if java
#elseif (sys && (!disable_cffi || !format) && !macro)
#elseif (sys && lime_cffi && (!disable_cffi || !format) && !macro)
if (CFFI.enabled) {

View File

@@ -109,7 +109,7 @@ class PNG {
#if java
#elseif (sys && (!disable_cffi || !format) && !macro)
#elseif (sys && lime_cffi && (!disable_cffi || !format) && !macro)
if (CFFI.enabled) {

View File

@@ -46,24 +46,26 @@ class DefineMacro {
Compiler.define ("native");
var cffi = (!Context.defined ("nocffi") && !Context.defined ("eval"));
if (Context.defined ("ios") || Context.defined ("android") || Context.defined ("tizen")) {
Compiler.define ("mobile");
if (!Context.defined ("nocffi")) Compiler.define ("lime-opengles");
if (cffi) Compiler.define ("lime-opengles");
} else if (Context.defined ("emscripten")) {
Compiler.define ("web");
if (!Context.defined ("nocffi")) Compiler.define ("lime-opengles");
if (cffi) Compiler.define ("lime-opengles");
} else {
Compiler.define ("desktop");
if (!Context.defined ("nocffi")) Compiler.define ("lime-opengl");
if (cffi) Compiler.define ("lime-opengl");
}
if (!Context.defined ("nocffi")) {
if (cffi) {
Compiler.define ("lime-cffi");
@@ -73,6 +75,10 @@ class DefineMacro {
Compiler.define ("lime-harfbuzz");
Compiler.define ("lime-vorbis");
} else {
Compiler.define ("disable-cffi");
}
}

View File

@@ -284,7 +284,7 @@ class System {
return flash.Lib.getTimer ();
#elseif ((js && !nodejs) || electron)
return Std.int (Browser.window.performance.now ());
#elseif (!disable_cffi && !macro)
#elseif (lime_cffi && !macro)
return cast NativeCFFI.lime_system_get_timer ();
#elseif cpp
return Std.int (untyped __global__.__time_stamp () * 1000);

View File

@@ -9,6 +9,7 @@ import hxp.project.Icon;
import hxp.project.Platform;
import hxp.project.PlatformType;
import hxp.helpers.AIRHelper;
import hxp.helpers.AssetHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
import hxp.helpers.FlashHelper;
@@ -243,6 +244,8 @@ class AIRPlatform extends FlashPlatform {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
var destination = targetDirectory + "/bin/";
PathHelper.mkdir (destination);

View File

@@ -5,6 +5,7 @@ import haxe.io.Path;
import haxe.Template;
import hxp.helpers.AndroidHelper;
import hxp.helpers.ArrayHelper;
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
@@ -282,6 +283,8 @@ class AndroidPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
for (asset in project.assets) {

View File

@@ -4,6 +4,7 @@ package;
import haxe.io.Path;
import haxe.Json;
import haxe.Template;
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
@@ -285,6 +286,8 @@ class EmscriptenPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
for (asset in project.assets) {

View File

@@ -4,6 +4,7 @@ package;
import haxe.io.Path;
import haxe.Json;
import haxe.Template;
import hxp.helpers.AssetHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
import hxp.helpers.FlashHelper;
@@ -190,6 +191,8 @@ class FlashPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
var destination = targetDirectory + "/bin/";
PathHelper.mkdir (destination);

View File

@@ -6,6 +6,7 @@ import haxe.Template;
#if lime
import lime.text.Font;
#end
import hxp.helpers.AssetHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.ElectronHelper;
import hxp.helpers.FileHelper;
@@ -186,6 +187,8 @@ class HTML5Platform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
var destination = targetDirectory + "/bin/";

View File

@@ -6,6 +6,7 @@ import haxe.io.Path;
import haxe.Json;
import haxe.Template;
import hxp.helpers.ArrayHelper;
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
@@ -462,6 +463,8 @@ class IOSPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
for (asset in project.assets) {

View File

@@ -3,6 +3,7 @@ package;
import haxe.io.Path;
import haxe.Template;
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
@@ -349,6 +350,8 @@ class LinuxPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
//initialize (project);

View File

@@ -3,6 +3,7 @@ package;
import haxe.io.Path;
import haxe.Template;
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.CSHelper;
import hxp.helpers.DeploymentHelper;
@@ -315,6 +316,8 @@ class MacPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
if (project.targetFlags.exists ("xml")) {

View File

@@ -5,6 +5,7 @@ package;
import haxe.io.Path;
import haxe.Json;
import haxe.Template;
import hxp.helpers.AssetHelper;
import hxp.helpers.ArrayHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.DeploymentHelper;
@@ -358,6 +359,8 @@ class TVOSPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
for (asset in project.assets) {

View File

@@ -3,6 +3,7 @@ package;
import haxe.io.Path;
import haxe.Template;
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
@@ -138,6 +139,8 @@ class TizenPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
// project = project.clone ();
for (asset in project.assets) {

View File

@@ -4,6 +4,7 @@ package;
import haxe.io.Path;
import haxe.Template;
import hxp.project.Icon;
import hxp.helpers.AssetHelper;
import hxp.helpers.CPPHelper;
import hxp.helpers.DeploymentHelper;
import hxp.helpers.FileHelper;
@@ -537,6 +538,8 @@ class WindowsPlatform extends PlatformTarget {
public override function update ():Void {
AssetHelper.processLibraries (project, targetDirectory);
if (targetType == "winjs") {
updateUWP ();

View File

@@ -0,0 +1 @@
-lib lime