From 4d54fa591383aa65cdc0bb7b83ef6f9bb2b95a5e Mon Sep 17 00:00:00 2001 From: alexytomi <60690056+alexytomi@users.noreply.github.com> Date: Wed, 17 Sep 2025 01:39:55 +0800 Subject: [PATCH] add comments --- .../src/main/java/net/kdt/pojavlaunch/Tools.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java index f85c4b3ab..ef8c96f27 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/Tools.java @@ -79,6 +79,7 @@ import net.kdt.pojavlaunch.value.launcherprofiles.MinecraftProfile; import org.apache.commons.codec.binary.Hex; import org.apache.commons.io.IOUtils; +import org.libsdl.app.SDLControllerManager; import org.lwjgl.glfw.CallbackBridge; import java.io.BufferedInputStream; @@ -380,6 +381,11 @@ public final class Tools { // We never return otherwise. The process will be killed anyway, and thus we will become inactive } + /* + * This is does not work when debugging. This is not reliable. + * This is a monstrosity that races the mod, trying to ensure that when the folder is checked + * after extraction but before dlopen, it is empty, so it loads the bundled SDL2 we have instead + */ private static void startControllableMitigation(File gamedir) { File deleted = new File(gamedir + "/" + "controllable_natives"); try { @@ -1612,6 +1618,11 @@ public final class Tools { } static class SDL { + /** + * Initializes gamepad, joystick, and event subsystems. + * This triggers {@link SDLControllerManager#pollInputDevices()} and subsequently disables + * the emulated gamepad implementation. + */ public static native void initializeControllerSubsystems(); } }