mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 07:05:40 -04:00
Move force trigger screen size to GLFW stub side
This commit is contained in:
parent
eb349a1573
commit
fee541c9a4
@ -631,7 +631,7 @@ public class MainActivity extends LoggableActivity implements OnTouchListener, O
|
|||||||
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
case MotionEvent.ACTION_POINTER_DOWN: // 5
|
||||||
CallbackBridge.sendPrepareGrabInitialPos();
|
CallbackBridge.sendPrepareGrabInitialPos();
|
||||||
|
|
||||||
CallbackBridge.sendMouseKeycode(!CallbackBridge.mouseLeft ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT, 0, true);
|
CallbackBridge.sendMouseKeycode(CallbackBridge.mouseLeft ? LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_LEFT : LWJGLGLFWKeycode.GLFW_MOUSE_BUTTON_RIGHT, 0, true);
|
||||||
initialX = x;
|
initialX = x;
|
||||||
initialY = y;
|
initialY = y;
|
||||||
|
|
||||||
|
@ -29,14 +29,11 @@ public class CallbackBridge {
|
|||||||
sendMouseKeycode(button, 0, state == 1);
|
sendMouseKeycode(button, 0, state == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean threadAttached, screenSizeSet;
|
private static boolean threadAttached;
|
||||||
public static void sendCursorPos(int x, int y) {
|
public static void sendCursorPos(int x, int y) {
|
||||||
if (!threadAttached) {
|
if (!threadAttached) {
|
||||||
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, isMinecraft1p12, MainActivity.isInputStackCall);
|
threadAttached = CallbackBridge.nativeAttachThreadToOther(true, isMinecraft1p12, MainActivity.isInputStackCall);
|
||||||
}
|
}
|
||||||
if (!screenSizeSet) {
|
|
||||||
screenSizeSet = nativeSendScreenSize(windowWidth, windowHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
DEBUG_STRING.append("CursorPos=" + x + ", " + y + "\n");
|
DEBUG_STRING.append("CursorPos=" + x + ", " + y + "\n");
|
||||||
mouseX = x;
|
mouseX = x;
|
||||||
@ -136,7 +133,7 @@ public class CallbackBridge {
|
|||||||
private static native void nativeSendKey(int key, int scancode, int action, int mods);
|
private static native void nativeSendKey(int key, int scancode, int action, int mods);
|
||||||
private static native void nativeSendMouseButton(int button, int action, int mods);
|
private static native void nativeSendMouseButton(int button, int action, int mods);
|
||||||
private static native void nativeSendScroll(double xoffset, double yoffset);
|
private static native void nativeSendScroll(double xoffset, double yoffset);
|
||||||
private static native boolean nativeSendScreenSize(int width, int height);
|
private static native void nativeSendScreenSize(int width, int height);
|
||||||
|
|
||||||
public static native boolean nativeIsGrabbing();
|
public static native boolean nativeIsGrabbing();
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendMouseButton(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendScreenSize(JNIEnv* env, jclass clazz, jint width, jint height) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendScreenSize(JNIEnv* env, jclass clazz, jint width, jint height) {
|
||||||
if (isInputReady) {
|
if (isInputReady) {
|
||||||
if (GLFW_invoke_FramebufferSize) {
|
if (GLFW_invoke_FramebufferSize) {
|
||||||
if (isUseStackQueueCall) {
|
if (isUseStackQueueCall) {
|
||||||
@ -297,7 +297,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendScreenSi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (isInputReady && (GLFW_invoke_FramebufferSize || GLFW_invoke_WindowSize));
|
// return (isInputReady && (GLFW_invoke_FramebufferSize || GLFW_invoke_WindowSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendScroll(JNIEnv* env, jclass clazz, jdouble xoffset, jdouble yoffset) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSendScroll(JNIEnv* env, jclass clazz, jdouble xoffset, jdouble yoffset) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user