Skip to content

Commit

Permalink
* More Android patch work
Browse files Browse the repository at this point in the history
  • Loading branch information
josebagar committed Mar 24, 2015
1 parent 387fa5d commit ca7b18e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -950,7 +950,7 @@ public SDLSurface(Context context) {
mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);

if(Build.VERSION.SDK_INT >= 12) {
setOnGenericMotionListener(new SDLGenericMotionListener_API12());
setOnGenericMotionListener(new SDLGenericMotionListener());
}

// Some arbitrary defaults to avoid a potential division by zero
Expand Down
8 changes: 0 additions & 8 deletions src/core/android/SDL_android.c
Expand Up @@ -302,14 +302,6 @@ JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeMouse(
Android_OnMouse(button, action, x, y);
}

/* Mouse */
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeMouse(
JNIEnv* env, jclass jcls,
jint button, jint action, jfloat x, jfloat y)
{
Android_OnMouse(button, action, x, y);
}

/* Accelerometer */
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeAccel(
JNIEnv* env, jclass jcls,
Expand Down
4 changes: 2 additions & 2 deletions src/video/android/SDL_androidmouse.c
Expand Up @@ -24,7 +24,7 @@
#if SDL_VIDEO_DRIVER_ANDROID

#include "SDL_androidmouse.h"
#include "SDL_Log.h"
#include "SDL_log.h"

#include "SDL_events.h"
#include "../../events/SDL_mouse_c.h"
Expand Down Expand Up @@ -71,7 +71,7 @@ void Android_OnMouse( int androidButton, int action, float x, float y) {
break;

case ACTION_SCROLL:
SDL_SendMouseWheel(Android_Window, 0, x, y);
SDL_SendMouseWheel(Android_Window, 0, x, y, SDL_MOUSEWHEEL_NORMAL);
break;

default:
Expand Down
9 changes: 4 additions & 5 deletions src/video/android/SDL_androidtouch.c
Expand Up @@ -24,13 +24,12 @@

#include <android/log.h>

#include "SDL_hints.h"
#include "SDL_events.h"
#include "../../events/SDL_mouse_c.h"
#include "../../events/SDL_touch_c.h"
#include "SDL_log.h"

#include "SDL_androidtouch.h"

#include "../../events/SDL_mouse_c.h"
#include "../../events/SDL_touch_c.h"
#include "../../core/android/SDL_android.h"

#define ACTION_DOWN 0
Expand Down Expand Up @@ -69,7 +68,7 @@ void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int actio
SDL_TouchID touchDeviceId = 0;
SDL_FingerID fingerId = 0;
int window_x, window_y;
char * hint;
const char * hint;
static SDL_FingerID pointerFingerID = 0;

if (!Android_Window) {
Expand Down

0 comments on commit ca7b18e

Please sign in to comment.