Patched to compile on Android (I hope).
authorRyan C. Gordon <icculus@icculus.org>
Wed, 01 Apr 2015 14:45:09 -0400
changeset 9450bcb16ffce95b
parent 9449 a65088766e35
child 9451 28c55cb65416
Patched to compile on Android (I hope).
src/core/android/SDL_android.c
src/core/android/SDL_android.h
src/video/android/SDL_androidtouch.c
     1.1 --- a/src/core/android/SDL_android.c	Wed Apr 01 12:14:56 2015 -0400
     1.2 +++ b/src/core/android/SDL_android.c	Wed Apr 01 14:45:09 2015 -0400
     1.3 @@ -1610,6 +1610,11 @@
     1.4      return s_AndroidExternalFilesPath;
     1.5  }
     1.6  
     1.7 +jclass Android_JNI_GetActivityClass(void)
     1.8 +{
     1.9 +    return mActivityClass;
    1.10 +}
    1.11 +
    1.12  #endif /* __ANDROID__ */
    1.13  
    1.14  /* vi: set ts=4 sw=4 expandtab: */
     2.1 --- a/src/core/android/SDL_android.h	Wed Apr 01 12:14:56 2015 -0400
     2.2 +++ b/src/core/android/SDL_android.h	Wed Apr 01 14:45:09 2015 -0400
     2.3 @@ -78,6 +78,7 @@
     2.4  #include <jni.h>
     2.5  JNIEnv *Android_JNI_GetEnv(void);
     2.6  int Android_JNI_SetupThread(void);
     2.7 +jclass Android_JNI_GetActivityClass(void);
     2.8  
     2.9  /* Generic messages */
    2.10  int Android_JNI_SendMessage(int command, int param);
     3.1 --- a/src/video/android/SDL_androidtouch.c	Wed Apr 01 12:14:56 2015 -0400
     3.2 +++ b/src/video/android/SDL_androidtouch.c	Wed Apr 01 14:45:09 2015 -0400
     3.3 @@ -56,9 +56,11 @@
     3.4  SeparateEventsHintWatcher(void *userdata, const char *name,
     3.5                            const char *oldValue, const char *newValue)
     3.6  {
     3.7 -    separate_mouse_and_touch = (newValue && (SDL_strcmp(newValue, "1") == 0));
     3.8 +    jclass mActivityClass = Android_JNI_GetActivityClass();
     3.9      JNIEnv *env = Android_JNI_GetEnv();
    3.10      jfieldID fid = (*env)->GetStaticFieldID(env, mActivityClass, "mSeparateMouseAndTouch", "Z");
    3.11 +
    3.12 +    separate_mouse_and_touch = (newValue && (SDL_strcmp(newValue, "1") == 0));
    3.13      (*env)->SetStaticBooleanField(env, mActivityClass, fid, separate_mouse_and_touch ? JNI_TRUE : JNI_FALSE);
    3.14  }
    3.15