From 97b7b84a5f3b292c3a1c1c4e4f87d22dfa3dc5de Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Mon, 10 Aug 2020 09:35:40 +0700 Subject: [PATCH] Attempt fix, error 139... --- .../java/com/kdt/minecraftegl/MinecraftEGLInitializer.java | 5 ++++- app/src/main/java/net/kdt/pojavlaunch/MainActivity.java | 7 ++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/kdt/minecraftegl/MinecraftEGLInitializer.java b/app/src/main/java/com/kdt/minecraftegl/MinecraftEGLInitializer.java index 3a401bc550..bcd2b4b82f 100644 --- a/app/src/main/java/com/kdt/minecraftegl/MinecraftEGLInitializer.java +++ b/app/src/main/java/com/kdt/minecraftegl/MinecraftEGLInitializer.java @@ -21,6 +21,8 @@ public class MinecraftEGLInitializer { public static void main(final String[] args) throws Throwable { try { + Tools.datapath = System.getenv("POJAV_DATA_DIR"); + // long surfaceAddress = Long.parseLong(args[0]); // Disable for testing @@ -40,7 +42,7 @@ public static void main(final String[] args) throws Throwable { private volatile long eglContext = 0l; @Override public void onSurfaceDestroyed(GL10 gl) { - Log.d("PojavLauncher", "Surface destroyed."); + System.out.println("Surface destroyed."); } @Override @@ -110,6 +112,7 @@ public void onSurfaceChanged(GL10 gl, int width, int height) { gtv.setPreserveEGLContextOnPause(true); gtv.setRenderMode(GLTextureView.RENDERMODE_CONTINUOUSLY); gtv.setSize(AndroidDisplay.windowWidth, AndroidDisplay.windowHeight); + } catch (Throwable th) { System.err.println("UNEXCEPTED SHUTTING DOWN"); th.printStackTrace(); diff --git a/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java b/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java index 9bfef9a63f..ad59dafd1c 100644 --- a/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java +++ b/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java @@ -1138,8 +1138,10 @@ public void onPrintLine(String text) { shell.initInputStream(this); shell.writeToProcess("base=/system"); + shell.writeToProcess("export POJAV_DATA_DIR=" + Tools.datapath); shell.writeToProcess("export CLASSPATH=" + getApplicationInfo().publicSourceDir); // ":" + launchClassPath + "\n"); shell.writeToProcess("export HOME=" + Tools.MAIN_PATH); + shell.writeToProcess("export MESA_GLSL_CACHE_DIR=$POJAV_DATA_DIR/cache"); String argStr = ""; for (String arg : launchArgs) { argStr = argStr + " " + arg; @@ -1562,11 +1564,6 @@ public void onClick(DialogInterface p1, int p2) // Toast.makeText(MainActivity.this, "Could not exit. Please force close this app.", Toast.LENGTH_LONG).show(); } - - private void fullyExit() - { - // TODO: Implement this method - } }) .show(); }