mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -04:00
Another try to fix 1.13+ input
This commit is contained in:
parent
47d3f59263
commit
617e3babbd
@ -204,8 +204,8 @@ public final class Tools
|
||||
|
||||
// Should be compatible?
|
||||
// overrideableArgList.add("-Dos.name=Android");
|
||||
overrideableArgList.add("-Dos.name=Android");
|
||||
overrideableArgList.add("-Dos.version=" + Build.VERSION.RELEASE);
|
||||
overrideableArgList.add("-Dos.name=Linux");
|
||||
overrideableArgList.add("-Dos.version=Android-" + Build.VERSION.RELEASE);
|
||||
|
||||
// javaArgList.add("-Dorg.lwjgl.libname=liblwjgl3.so");
|
||||
// javaArgList.add("-Dorg.lwjgl.system.jemalloc.libname=libjemalloc.so");
|
||||
|
@ -10,8 +10,8 @@ struct GLFWInputEvent {
|
||||
int i1, i2, i3, i4;
|
||||
double d1, d2;
|
||||
};
|
||||
static struct GLFWInputEvent glfwInputEventArr[100];
|
||||
static int glfwInputEventIndex;
|
||||
GLFWInputEvent* glfwInputEventArr;
|
||||
int glfwInputEventIndex;
|
||||
|
||||
#define EVENT_TYPE_CHAR 1000
|
||||
#define EVENT_TYPE_CHAR_MODS 1001
|
||||
@ -133,6 +133,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeAttachThreadToOt
|
||||
isUseStackQueueCall = (int) isUseStackQueue;
|
||||
if (isUseStackQueue) {
|
||||
isPrepareGrabPos = true;
|
||||
|
||||
glfwInputEventArr = calloc(100, sizeof(GLFWInputEvent));
|
||||
} else if (isAndroid) {
|
||||
firstJavaVM = dalvikJavaVMPtr;
|
||||
firstJNIEnv = dalvikJNIEnvPtr_ANDROID;
|
||||
@ -294,7 +296,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendCursorPos(JN
|
||||
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendFramebufferSize(JNIEnv* env, jclass clazz, jint width, jint height) {
|
||||
if (GLFW_invoke_FramebufferSize && isInputReady) {
|
||||
if (isUseStackQueueCall) {
|
||||
struct GLFWInputEvent curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||
struct GLFWInputEvent *curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||
curr.type = EVENT_TYPE_FRAMEBUFFER_SIZE;
|
||||
curr.i1 = width;
|
||||
curr.i2 = height;
|
||||
@ -306,7 +308,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendFramebufferS
|
||||
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendKey(JNIEnv* env, jclass clazz, jint key, jint scancode, jint action, jint mods) {
|
||||
if (GLFW_invoke_Key && isInputReady) {
|
||||
if (isUseStackQueueCall) {
|
||||
struct GLFWInputEvent curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||
struct GLFWInputEvent *curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||
curr.type = EVENT_TYPE_KEY;
|
||||
curr.i1 = key;
|
||||
curr.i2 = scancode;
|
||||
@ -324,7 +326,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendMouseButton(
|
||||
isPrepareGrabPos = true;
|
||||
} else if (GLFW_invoke_MouseButton) {
|
||||
if (isUseStackQueueCall) {
|
||||
struct GLFWInputEvent curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||
struct GLFWInputEvent *curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||
curr.type = EVENT_TYPE_MOUSE_BUTTON;
|
||||
curr.i1 = button;
|
||||
curr.i2 = action;
|
||||
|
Loading…
x
Reference in New Issue
Block a user