diff --git a/project/jni/application/src b/project/jni/application/src index 299033683..59d41f41e 120000 --- a/project/jni/application/src +++ b/project/jni/application/src @@ -1 +1 @@ -teeworlds \ No newline at end of file +fheroes2 \ No newline at end of file diff --git a/project/jni/application/teeworlds/AndroidAppSettings.cfg b/project/jni/application/teeworlds/AndroidAppSettings.cfg index 35dc40acd..bae4dea8c 100644 --- a/project/jni/application/teeworlds/AndroidAppSettings.cfg +++ b/project/jni/application/teeworlds/AndroidAppSettings.cfg @@ -22,8 +22,8 @@ AppTouchscreenKeyboardKeysAmount=6 AppTouchscreenKeyboardKeysAmountAutoFire=0 RedefinedKeysScreenKb="SPACE RETURN LEFT RIGHT RSHIFT LSHIFT" MultiABI=y -AppVersionCode=5205 -AppVersionName="0.5.2.05" +AppVersionCode=5206 +AppVersionName="0.5.2.06" CompiledLibraries="sdl_image freetype" CustomBuildScript=n AppCflags='-O3' diff --git a/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp b/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp index a33106f68..792f187f9 100644 --- a/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp +++ b/project/jni/application/teeworlds/src/engine/client/ec_gfx.cpp @@ -308,6 +308,7 @@ static int try_init() #if defined(ANDROID) // Redefine button layout + if( ! SDL_ANDROID_GetScreenKeyboardRedefinedByUser() ) { // Disable DPAD SDL_Rect pos = {0, 0, 0, 0}; diff --git a/project/jni/sdl-1.3/include/SDL_screenkeyboard.h b/project/jni/sdl-1.3/include/SDL_screenkeyboard.h index 7ab3e4702..290b08e2b 100644 --- a/project/jni/sdl-1.3/include/SDL_screenkeyboard.h +++ b/project/jni/sdl-1.3/include/SDL_screenkeyboard.h @@ -52,7 +52,7 @@ enum { SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM }; -/* All functions return 0 on failure and 1 on success */ +/* All functions return 0 on failure and 1 on success, contrary to other SDL API */ extern DECLSPEC int SDLCALL SDL_ANDROID_SetScreenKeyboardButtonPos(int buttonId, SDL_Rect * pos); extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardButtonPos(int buttonId, SDL_Rect * pos); @@ -73,6 +73,9 @@ extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardSize(); /* Show Android on-screen keyboard, and pass entered text back to application when user closes it */ extern DECLSPEC int SDLCALL SDL_ANDROID_ToggleScreenKeyboardTextInput(); +/* Whether user redefined on-screen keyboard layout via SDL menu, app should not enforce it's own layout in that case */ +extern DECLSPEC int SDLCALL SDL_ANDROID_GetScreenKeyboardRedefinedByUser(); + #ifdef __cplusplus } #endif 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 75439199c..2a66ef434 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 @@ -1500,6 +1500,7 @@ JAVA_EXPORT_NAME(Settings_nativeSetTouchscreenCalibration) (JNIEnv* env, jobject SDL_ANDROID_TouchscreenCalibrationHeight = y2 - y1; } +static int ScreenKbRedefinedByUser = 0; JNIEXPORT void JNICALL JAVA_EXPORT_NAME(Settings_nativeSetScreenKbKeyLayout) (JNIEnv* env, jobject thiz, jint keynum, jint x1, jint y1, jint x2, jint y2) @@ -1515,9 +1516,16 @@ JAVA_EXPORT_NAME(Settings_nativeSetScreenKbKeyLayout) (JNIEnv* env, jobject thiz key = keynum - 2 + SDL_ANDROID_SCREENKEYBOARD_BUTTON_0; if( key >= 0 ) + { + ScreenKbRedefinedByUser = 1; SDL_ANDROID_SetScreenKeyboardButtonPos(key, &rect); + } } +int SDL_ANDROID_GetScreenKeyboardRedefinedByUser() +{ + return ScreenKbRedefinedByUser; +} JNIEXPORT void JNICALL JAVA_EXPORT_NAME(Settings_nativeInitKeymap) ( JNIEnv* env, jobject thiz )