Fixed bug 3128 - Removing all the static variables from android SDLActivity and accompanying JNI calls.

owen

I removed all the static variables from SDLActivity.java

Updated all the SDL_android.c jni calls as well

I added a new function to SDL_android.c/ h
void Android_JNI_SeparateEventsHint(const char* c);

This is called by SDL_androidtouch.c so that this TU doesn't need to call any JNI functions.
This commit is contained in:
Sam Lantinga
2017-08-12 12:24:59 -07:00
parent 0a52db54bd
commit c086251266
3 changed files with 20 additions and 11 deletions

View File

@@ -56,12 +56,9 @@ static void
SeparateEventsHintWatcher(void *userdata, const char *name,
const char *oldValue, const char *newValue)
{
jclass mActivityClass = Android_JNI_GetActivityClass();
JNIEnv *env = Android_JNI_GetEnv();
jfieldID fid = (*env)->GetStaticFieldID(env, mActivityClass, "mSeparateMouseAndTouch", "Z");
separate_mouse_and_touch = (newValue && (SDL_strcmp(newValue, "1") == 0));
(*env)->SetStaticBooleanField(env, mActivityClass, fid, separate_mouse_and_touch ? JNI_TRUE : JNI_FALSE);
Android_JNI_SetSeparateMouseAndTouch(separate_mouse_and_touch);
}
void Android_InitTouch(void)