mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -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?
|
// Should be compatible?
|
||||||
// overrideableArgList.add("-Dos.name=Android");
|
// overrideableArgList.add("-Dos.name=Android");
|
||||||
overrideableArgList.add("-Dos.name=Android");
|
overrideableArgList.add("-Dos.name=Linux");
|
||||||
overrideableArgList.add("-Dos.version=" + Build.VERSION.RELEASE);
|
overrideableArgList.add("-Dos.version=Android-" + Build.VERSION.RELEASE);
|
||||||
|
|
||||||
// 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");
|
||||||
|
@ -10,8 +10,8 @@ struct GLFWInputEvent {
|
|||||||
int i1, i2, i3, i4;
|
int i1, i2, i3, i4;
|
||||||
double d1, d2;
|
double d1, d2;
|
||||||
};
|
};
|
||||||
static struct GLFWInputEvent glfwInputEventArr[100];
|
GLFWInputEvent* glfwInputEventArr;
|
||||||
static int glfwInputEventIndex;
|
int glfwInputEventIndex;
|
||||||
|
|
||||||
#define EVENT_TYPE_CHAR 1000
|
#define EVENT_TYPE_CHAR 1000
|
||||||
#define EVENT_TYPE_CHAR_MODS 1001
|
#define EVENT_TYPE_CHAR_MODS 1001
|
||||||
@ -133,6 +133,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeAttachThreadToOt
|
|||||||
isUseStackQueueCall = (int) isUseStackQueue;
|
isUseStackQueueCall = (int) isUseStackQueue;
|
||||||
if (isUseStackQueue) {
|
if (isUseStackQueue) {
|
||||||
isPrepareGrabPos = true;
|
isPrepareGrabPos = true;
|
||||||
|
|
||||||
|
glfwInputEventArr = calloc(100, sizeof(GLFWInputEvent));
|
||||||
} else if (isAndroid) {
|
} else if (isAndroid) {
|
||||||
firstJavaVM = dalvikJavaVMPtr;
|
firstJavaVM = dalvikJavaVMPtr;
|
||||||
firstJNIEnv = dalvikJNIEnvPtr_ANDROID;
|
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) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendFramebufferSize(JNIEnv* env, jclass clazz, jint width, jint height) {
|
||||||
if (GLFW_invoke_FramebufferSize && isInputReady) {
|
if (GLFW_invoke_FramebufferSize && isInputReady) {
|
||||||
if (isUseStackQueueCall) {
|
if (isUseStackQueueCall) {
|
||||||
struct GLFWInputEvent curr = glfwInputEventArr[glfwInputEventIndex++];
|
struct GLFWInputEvent *curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||||
curr.type = EVENT_TYPE_FRAMEBUFFER_SIZE;
|
curr.type = EVENT_TYPE_FRAMEBUFFER_SIZE;
|
||||||
curr.i1 = width;
|
curr.i1 = width;
|
||||||
curr.i2 = height;
|
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) {
|
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 (GLFW_invoke_Key && isInputReady) {
|
||||||
if (isUseStackQueueCall) {
|
if (isUseStackQueueCall) {
|
||||||
struct GLFWInputEvent curr = glfwInputEventArr[glfwInputEventIndex++];
|
struct GLFWInputEvent *curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||||
curr.type = EVENT_TYPE_KEY;
|
curr.type = EVENT_TYPE_KEY;
|
||||||
curr.i1 = key;
|
curr.i1 = key;
|
||||||
curr.i2 = scancode;
|
curr.i2 = scancode;
|
||||||
@ -324,7 +326,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendMouseButton(
|
|||||||
isPrepareGrabPos = true;
|
isPrepareGrabPos = true;
|
||||||
} else if (GLFW_invoke_MouseButton) {
|
} else if (GLFW_invoke_MouseButton) {
|
||||||
if (isUseStackQueueCall) {
|
if (isUseStackQueueCall) {
|
||||||
struct GLFWInputEvent curr = glfwInputEventArr[glfwInputEventIndex++];
|
struct GLFWInputEvent *curr = glfwInputEventArr[glfwInputEventIndex++];
|
||||||
curr.type = EVENT_TYPE_MOUSE_BUTTON;
|
curr.type = EVENT_TYPE_MOUSE_BUTTON;
|
||||||
curr.i1 = button;
|
curr.i1 = button;
|
||||||
curr.i2 = action;
|
curr.i2 = action;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user