diff --git a/project/jni/sdl-1.3/src/events/SDL_touch.c b/project/jni/sdl-1.3/src/events/SDL_touch.c index c0c005c80..3dd301d1a 100644 --- a/project/jni/sdl-1.3/src/events/SDL_touch.c +++ b/project/jni/sdl-1.3/src/events/SDL_touch.c @@ -329,7 +329,7 @@ SDL_SendFingerDown(SDL_TouchID id, SDL_FingerID fingerid, SDL_bool down, //scale to Integer coordinates x = (Uint16)((xin+touch->x_min)*(touch->xres)/(touch->native_xres)); y = (Uint16)((yin+touch->y_min)*(touch->yres)/(touch->native_yres)); - pressure = (Uint16)((yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres)); + pressure = (Uint16)((pressurein+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres)); finger = SDL_GetFinger(touch,fingerid); if(down) { @@ -412,7 +412,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, int relative, //scale to Integer coordinates x = (Uint16)((xin+touch->x_min)*(touch->xres)/(touch->native_xres)); y = (Uint16)((yin+touch->y_min)*(touch->yres)/(touch->native_yres)); - pressure = (Uint16)((yin+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres)); + pressure = (Uint16)((pressurein+touch->pressure_min)*(touch->pressureres)/(touch->native_pressureres)); if(touch->flush_motion) { return 0; } diff --git a/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c b/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c index bc78c724c..1770a34f1 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c +++ b/project/jni/sdl-1.3/src/video/android/SDL_androidinput.c @@ -1292,6 +1292,11 @@ extern void SDL_ANDROID_PumpEvents() SDL_Event ev; SDL_ANDROID_processAndroidTrackballDampening(); SDL_ANDROID_processMoveMouseWithKeyboard(); +#if SDL_VERSION_ATLEAST(1,3,0) + SDL_Window * window = SDL_GetFocusWindow(); + if( !window ) + return; +#endif if( !BufferedEventsMutex ) BufferedEventsMutex = SDL_CreateMutex(); @@ -1332,10 +1337,10 @@ extern void SDL_ANDROID_PumpEvents() break; #if SDL_VERSION_ATLEAST(1,3,0) case SDL_FINGERMOTION: - SDL_SendTouchMotion(0, ev.tfinger.fingerId, 0, ev.tfinger.x, ev.tfinger.y, ev.tfinger.pressure); + SDL_SendTouchMotion(0, ev.tfinger.fingerId, 0, (float)ev.tfinger.x / (float)window->w, (float)ev.tfinger.y / (float)window->h, ev.tfinger.pressure); break; case SDL_FINGERDOWN: - SDL_SendFingerDown(0, ev.tfinger.fingerId, ev.tfinger.state ? 1 : 0, ev.tfinger.x, ev.tfinger.y, ev.tfinger.pressure); + SDL_SendFingerDown(0, ev.tfinger.fingerId, ev.tfinger.state ? 1 : 0, (float)ev.tfinger.x / (float)window->w, (float)ev.tfinger.y / (float)window->h, ev.tfinger.pressure); break; case SDL_TEXTINPUT: SDL_SendKeyboardText(ev.text.text); diff --git a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo-1.3.c b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo-1.3.c index de7b9e55d..ecff1d30b 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo-1.3.c +++ b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo-1.3.c @@ -210,8 +210,8 @@ void ANDROID_GL_SwapBuffers(_THIS, SDL_Window * window) if( SDL_ANDROID_InsideVideoThread() ) SDL_ANDROID_CallJavaSwapBuffers(); // SDL: 1.3 does not clear framebuffer before drawing - glClearColor(0, 0, 0, 1); - glClear(GL_COLOR_BUFFER_BIT); + //glClearColor(0, 0, 0, 1); + //glClear(GL_COLOR_BUFFER_BIT); }; SDL_GLContext ANDROID_GL_CreateContext(_THIS, SDL_Window * window)