diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java index c1cfe2406f..87bb06ade2 100644 --- a/core/src/mindustry/ClientLauncher.java +++ b/core/src/mindustry/ClientLauncher.java @@ -105,20 +105,12 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform @Override public Sound loadSync(AssetManager manager, String fileName, Fi file, SoundParameter parameter){ if(parameter != null && parameter.sound != null){ - mainExecutor.submit(() -> parameter.sound.load(file)); + parameter.sound.loadLazy(file); return parameter.sound; }else{ Sound sound = new Sound(); - - mainExecutor.submit(() -> { - try{ - sound.load(file); - }catch(Throwable t){ - Log.err("Error loading sound: " + file, t); - } - }); - + sound.loadLazy(file); return sound; } } diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 92c0ed6b37..25a87693ac 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -265,7 +265,7 @@ public class Vars implements Loadable{ public static Locale[] locales; //the main executor will only have at most [cores] number of threads active - public static ExecutorService mainExecutor = Threads.executor("Main Executor", OS.cores); + public static ExecutorService mainExecutor = Core.executor; public static FileTree tree = new FileTree(); public static Net net; diff --git a/core/src/mindustry/audio/SoundPriority.java b/core/src/mindustry/audio/SoundPriority.java index 4f9bbb7062..7727ab5acd 100644 --- a/core/src/mindustry/audio/SoundPriority.java +++ b/core/src/mindustry/audio/SoundPriority.java @@ -78,7 +78,7 @@ public class SoundPriority{ sameGroup(shootArc, shootPulsar); for(var sound : Core.assets.getAll(Sound.class, new Seq<>())){ - sound.setMinConcurrentInterrupt(Math.min(0.25f, sound.getLength() * 0.5f)); + sound.setMinConcurrentInterruptFraction(0.25f, 0.5f); } mechStepSmall.setMinConcurrentInterrupt(0.5f); diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index dc1366567a..ba589435ce 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -579,9 +579,8 @@ public class Renderer implements ApplicationListener{ ui.showInfo("@screenshot.invalid"); return; } + try{ - - FrameBuffer buffer = new FrameBuffer(w, h); drawWeather = false; diff --git a/gradle.properties b/gradle.properties index 3064df5a95..9c6ef94aec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,4 +26,4 @@ org.gradle.caching=true org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 android.enableR8.fullMode=false -archash=6ea6355ee3 +archash=6e3c0bbc30