* More Android patch work
authorJoseba García Etxebarria <joseba.gar@gmail.com>
Tue, 24 Mar 2015 21:02:28 +0100
changeset 94390d01b53cdbea
parent 9438 fff5af5de6dd
child 9440 a72c15020efa
* More Android patch work
android-project/src/org/libsdl/app/SDLActivity.java
src/core/android/SDL_android.c
src/video/android/SDL_androidmouse.c
src/video/android/SDL_androidtouch.c
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Tue Mar 24 20:45:29 2015 +0100
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Tue Mar 24 21:02:28 2015 +0100
     1.3 @@ -950,7 +950,7 @@
     1.4          mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
     1.5          
     1.6          if(Build.VERSION.SDK_INT >= 12) {
     1.7 -            setOnGenericMotionListener(new SDLGenericMotionListener_API12());
     1.8 +            setOnGenericMotionListener(new SDLGenericMotionListener());
     1.9          }
    1.10  
    1.11          // Some arbitrary defaults to avoid a potential division by zero
     2.1 --- a/src/core/android/SDL_android.c	Tue Mar 24 20:45:29 2015 +0100
     2.2 +++ b/src/core/android/SDL_android.c	Tue Mar 24 21:02:28 2015 +0100
     2.3 @@ -302,14 +302,6 @@
     2.4      Android_OnMouse(button, action, x, y);
     2.5  }
     2.6  
     2.7 -/* Mouse */
     2.8 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeMouse(
     2.9 -                                    JNIEnv* env, jclass jcls,
    2.10 -                                    jint button, jint action, jfloat x, jfloat y)
    2.11 -{
    2.12 -    Android_OnMouse(button, action, x, y);
    2.13 -}
    2.14 -
    2.15  /* Accelerometer */
    2.16  JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeAccel(
    2.17                                      JNIEnv* env, jclass jcls,
     3.1 --- a/src/video/android/SDL_androidmouse.c	Tue Mar 24 20:45:29 2015 +0100
     3.2 +++ b/src/video/android/SDL_androidmouse.c	Tue Mar 24 21:02:28 2015 +0100
     3.3 @@ -24,7 +24,7 @@
     3.4  #if SDL_VIDEO_DRIVER_ANDROID
     3.5  
     3.6  #include "SDL_androidmouse.h"
     3.7 -#include "SDL_Log.h"
     3.8 +#include "SDL_log.h"
     3.9  
    3.10  #include "SDL_events.h"
    3.11  #include "../../events/SDL_mouse_c.h"
    3.12 @@ -71,7 +71,7 @@
    3.13              break;
    3.14  
    3.15          case ACTION_SCROLL:
    3.16 -            SDL_SendMouseWheel(Android_Window, 0, x, y);
    3.17 +            SDL_SendMouseWheel(Android_Window, 0, x, y, SDL_MOUSEWHEEL_NORMAL);
    3.18              break;
    3.19  
    3.20          default:
     4.1 --- a/src/video/android/SDL_androidtouch.c	Tue Mar 24 20:45:29 2015 +0100
     4.2 +++ b/src/video/android/SDL_androidtouch.c	Tue Mar 24 21:02:28 2015 +0100
     4.3 @@ -24,13 +24,12 @@
     4.4  
     4.5  #include <android/log.h>
     4.6  
     4.7 +#include "SDL_hints.h"
     4.8  #include "SDL_events.h"
     4.9 +#include "SDL_log.h"
    4.10 +#include "SDL_androidtouch.h"
    4.11  #include "../../events/SDL_mouse_c.h"
    4.12  #include "../../events/SDL_touch_c.h"
    4.13 -#include "SDL_log.h"
    4.14 -
    4.15 -#include "SDL_androidtouch.h"
    4.16 -
    4.17  #include "../../core/android/SDL_android.h"
    4.18  
    4.19  #define ACTION_DOWN 0
    4.20 @@ -69,7 +68,7 @@
    4.21      SDL_TouchID touchDeviceId = 0;
    4.22      SDL_FingerID fingerId = 0;
    4.23      int window_x, window_y;
    4.24 -    char * hint;
    4.25 +    const char * hint;
    4.26      static SDL_FingerID pointerFingerID = 0;
    4.27  
    4.28      if (!Android_Window) {