mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-15 15:20:57 -08:00
parent
34be5ffc6c
commit
87f7e1f1c2
1 changed files with 11 additions and 11 deletions
|
|
@ -60,7 +60,6 @@ public class Schematics implements Loadable{
|
|||
private ObjectMap<CoreBlock, Seq<Schematic>> loadouts = new ObjectMap<>();
|
||||
private ObjectMap<CoreBlock, Schematic> defaultLoadouts = new ObjectMap<>();
|
||||
private @Nullable FrameBuffer shadowBuffer;
|
||||
private boolean triedCreatingShadowBuffer;
|
||||
private Texture errorTexture;
|
||||
private long lastClearTime;
|
||||
|
||||
|
|
@ -98,6 +97,17 @@ public class Schematics implements Loadable{
|
|||
});
|
||||
|
||||
all.sort();
|
||||
|
||||
if(shadowBuffer == null && !headless){
|
||||
Core.app.post(() -> {
|
||||
try{
|
||||
shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8);
|
||||
}catch(Exception e){
|
||||
Log.err(Strings.format("Failed to create shadow buffer (@x@): @. This is likely because a mod is setting maxSchematicSize too high. Don't do that.",
|
||||
maxSchematicSize + padding + 8, maxSchematicSize + padding + 8, Strings.getSimpleMessage(e)));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void loadLoadouts(){
|
||||
|
|
@ -212,16 +222,6 @@ public class Schematics implements Loadable{
|
|||
Tmp.m2.set(Draw.trans());
|
||||
FrameBuffer buffer = new FrameBuffer((schematic.width + padding) * resolution, (schematic.height + padding) * resolution);
|
||||
|
||||
if(shadowBuffer == null && !triedCreatingShadowBuffer){
|
||||
triedCreatingShadowBuffer = true;
|
||||
try{
|
||||
shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8);
|
||||
}catch(Exception e){
|
||||
Log.err(Strings.format("Failed to create shadow buffer (@x@): @. This is likely because a mod is setting maxSchematicSize too high. Don't do that.",
|
||||
maxSchematicSize + padding + 8, maxSchematicSize + padding + 8, Strings.getSimpleMessage(e)));
|
||||
}
|
||||
}
|
||||
|
||||
if(shadowBuffer != null){
|
||||
shadowBuffer.begin(Color.clear);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue