mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 00:29:50 -04:00
- Fix no renderer crash
- graphic lib is now non modifiable
This commit is contained in:
parent
35c508822e
commit
e716b5e72b
@ -260,17 +260,19 @@ public class JREUtils {
|
|||||||
public static int launchJavaVM(final LoggableActivity ctx,final List<String> JVMArgs) throws Throwable {
|
public static int launchJavaVM(final LoggableActivity ctx,final List<String> JVMArgs) throws Throwable {
|
||||||
JREUtils.relocateLibPath(ctx);
|
JREUtils.relocateLibPath(ctx);
|
||||||
final String graphicsLib = loadGraphicsLibrary();
|
final String graphicsLib = loadGraphicsLibrary();
|
||||||
List<String> userArgs = getJavaArgs(ctx,graphicsLib);
|
List<String> userArgs = getJavaArgs(ctx);
|
||||||
|
|
||||||
//Remove arguments that can interfere with the good working of the launcher
|
//Remove arguments that can interfere with the good working of the launcher
|
||||||
purgeArg(userArgs,"-Xms");
|
purgeArg(userArgs,"-Xms");
|
||||||
purgeArg(userArgs,"-Xmx");
|
purgeArg(userArgs,"-Xmx");
|
||||||
purgeArg(userArgs,"-d32");
|
purgeArg(userArgs,"-d32");
|
||||||
purgeArg(userArgs,"-d64");
|
purgeArg(userArgs,"-d64");
|
||||||
|
purgeArg(userArgs, "-Dorg.lwjgl.opengl.libname");
|
||||||
|
|
||||||
//Add automatically generated args
|
//Add automatically generated args
|
||||||
userArgs.add("-Xms" + LauncherPreferences.PREF_RAM_ALLOCATION + "M");
|
userArgs.add("-Xms" + LauncherPreferences.PREF_RAM_ALLOCATION + "M");
|
||||||
userArgs.add("-Xmx" + LauncherPreferences.PREF_RAM_ALLOCATION + "M");
|
userArgs.add("-Xmx" + LauncherPreferences.PREF_RAM_ALLOCATION + "M");
|
||||||
|
if(LOCAL_RENDERER != null) userArgs.add("-Dorg.lwjgl.opengl.libname=" + graphicsLib);
|
||||||
|
|
||||||
userArgs.addAll(JVMArgs);
|
userArgs.addAll(JVMArgs);
|
||||||
|
|
||||||
@ -309,10 +311,9 @@ public class JREUtils {
|
|||||||
* Gives an argument list filled with both the user args
|
* Gives an argument list filled with both the user args
|
||||||
* and the auto-generated ones (eg. the window resolution).
|
* and the auto-generated ones (eg. the window resolution).
|
||||||
* @param ctx The application context
|
* @param ctx The application context
|
||||||
* @param renderLib The name of the renderer used.
|
|
||||||
* @return A list filled with args.
|
* @return A list filled with args.
|
||||||
*/
|
*/
|
||||||
public static List<String> getJavaArgs(Context ctx, String renderLib) {
|
public static List<String> getJavaArgs(Context ctx) {
|
||||||
List<String> userArguments = parseJavaArguments(LauncherPreferences.PREF_CUSTOM_JAVA_ARGS);
|
List<String> userArguments = parseJavaArguments(LauncherPreferences.PREF_CUSTOM_JAVA_ARGS);
|
||||||
String[] overridableArguments = new String[]{
|
String[] overridableArguments = new String[]{
|
||||||
"-Djava.home=" + Tools.DIR_HOME_JRE,
|
"-Djava.home=" + Tools.DIR_HOME_JRE,
|
||||||
@ -323,7 +324,6 @@ public class JREUtils {
|
|||||||
"-Dos.version=Android-" + Build.VERSION.RELEASE,
|
"-Dos.version=Android-" + Build.VERSION.RELEASE,
|
||||||
"-Dpojav.path.minecraft=" + Tools.DIR_GAME_NEW,
|
"-Dpojav.path.minecraft=" + Tools.DIR_GAME_NEW,
|
||||||
"-Dpojav.path.private.account=" + Tools.DIR_ACCOUNT_NEW,
|
"-Dpojav.path.private.account=" + Tools.DIR_ACCOUNT_NEW,
|
||||||
"-Dorg.lwjgl.opengl.libname=" + renderLib,
|
|
||||||
|
|
||||||
//LWJGL 3 DEBUG FLAGS
|
//LWJGL 3 DEBUG FLAGS
|
||||||
//"-Dorg.lwjgl.util.Debug=true",
|
//"-Dorg.lwjgl.util.Debug=true",
|
||||||
@ -393,6 +393,7 @@ public class JREUtils {
|
|||||||
* @return The name of the loaded library
|
* @return The name of the loaded library
|
||||||
*/
|
*/
|
||||||
public static String loadGraphicsLibrary(){
|
public static String loadGraphicsLibrary(){
|
||||||
|
if(LOCAL_RENDERER == null) return null;
|
||||||
String renderLibrary;
|
String renderLibrary;
|
||||||
switch (LOCAL_RENDERER){
|
switch (LOCAL_RENDERER){
|
||||||
case "opengles2": renderLibrary = "libgl4es_114.so"; break;
|
case "opengles2": renderLibrary = "libgl4es_114.so"; break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user