From 0a9bbef6ab5320066b675daefa5e83a0430bbace Mon Sep 17 00:00:00 2001 From: pelya Date: Mon, 15 Nov 2010 19:01:26 +0200 Subject: [PATCH] Fix to mouse input, tried to force libintl to load translations but failed --- project/java/Settings.java | 3 ++- project/jni/intl/Android.mk | 8 ++++---- project/jni/sdl-1.3/src/video/android/SDL_androidinput.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/project/java/Settings.java b/project/java/Settings.java index 2408f64ad..38f014b15 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -651,8 +651,9 @@ class Settings String lang = new String(Locale.getDefault().getLanguage()); if( Locale.getDefault().getCountry().length() > 0 ) lang = lang + "_" + Locale.getDefault().getCountry(); - System.out.println( "libSDL: setting envvar LANG to '" + lang + "'"); + System.out.println( "libSDL: setting envvar LANGUAGE to '" + lang + "'"); nativeSetEnv( "LANG", lang ); + nativeSetEnv( "LANGUAGE", lang ); // TODO: get current user name and set envvar USER, the API is not availalbe on Android 1.6 so I don't bother with this } diff --git a/project/jni/intl/Android.mk b/project/jni/intl/Android.mk index f6544800d..f09d8f78d 100644 --- a/project/jni/intl/Android.mk +++ b/project/jni/intl/Android.mk @@ -13,10 +13,10 @@ LOCAL_CFLAGS := -Os -I$(LOCAL_PATH)/src -I$(LOCAL_PATH)/include -DBUILDING_LIBIN -Dset_relocation_prefix=libintl_set_relocation_prefix \ -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 \ -DNO_XMALLOC -DHAVE_CONFIG_H \ - -DLOCALEDIR=\"/usr/local/share/locale\" \ - -DLIBDIR=\"/usr/local/lib\" \ - -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale\" \ - -DINSTALLDIR=\"/usr/local/lib\" + -DLOCALEDIR=\"\" \ + -DLIBDIR=\"\" \ + -DLOCALE_ALIAS_PATH=\"\" \ + -DINSTALLDIR=\"\" # -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale\" \ # -DINSTALLDIR=\"/usr/local/lib\" 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 257082a46..3cd82ae8f 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 @@ -195,7 +195,7 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j if( action == MOUSE_DOWN ) { if( !leftClickUsesPressure && !leftClickUsesMultitouch ) - SDL_SendMouseButton( NULL, (action == MOUSE_DOWN) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT ); + SDL_SendMouseButton( NULL, SDL_PRESSED, SDL_BUTTON_LEFT ); else action == MOUSE_MOVE; UpdateScreenUnderFingerRect(x, y); @@ -214,13 +214,13 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j UpdateScreenUnderFingerRect(x, y); } } - if( pointerId == 1 && rightClickMethod == RIGHT_CLICK_WITH_MULTITOUCH && (action == MOUSE_DOWN || action == MOUSE_UP) ) + if( pointerId == 1 && (action == MOUSE_DOWN || action == MOUSE_UP) ) { if( leftClickUsesMultitouch ) { SDL_SendMouseButton( NULL, (action == MOUSE_DOWN) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT ); } - else + else if( rightClickMethod == RIGHT_CLICK_WITH_MULTITOUCH ) { if( SDL_GetMouseState( NULL, NULL ) & SDL_BUTTON(SDL_BUTTON_LEFT) ) SDL_SendMouseButton( NULL, SDL_RELEASED, SDL_BUTTON_LEFT );