fix: inputstrober not working

This commit is contained in:
minjaesong
2026-04-04 22:59:30 +09:00
parent 73c7c8942e
commit 8eff89a7cb
2 changed files with 13 additions and 8 deletions

View File

@@ -336,7 +336,7 @@ public class App implements ApplicationListener {
"xinput", "xbox", "game", "joy", "pad"
};
public static InputStrober inputStrober;
public static InputStrober inputStrober; // set by IME.kt loading thread
public static long bogoflops = 0L;
@@ -1275,13 +1275,12 @@ public class App implements ApplicationListener {
false,
64, false, 203f/255f, false
);
Lang.invoke();
printdbg(this, "Font done at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
fontSmallNumbers = TinyAlphNum.INSTANCE;
fontBigNumbers = BigAlphNum.INSTANCE;
printdbg(this, "Font done at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
try {
audioDevice = Gdx.audio.newAudioDevice(48000, false);
}
@@ -1290,14 +1289,19 @@ public class App implements ApplicationListener {
System.err.println("[AppLoader] failed to create audio device: Audio device occupied by Exclusive Mode Device? (e.g. ASIO4all)");
}
IME.invoke();
inputStrober = InputStrober.INSTANCE;
printdbg(this, "IME done (loading thread) at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
printdbg(this, "AudioDevice done at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
IME.invoke(); // calls `App.inputStrober = InputStrober` on our behalf
printdbg(this, "IME done at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
// Set GL thread reference for CommonResourcePool dispatch
CommonResourcePool.INSTANCE.setGLThread(Thread.currentThread());
// Launch loading thread for ModMgr + slow resource loading
postInitLoadingThread = new Thread(() -> {
Lang.invoke();
printdbg(this, "Lang done (loading thread) at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
ModMgr.INSTANCE.invoke(); // triggers module init block + EntryPoint.invoke() calls
printdbg(this, "ModMgr done (loading thread) at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");

View File

@@ -1,6 +1,5 @@
package net.torvald.terrarum.gamecontroller
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.graphics.g2d.TextureRegion
@@ -111,6 +110,8 @@ object IME {
printdbg(this, "Registering High layer ${it.nameWithoutExtension.lowercase()}")
registerHighLayer(it.nameWithoutExtension.lowercase(), parseImeFile(it))
}
App.inputStrober = InputStrober
}, "Terrarum-IMELoader")
layoutLoadingThread.isDaemon = true
layoutLoadingThread.start()