Centralize AssetManifest base path logic (still need to improve this system)

This commit is contained in:
Joshua Granick
2017-01-24 09:46:28 -08:00
parent 5ac0ed5caf
commit ca8c0c5a48
4 changed files with 27 additions and 20 deletions

View File

@@ -114,7 +114,9 @@ import sys.FileSystem;
if (bytes != null) {
__fromManifest (AssetManifest.fromBytes (bytes));
var manifest = AssetManifest.fromBytes (bytes);
manifest.basePath = rootPath;
__fromManifest (manifest);
} else {
@@ -124,6 +126,7 @@ import sys.FileSystem;
if (manifest != null) {
manifest.basePath = rootPath;
__fromManifest (manifest);
} else {
@@ -157,23 +160,6 @@ import sys.FileSystem;
}
private override function __fromManifest (manifest:AssetManifest):Void {
super.__fromManifest (manifest);
if (rootPath != "") {
for (asset in manifest.assets) {
paths.set (asset.id, rootPath + asset.path);
}
}
}
}