Merge pull request #1447 from chatziko/rootPath-improvements
rootPath-related improvements
This commit is contained in:
@@ -241,11 +241,10 @@ import flash.media.Sound;
|
||||
}
|
||||
else
|
||||
{
|
||||
var basePath = rootPath;
|
||||
if (basePath == null) basePath = "";
|
||||
if (basePath != "" && !StringTools.endsWith(basePath, "/")) basePath += "/";
|
||||
var basePath = rootPath == null || rootPath == "" ? "" : Path.addTrailingSlash(rootPath);
|
||||
var libPath = paths.exists(id) ? paths.get(id) : id;
|
||||
|
||||
var path = basePath + (paths.exists(id) ? paths.get(id) : id);
|
||||
var path = Path.join([basePath, libPath]);
|
||||
path = __cacheBreak(path);
|
||||
|
||||
Bytes.loadFromFile(path).onError(promise.error).onComplete(packedData_onComplete);
|
||||
|
||||
@@ -44,6 +44,12 @@ import sys.FileSystem;
|
||||
|
||||
rootPath = Reflect.field (config, "rootPath");
|
||||
|
||||
if(!StringTools.endsWith (rootPath, "/")) {
|
||||
|
||||
rootPath += "/";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (rootPath == null) {
|
||||
@@ -84,9 +90,9 @@ import sys.FileSystem;
|
||||
Assets.registerLibrary ("::library::", library);
|
||||
::else::Assets.libraryPaths["::library::"] = rootPath + "::resourceName::";
|
||||
::end::::end::::if (type == "bundle")::::if (embed)::
|
||||
bundle = AssetBundle.fromBytes(#if flash Bytes.ofData(new __ASSET__::flatName::() #else new __ASSET__::flatName::() #end));
|
||||
library = AssetLibrary.fromBundle(bundle);
|
||||
Assets.registerLibrary("::library::", library);
|
||||
bundle = AssetBundle.fromBytes (#if flash Bytes.ofData (new __ASSET__::flatName:: () #else new __ASSET__::flatName:: () #end));
|
||||
library = AssetLibrary.fromBundle (bundle);
|
||||
Assets.registerLibrary ("::library::", library);
|
||||
::else::Assets.bundlePaths["::library::"] = rootPath + "::resourceName::";
|
||||
::end::::end::::end::::end::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user