Improve DefaultAssetLibrary.isLocal

This commit is contained in:
Joshua Granick
2016-10-05 09:47:30 -07:00
parent 276edbeb15
commit a5b85e357a

View File

@@ -412,16 +412,33 @@ class DefaultAssetLibrary extends AssetLibrary {
public override function isLocal (id:String, type:String):Bool {
#if (flash || windows || mac || linux)
#if flash
return className.exists (id);
#elseif html5
var requestedType = type != null ? cast (type, AssetType) : null;
return switch (requestedType) {
case FONT:
className.exists (id);
case IMAGE:
Preloader.images.exists (path.get (id));
default:
Preloader.loaders.exists (path.get (id));
}
#else
var requestedType = type != null ? cast (type, AssetType) : null;
if (requestedType == AssetType.FONT)
return className.exists (id);
else
return path.exists (id);
return true;
#end