mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-06 08:38:30 +09:00
fix: inputstrober not working
This commit is contained in:
@@ -336,7 +336,7 @@ public class App implements ApplicationListener {
|
|||||||
"xinput", "xbox", "game", "joy", "pad"
|
"xinput", "xbox", "game", "joy", "pad"
|
||||||
};
|
};
|
||||||
|
|
||||||
public static InputStrober inputStrober;
|
public static InputStrober inputStrober; // set by IME.kt loading thread
|
||||||
|
|
||||||
public static long bogoflops = 0L;
|
public static long bogoflops = 0L;
|
||||||
|
|
||||||
@@ -1275,13 +1275,12 @@ public class App implements ApplicationListener {
|
|||||||
false,
|
false,
|
||||||
64, false, 203f/255f, false
|
64, false, 203f/255f, false
|
||||||
);
|
);
|
||||||
Lang.invoke();
|
|
||||||
|
|
||||||
printdbg(this, "Font done at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
|
|
||||||
|
|
||||||
fontSmallNumbers = TinyAlphNum.INSTANCE;
|
fontSmallNumbers = TinyAlphNum.INSTANCE;
|
||||||
fontBigNumbers = BigAlphNum.INSTANCE;
|
fontBigNumbers = BigAlphNum.INSTANCE;
|
||||||
|
|
||||||
|
printdbg(this, "Font done at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
audioDevice = Gdx.audio.newAudioDevice(48000, false);
|
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)");
|
System.err.println("[AppLoader] failed to create audio device: Audio device occupied by Exclusive Mode Device? (e.g. ASIO4all)");
|
||||||
}
|
}
|
||||||
|
|
||||||
IME.invoke();
|
printdbg(this, "AudioDevice done at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
|
||||||
inputStrober = InputStrober.INSTANCE;
|
|
||||||
printdbg(this, "IME done (loading thread) 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
|
// Set GL thread reference for CommonResourcePool dispatch
|
||||||
CommonResourcePool.INSTANCE.setGLThread(Thread.currentThread());
|
CommonResourcePool.INSTANCE.setGLThread(Thread.currentThread());
|
||||||
// Launch loading thread for ModMgr + slow resource loading
|
// Launch loading thread for ModMgr + slow resource loading
|
||||||
postInitLoadingThread = new Thread(() -> {
|
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
|
ModMgr.INSTANCE.invoke(); // triggers module init block + EntryPoint.invoke() calls
|
||||||
|
|
||||||
printdbg(this, "ModMgr done (loading thread) at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
|
printdbg(this, "ModMgr done (loading thread) at "+((System.nanoTime() - t1) / 1000000000.0)+" seconds");
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package net.torvald.terrarum.gamecontroller
|
package net.torvald.terrarum.gamecontroller
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx
|
|
||||||
import com.badlogic.gdx.files.FileHandle
|
import com.badlogic.gdx.files.FileHandle
|
||||||
import com.badlogic.gdx.graphics.Pixmap
|
import com.badlogic.gdx.graphics.Pixmap
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
import com.badlogic.gdx.graphics.g2d.TextureRegion
|
||||||
@@ -111,6 +110,8 @@ object IME {
|
|||||||
printdbg(this, "Registering High layer ${it.nameWithoutExtension.lowercase()}")
|
printdbg(this, "Registering High layer ${it.nameWithoutExtension.lowercase()}")
|
||||||
registerHighLayer(it.nameWithoutExtension.lowercase(), parseImeFile(it))
|
registerHighLayer(it.nameWithoutExtension.lowercase(), parseImeFile(it))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
App.inputStrober = InputStrober
|
||||||
}, "Terrarum-IMELoader")
|
}, "Terrarum-IMELoader")
|
||||||
layoutLoadingThread.isDaemon = true
|
layoutLoadingThread.isDaemon = true
|
||||||
layoutLoadingThread.start()
|
layoutLoadingThread.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user