Crash fixes
This commit is contained in:
@@ -373,7 +373,9 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
public void update(){
|
public void update(){
|
||||||
saves.update();
|
saves.update();
|
||||||
//update and load any requested assets
|
//update and load any requested assets
|
||||||
assets.update();
|
if(assets != null){
|
||||||
|
assets.update();
|
||||||
|
}
|
||||||
|
|
||||||
input.updateController();
|
input.updateController();
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.anuke.arc.assets.loaders.*;
|
|||||||
import io.anuke.arc.assets.loaders.resolvers.*;
|
import io.anuke.arc.assets.loaders.resolvers.*;
|
||||||
import io.anuke.arc.collection.*;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.files.*;
|
import io.anuke.arc.files.*;
|
||||||
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
|
|
||||||
@@ -25,6 +26,21 @@ public class MapPreviewLoader extends TextureLoader{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Texture loadSync(AssetManager manager, String fileName, FileHandle file, TextureParameter parameter){
|
||||||
|
try{
|
||||||
|
return super.loadSync(manager, fileName, file, parameter);
|
||||||
|
}catch(Throwable e){
|
||||||
|
e.printStackTrace();
|
||||||
|
try{
|
||||||
|
return new Texture(file);
|
||||||
|
}catch(Throwable e2){
|
||||||
|
e2.printStackTrace();
|
||||||
|
return new Texture("sprites/error.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, TextureParameter parameter){
|
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, TextureParameter parameter){
|
||||||
return Array.with(new AssetDescriptor<>("contentcreate", Content.class));
|
return Array.with(new AssetDescriptor<>("contentcreate", Content.class));
|
||||||
|
|||||||
Reference in New Issue
Block a user