Add Neko loader path init

This commit is contained in:
Joshua Granick
2014-06-19 15:06:22 -07:00
parent bbffdfc1b2
commit 0b6433d04d
2 changed files with 13 additions and 2 deletions

View File

@@ -81,4 +81,15 @@ class ApplicationMain {
} }
#if neko
@:noCompletion public static function __init__ () {
untyped $loader.path = $array (haxe.io.Path.directory (Sys.executablePath ()), $loader.path);
untyped $loader.path = $array ("./", $loader.path);
untyped $loader.path = $array ("@executable_path/", $loader.path);
}
#end
} }

View File

@@ -154,7 +154,7 @@ class DefaultAssetLibrary extends AssetLibrary {
#if flash #if flash
return cast (Type.createInstance (className.get (id), []), ByteArray); return cast (Type.createInstance (className.get (id), []), ByteArray);
#elseif js #elseif js
var bytes:ByteArray = null; var bytes:ByteArray = null;
@@ -174,7 +174,7 @@ class DefaultAssetLibrary extends AssetLibrary {
bytes = null; bytes = null;
} }
if (bytes != null) { if (bytes != null) {
bytes.position = 0; bytes.position = 0;