Android root path changes (fix #1346)

This commit is contained in:
Joshua Granick
2019-08-22 08:00:55 -07:00
parent f233d967e5
commit 80867b3f62
2 changed files with 10 additions and 1 deletions

View File

@@ -774,7 +774,7 @@ class AssetLibrary
@:noCompletion private function __resolvePath(path:String):String @:noCompletion private function __resolvePath(path:String):String
{ {
path = StringTools.replace(path, "\\", "/"); path = StringTools.replace(path, "\\", "/");
var colonIdx:Int = path.indexOf(":"); var colonIdx:Int = path.indexOf(":");
if (StringTools.startsWith(path, "http") && colonIdx > 0) if (StringTools.startsWith(path, "http") && colonIdx > 0)
{ {
@@ -787,6 +787,13 @@ class AssetLibrary
path = StringTools.replace(path, "//", "/"); path = StringTools.replace(path, "//", "/");
} }
#if android
if (StringTools.startsWith(path, "./"))
{
path = path.substr(2);
}
#end
if (path.indexOf("./") > -1) if (path.indexOf("./") > -1)
{ {
var split = path.split("/"); var split = path.split("/");

View File

@@ -39,6 +39,8 @@ import sys.FileSystem;
#if (ios || tvos || emscripten) #if (ios || tvos || emscripten)
rootPath = "assets/"; rootPath = "assets/";
#elseif android
rootPath = "";
#elseif console #elseif console
rootPath = lime.system.System.applicationDirectory; rootPath = lime.system.System.applicationDirectory;
#else #else