its me optimization are you scared

This commit is contained in:
Yoshman29
2022-12-18 03:26:50 +01:00
parent 89b16b73a6
commit 30012ca900
2 changed files with 25 additions and 10 deletions
+1 -1
View File
@@ -1 +1 @@
1546
1548
+24 -9
View File
@@ -57,15 +57,30 @@ class AssetsLibraryList extends AssetLibrary {
}
public override function getAsset(id:String, type:String) {
if (!id.startsWith("assets/")) {
var ass = getAsset('assets/$id', type);
if (ass != null)
return ass;
}
for(e in libraries) {
var asset = e.getAsset(id, type);
if (asset != null)
return asset;
try {
#if cpp
cpp.vm.Gc.enable(false);
#end
if (!id.startsWith("assets/")) {
var ass = getAsset('assets/$id', type);
if (ass != null)
return ass;
}
for(e in libraries) {
var asset = e.getAsset(id, type);
if (asset != null)
return asset;
}
#if cpp
cpp.vm.Gc.enable(true);
#end
} catch(e) {
#if cpp
cpp.vm.Gc.enable(true);
#end
throw e;
}
return null;
}