mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
Minimize code
This commit is contained in:
parent
fe82d4418c
commit
6f5ed8990b
@ -164,19 +164,12 @@ int diffX, diffY, diffGrabX, diffGrabY;
|
|||||||
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_GLFW_nglfwPollEvents(JNIEnv* env, jclass clazz) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_GLFW_nglfwPollEvents(JNIEnv* env, jclass clazz) {
|
||||||
if (!isInputReady) isInputReady = true;
|
if (!isInputReady) isInputReady = true;
|
||||||
if (isUseStackQueueCall) {
|
if (isUseStackQueueCall) {
|
||||||
if (!isGrabbing && (diffX != lastCursorX || diffY != lastCursorY)) {
|
if (diffX != lastCursorX || diffY != lastCursorY) {
|
||||||
diffX = lastCursorX;
|
diffX = lastCursorX;
|
||||||
diffY = lastCursorY;
|
diffY = lastCursorY;
|
||||||
|
|
||||||
if (GLFW_invoke_CursorPos) {
|
if (GLFW_invoke_CursorPos) {
|
||||||
GLFW_invoke_CursorPos(showingWindow, (double) lastCursorX), (double) lastCursorY));
|
GLFW_invoke_CursorPos(showingWindow, (double) (isGrabbing ? grabCursorX : lastCursorX), (double) (isGrabbing ? grabCursorY : lastCursorY));
|
||||||
}
|
|
||||||
} else if (isGrabbing && (diffGrabX != grabCursorX || diffGrabY != grabCursorY)) {
|
|
||||||
diffGrabX = grabCursorX;
|
|
||||||
diffGrabY = grabCursorY;
|
|
||||||
|
|
||||||
if (GLFW_invoke_CursorPos) {
|
|
||||||
GLFW_invoke_CursorPos(showingWindow, (double) grabCursorX, (double) grabCursorY);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user