[Input pipe] Try to fix the grab pos

This commit is contained in:
khanhduytran0 2020-12-18 06:19:42 +07:00
parent 08dc6e9fd8
commit b2e50e0a79
5 changed files with 7 additions and 9 deletions

View File

@ -24,7 +24,7 @@ android {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 156236 versionCode 156236
versionName "3.3.1b_6409b_20201210" versionName "3.3.1b_6409b_20201218"
multiDexEnabled true //important multiDexEnabled true //important
} }
@ -60,14 +60,13 @@ android {
dependencies { dependencies {
implementation 'javax.annotation:javax.annotation-api:1.3.2' implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'commons-codec:commons-codec:1.14' implementation 'commons-codec:commons-codec:1.14'
implementation 'com.wu-man:android-bsf-api:3.1.3' // implementation 'com.wu-man:android-bsf-api:3.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.0.0' implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0' implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0' implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.annotation:annotation:1.0.0' implementation 'androidx.annotation:annotation:1.0.0'
// implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.browser:browser:1.0.0' implementation 'androidx.browser:browser:1.0.0'
// implementation 'com.intuit.sdp:sdp-android:1.0.5' // implementation 'com.intuit.sdp:sdp-android:1.0.5'

View File

@ -1 +1 @@
20201201:1 20201218:1

View File

@ -6,7 +6,7 @@
* - Works with some bugs: * - Works with some bugs:
* + Modded versions gives broken stuff.. * + Modded versions gives broken stuff..
* *
* TODO: *
* - Implements glfwSetCursorPos() to handle grab camera pos correctly. * - Implements glfwSetCursorPos() to handle grab camera pos correctly.
*/ */
@ -201,12 +201,11 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetInputRead
return isUseStackQueueCall; return isUseStackQueueCall;
} }
JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetGrabbing(JNIEnv* env, jclass clazz, jboolean grabbing) { JNIEXPORT void JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeSetGrabbing(JNIEnv* env, jclass clazz, jboolean grabbing, jint xset, jint yset) {
isGrabbing = grabbing; isGrabbing = grabbing;
if (isGrabbing == JNI_TRUE) { if (isGrabbing == JNI_TRUE) {
// Center the cursor pointer grabCursorX = xset; // savedWidth / 2;
grabCursorX = savedWidth / 2; grabCursorY = yset; // savedHeight / 2;
grabCursorY = savedHeight / 2;
isPrepareGrabPos = true; isPrepareGrabPos = true;
} }
} }