diff --git a/JavaApp/libs/compat-1.0.0.jar b/JavaApp/libs/compat-1.0.0.jar new file mode 100644 index 00000000..45b3a859 Binary files /dev/null and b/JavaApp/libs/compat-1.0.0.jar differ diff --git a/JavaApp/libs/javafx-mx.jar b/JavaApp/libs/javafx-mx.jar new file mode 100644 index 00000000..a5f42496 Binary files /dev/null and b/JavaApp/libs/javafx-mx.jar differ diff --git a/JavaApp/libs/jfxrt.jar b/JavaApp/libs/jfxrt.jar new file mode 100644 index 00000000..255a7974 Binary files /dev/null and b/JavaApp/libs/jfxrt.jar differ diff --git a/JavaApp/libs/jfxswt.jar b/JavaApp/libs/jfxswt.jar new file mode 100644 index 00000000..12c65dea Binary files /dev/null and b/JavaApp/libs/jfxswt.jar differ diff --git a/JavaApp/libs/sfntly-1.0.0.jar b/JavaApp/libs/sfntly-1.0.0.jar new file mode 100644 index 00000000..656b6644 Binary files /dev/null and b/JavaApp/libs/sfntly-1.0.0.jar differ diff --git a/JavaApp/src/main/java/net/kdt/pojavlaunch/PLaunchApp.java b/JavaApp/src/main/java/net/kdt/pojavlaunch/PLaunchApp.java index 0d73fa63..afbd6294 100644 --- a/JavaApp/src/main/java/net/kdt/pojavlaunch/PLaunchApp.java +++ b/JavaApp/src/main/java/net/kdt/pojavlaunch/PLaunchApp.java @@ -3,12 +3,10 @@ package net.kdt.pojavlaunch; import java.io.*; import java.util.Arrays; +import javafx.application.Application; + import org.lwjgl.glfw.CallbackBridge; -/* -import org.robovm.apple.foundation.*; -import org.robovm.apple.uikit.*; -import org.robovm.pods.dialog.*; -*/ + import net.kdt.pojavlaunch.prefs.*; import net.kdt.pojavlaunch.utils.*; import net.kdt.pojavlaunch.value.*; @@ -26,6 +24,20 @@ public class PLaunchApp { LauncherPreferences.loadPreferences(); } + public static void applicationDidFinishLaunching() { + + @Override + public boolean didFinishLaunching(UIApplication application, + Thread launchThread = new Thread() { + @Override + public void run() { + Application.launch(PLaunchJFXApp.class); + } + }; + launchThread.setDaemon(true); + launchThread.start(); + } + public static void launchMinecraft() { System.out.println("Saving GLES context"); JREUtils.saveGLContext(); diff --git a/JavaApp/src/main/java/net/kdt/pojavlaunch/PLaunchJFXApp.java b/JavaApp/src/main/java/net/kdt/pojavlaunch/PLaunchJFXApp.java new file mode 100644 index 00000000..488aa721 --- /dev/null +++ b/JavaApp/src/main/java/net/kdt/pojavlaunch/PLaunchJFXApp.java @@ -0,0 +1,20 @@ +package net.kdt.plaunch; + +import java.io.*; + +import javafx.application.Application; +import javafx.scene.Group; +import javafx.scene.Scene; +import javafx.scene.shape.Circle; +import javafx.stage.Stage; + +public class PLaunchJFXApp extends Application { + public void start(Stage stage) { + Circle circ = new Circle(40, 40, 30); + Group root = new Group(circ); + Scene scene = new Scene(root, 400, 300); + stage.setTitle("My JavaFX Application"); + stage.setScene(scene); + stage.show(); + } +} \ No newline at end of file diff --git a/JavaApp/src/main/java/org/lwjgl/glfw/CallbackBridge.java b/JavaApp/src/main/java/org/lwjgl/glfw/CallbackBridge.java index 6a68ca2e..92e00599 100644 --- a/JavaApp/src/main/java/org/lwjgl/glfw/CallbackBridge.java +++ b/JavaApp/src/main/java/org/lwjgl/glfw/CallbackBridge.java @@ -49,7 +49,7 @@ public class CallbackBridge { public static void callback_AppDelegate_didFinishLaunching(int width, int height) { windowWidth = width; windowHeight = height; - net.kdt.pojavlaunch.PLaunchApp.launchMinecraft(); + net.kdt.pojavlaunch.PLaunchApp.applicationDidFinishLaunching(); } public static boolean nativeIsGrabbing() { diff --git a/Natives/JavaLauncher.c b/Natives/JavaLauncher.c index 29b55685..c8007c2b 100644 --- a/Natives/JavaLauncher.c +++ b/Natives/JavaLauncher.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -45,7 +46,23 @@ int launchJVM(int argc, char *argv[]) { char *args_path = "/var/mobile/Documents/minecraft/overrideargs.txt"; char *log_path = "/var/mobile/Documents/minecraft/latestlog.txt"; - char *classpath = "/Applications/PojavLauncher.app/libs/launcher.jar:/Applications/PojavLauncher.app/libs/ExagearApacheCommons.jar:/Applications/PojavLauncher.app/libs/gson-2.8.6.jar:/Applications/PojavLauncher.app/libs/jsr305.jar:/Applications/PojavLauncher.app/libs/lwjgl3-minecraft.jar"; + char classpath[10000]; + + // "/Applications/PojavLauncher.app/libs/launcher.jar:/Applications/PojavLauncher.app/libs/ExagearApacheCommons.jar:/Applications/PojavLauncher.app/libs/gson-2.8.6.jar:/Applications/PojavLauncher.app/libs/jsr305.jar:/Applications/PojavLauncher.app/libs/lwjgl3-minecraft.jar"; + + // Generate classpath + DIR *d; + struct dirent *dir; + d = opendir("/Applications/PojavLauncher.app/libs"); + int cplen = 0; + if (d) { + while ((dir = readdir(d)) != NULL) { + cplen += sprintf(classpath, dir->d_name); + classpath[cplen] = ':'; + cplen ++; + } + closedir(d); + } debug("Staring logging STDIO as jrelog:V\n"); // Redirect stdio to latestlog.txt