Add more fields
This commit is contained in:
@@ -3,6 +3,7 @@ package lime.utils;
|
|||||||
|
|
||||||
import haxe.Serializer;
|
import haxe.Serializer;
|
||||||
import haxe.Unserializer;
|
import haxe.Unserializer;
|
||||||
|
import lime.app.Future;
|
||||||
import lime.utils.Bytes;
|
import lime.utils.Bytes;
|
||||||
|
|
||||||
#if !macro
|
#if !macro
|
||||||
@@ -28,9 +29,7 @@ class AssetManifest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function fromFile (path:String):AssetManifest {
|
public static function fromBytes (bytes:Bytes):AssetManifest {
|
||||||
|
|
||||||
var bytes = Bytes.fromFile (path);
|
|
||||||
|
|
||||||
if (bytes != null) {
|
if (bytes != null) {
|
||||||
|
|
||||||
@@ -45,6 +44,31 @@ class AssetManifest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function fromFile (path:String):AssetManifest {
|
||||||
|
|
||||||
|
return fromBytes (Bytes.fromFile (path));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function loadFromBytes (bytes:Bytes):Future<AssetManifest> {
|
||||||
|
|
||||||
|
return Future.withValue (fromBytes (bytes));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function loadFromFile (path:String):Future<AssetManifest> {
|
||||||
|
|
||||||
|
return Bytes.loadFromFile (path).then (function (bytes) {
|
||||||
|
|
||||||
|
return Future.withValue (fromBytes (bytes));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function parse (data:String):AssetManifest {
|
public static function parse (data:String):AssetManifest {
|
||||||
|
|
||||||
#if !macro
|
#if !macro
|
||||||
|
|||||||
Reference in New Issue
Block a user