From 0b6433d04d4257ccb8c486614cd4368d52f61dc2 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 19 Jun 2014 15:06:22 -0700 Subject: [PATCH] Add Neko loader path init --- templates/haxe/ApplicationMain.hx | 11 +++++++++++ templates/haxe/DefaultAssetLibrary.hx | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/templates/haxe/ApplicationMain.hx b/templates/haxe/ApplicationMain.hx index 56611ee14..f6d99c3da 100644 --- a/templates/haxe/ApplicationMain.hx +++ b/templates/haxe/ApplicationMain.hx @@ -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 + + } \ No newline at end of file diff --git a/templates/haxe/DefaultAssetLibrary.hx b/templates/haxe/DefaultAssetLibrary.hx index 4a250a3a5..a0198ea26 100644 --- a/templates/haxe/DefaultAssetLibrary.hx +++ b/templates/haxe/DefaultAssetLibrary.hx @@ -154,7 +154,7 @@ class DefaultAssetLibrary extends AssetLibrary { #if flash return cast (Type.createInstance (className.get (id), []), ByteArray); - + #elseif js var bytes:ByteArray = null; @@ -174,7 +174,7 @@ class DefaultAssetLibrary extends AssetLibrary { bytes = null; } - + if (bytes != null) { bytes.position = 0;