- [Custom controls] Add special buttons: Scroll up, Scroll down.
- [Custom controls] Change shift press mode to switch hold state.
- Set GL4ES 1.1.5 as default to fix following bugs:
 + Banner, sheep, fish, etc... color issue.
 + Clouds rendering issue.
This commit is contained in:
khanhduytran0 2020-12-03 12:14:04 +07:00
parent ed48637903
commit 13d47bf015
4 changed files with 24 additions and 4 deletions

View File

@ -81,6 +81,14 @@ public class MainActivity extends BaseMainActivity {
setRightOverride(isDown); setRightOverride(isDown);
} }
break; break;
case ControlData.SPECIALBTN_SCROLLDOWN:
CallbackBridge.sendScroll(0, 0.1d);
break;
case ControlData.SPECIALBTN_SCROLLUP:
CallbackBridge.sendScroll(0, -0.1d);
break;
} }
} }
@ -97,6 +105,8 @@ public class MainActivity extends BaseMainActivity {
specialButtons[2].specialButtonListener specialButtons[2].specialButtonListener
= specialButtons[3].specialButtonListener = specialButtons[3].specialButtonListener
= specialButtons[5].specialButtonListener = specialButtons[5].specialButtonListener
= specialButtons[6].specialButtonListener
= specialButtons[7].specialButtonListener
= mTouchListener; = mTouchListener;
mControlLayout = findViewById(R.id.main_control_layout); mControlLayout = findViewById(R.id.main_control_layout);

View File

@ -129,7 +129,10 @@ public final class Tools
// javaArgList.add("-Dorg.lwjgl.libname=liblwjgl3.so"); // javaArgList.add("-Dorg.lwjgl.libname=liblwjgl3.so");
// javaArgList.add("-Dorg.lwjgl.system.jemalloc.libname=libjemalloc.so"); // javaArgList.add("-Dorg.lwjgl.system.jemalloc.libname=libjemalloc.so");
overrideableArgList.add("-Dorg.lwjgl.opengl.libname=libgl04es.so");
// overrideableArgList.add("-Dorg.lwjgl.opengl.libname=libgl04es.so");
overrideableArgList.add("-Dorg.lwjgl.opengl.libname=libgl4es_115.so");
// javaArgList.add("-Dorg.lwjgl.opengl.libname=libRegal.so"); // javaArgList.add("-Dorg.lwjgl.opengl.libname=libRegal.so");
// Enable LWJGL3 debug // Enable LWJGL3 debug

View File

@ -20,6 +20,8 @@ public class ControlData implements Cloneable
public static final int SPECIALBTN_MOUSESEC = -4; public static final int SPECIALBTN_MOUSESEC = -4;
public static final int SPECIALBTN_VIRTUALMOUSE = -5; public static final int SPECIALBTN_VIRTUALMOUSE = -5;
public static final int SPECIALBTN_MOUSEMID = -6; public static final int SPECIALBTN_MOUSEMID = -6;
public static final int SPECIALBTN_SCROLLUP = -7;
public static final int SPECIALBTN_SCROLLDOWN = -8;
private static ControlData[] SPECIAL_BUTTONS; private static ControlData[] SPECIAL_BUTTONS;
private static String[] SPECIAL_BUTTON_NAME_ARRAY; private static String[] SPECIAL_BUTTON_NAME_ARRAY;
@ -45,8 +47,10 @@ public class ControlData implements Cloneable
new ControlData("PRI", SPECIALBTN_MOUSEPRI, "${margin}", "${screen_height} - ${margin} * 3 - ${height} * 3"), new ControlData("PRI", SPECIALBTN_MOUSEPRI, "${margin}", "${screen_height} - ${margin} * 3 - ${height} * 3"),
new ControlData("SEC", SPECIALBTN_MOUSESEC, "${margin} * 3 + ${width} * 2", "${screen_height} - ${margin} * 3 - ${height} * 3"), new ControlData("SEC", SPECIALBTN_MOUSESEC, "${margin} * 3 + ${width} * 2", "${screen_height} - ${margin} * 3 - ${height} * 3"),
new ControlData("Mouse", SPECIALBTN_VIRTUALMOUSE, "${right}", "${margin}", false), new ControlData("Mouse", SPECIALBTN_VIRTUALMOUSE, "${right}", "${margin}", false),
new ControlData("MID", SPECIALBTN_MOUSEMID, "${margin}", "${margin}") new ControlData("MID", SPECIALBTN_MOUSEMID, "${margin}", "${margin}"),
new ControlData("SCROLLUP", SPECIALBTN_SCROLLUP, "${margin}", "${margin}"),
new ControlData("SCROLLDOWN", SPECIALBTN_SCROLLDOWN, "${margin}", "${margin}")
}; };
SPECIAL_BUTTONS = specialButtons; SPECIAL_BUTTONS = specialButtons;
} }

View File

@ -38,7 +38,10 @@ public class CustomControls
this.mControlDataList.add(new ControlData(ctx, R.string.control_right, LWJGLGLFWKeycode.GLFW_KEY_D, "${margin} * 3 + ${width} * 2", "${bottom} - ${margin} * 2 - ${height}", true)); this.mControlDataList.add(new ControlData(ctx, R.string.control_right, LWJGLGLFWKeycode.GLFW_KEY_D, "${margin} * 3 + ${width} * 2", "${bottom} - ${margin} * 2 - ${height}", true));
this.mControlDataList.add(new ControlData(ctx, R.string.control_inventory, LWJGLGLFWKeycode.GLFW_KEY_E, "${margin} * 3 + ${width} * 2", "${bottom} - ${margin}", true)); this.mControlDataList.add(new ControlData(ctx, R.string.control_inventory, LWJGLGLFWKeycode.GLFW_KEY_E, "${margin} * 3 + ${width} * 2", "${bottom} - ${margin}", true));
this.mControlDataList.add(new ControlData(ctx, R.string.control_shift, LWJGLGLFWKeycode.GLFW_KEY_LEFT_SHIFT, "${margin} * 2 + ${width}", "${screen_height} - ${margin} * 2 - ${height} * 2", true));
ControlData shiftData = new ControlData(ctx, R.string.control_shift, LWJGLGLFWKeycode.GLFW_KEY_LEFT_SHIFT, "${margin} * 2 + ${width}", "${screen_height} - ${margin} * 2 - ${height} * 2", true);
shiftData.isToggle = true;
this.mControlDataList.add(shiftData);
this.mControlDataList.add(new ControlData(ctx, R.string.control_jump, LWJGLGLFWKeycode.GLFW_KEY_SPACE, "${right} - ${margin} * 2 - ${width}", "${bottom} - ${margin} * 2 - ${height}", true)); this.mControlDataList.add(new ControlData(ctx, R.string.control_jump, LWJGLGLFWKeycode.GLFW_KEY_SPACE, "${right} - ${margin} * 2 - ${width}", "${bottom} - ${margin} * 2 - ${height}", true));
} }