diff --git a/changeAppSettings.sh b/changeAppSettings.sh index 98b6ad3e8..6ecd3f454 100755 --- a/changeAppSettings.sh +++ b/changeAppSettings.sh @@ -485,7 +485,7 @@ if [ -n "$var" ] ; then fi fi -FirstStartMenuOptionsDefault='(ReadmeText.length() > 2 ? new Settings.ShowReadme() : new Settings.DummyMenu()), (AppUsesMouse \&\& \! ForceRelativeMouseMode ? new Settings.DisplaySizeConfig(true) : new Settings.DummyMenu()), new Settings.OptionalDownloadConfig(true), new Settings.GyroscopeCalibration()' +FirstStartMenuOptionsDefault='new Settings.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode ? new Settings.DisplaySizeConfig(true) : new Settings.DummyMenu()), new Settings.OptionalDownloadConfig(true), new Settings.GyroscopeCalibration()' if [ -z "$AUTO" ]; then echo echo "Menu items to show at startup - this is Java code snippet, leave empty for default" @@ -630,9 +630,10 @@ fi if [ -z "$AUTO" ]; then echo echo "Here you may type readme text, which will be shown during startup. Format is:" -echo "Text in English, use \\n for newline" +echo "Text in English, use \\n to separate lines" echo "de:Text in Deutsch" echo "ru:Text in Russian, and so on" +echo echo "Current text:" echo echo "`echo $ReadmeText | tr '^' '\\n'`" diff --git a/project/java/Globals.java b/project/java/Globals.java index e53f30913..d9ecccc80 100644 --- a/project/java/Globals.java +++ b/project/java/Globals.java @@ -105,7 +105,7 @@ class Globals public static int RemapHwKeycode[] = new int[SDL_Keys.JAVA_KEYCODE_LAST]; public static int RemapScreenKbKeycode[] = new int[6]; public static boolean ScreenKbControlsShown[] = new boolean[8]; /* Also joystick and text input button added */ - public static int ScreenKbControlsLayout[][] = new int[8][4]; + public static int ScreenKbControlsLayout[][] = new int[][] { { 712, 392, 800, 480 }, { 624, 392, 712, 480 }, { 712, 304, 800, 392 }, { 624, 304, 712, 392 }, { 712, 216, 800, 304 }, { 624, 216, 712, 304 }, { 0, 0, 48, 48 }, { 0, 303, 177, 480 } }; // Values for 800x480 resolution public static int RemapMultitouchGestureKeycode[] = new int[4]; public static boolean MultitouchGesturesUsed[] = new boolean[4]; public static int MultitouchGestureSensitivity = 1; diff --git a/project/java/Settings.java b/project/java/Settings.java index a48184241..31fbf6124 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -218,6 +218,22 @@ class Settings } for( int i = 0; i < Globals.MultitouchGesturesUsed.length; i++ ) Globals.MultitouchGesturesUsed[i] = true; + // Adjust coordinates of on-screen buttons from 800x480 + int displayX = 800; + int displayY = 480; + try { + DisplayMetrics dm = new DisplayMetrics(); + p.getWindowManager().getDefaultDisplay().getMetrics(dm); + displayX = dm.widthPixels; + displayY = dm.heightPixels; + } catch (Exception eeeee) {} + for( int i = 0; i < Globals.ScreenKbControlsLayout.length; i++ ) + { + Globals.ScreenKbControlsLayout[i][0] *= (float)displayX / 800.0f; + Globals.ScreenKbControlsLayout[i][2] *= (float)displayX / 800.0f; + Globals.ScreenKbControlsLayout[i][1] *= (float)displayY / 480.0f; + Globals.ScreenKbControlsLayout[i][3] *= (float)displayY / 480.0f; + } System.out.println("android.os.Build.MODEL: " + android.os.Build.MODEL); if( (android.os.Build.MODEL.equals("GT-N7000") || android.os.Build.MODEL.equals("SGH-I717")) @@ -2078,22 +2094,6 @@ class Settings layout.addView(imgs[i]); Matrix m = new Matrix(); RectF src = new RectF(0, 0, bmps[i].getWidth(), bmps[i].getHeight()); - if( Globals.ScreenKbControlsLayout[i][0] == Globals.ScreenKbControlsLayout[i][2] || - Globals.ScreenKbControlsLayout[i][1] == Globals.ScreenKbControlsLayout[i][3] ) - { - int displayX = 800; - int displayY = 480; - try { - DisplayMetrics dm = new DisplayMetrics(); - p.getWindowManager().getDefaultDisplay().getMetrics(dm); - displayX = dm.widthPixels; - displayY = dm.heightPixels; - } catch (Exception eeeee) {} - Globals.ScreenKbControlsLayout[i][0] = displayX / 2 - displayX / 10; - Globals.ScreenKbControlsLayout[i][2] = displayX / 2 + displayX / 10; - Globals.ScreenKbControlsLayout[i][1] = displayY / 2 - displayY / 8; - Globals.ScreenKbControlsLayout[i][3] = displayY / 2 + displayY / 8; - } RectF dst = new RectF(Globals.ScreenKbControlsLayout[i][0], Globals.ScreenKbControlsLayout[i][1], Globals.ScreenKbControlsLayout[i][2], Globals.ScreenKbControlsLayout[i][3]); m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL); @@ -2300,6 +2300,12 @@ class Settings if( r.startsWith(lang) ) readme = r.substring(lang.length()); } + readme = readme.trim(); + if( readme.length() <= 2 ) + { + goBack(p); + return; + } TextView text = new TextView(p); text.setMaxLines(1000); text.setText(readme); diff --git a/project/jni/application/ballfield/ballfield.cpp b/project/jni/application/ballfield/ballfield.cpp index 1210ff8c5..46bb8b42a 100644 --- a/project/jni/application/ballfield/ballfield.cpp +++ b/project/jni/application/ballfield/ballfield.cpp @@ -555,6 +555,14 @@ int main(int argc, char* argv[]) __android_log_print(ANDROID_LOG_INFO, "Ballfield", "sizeof(int) %d long %d long long %d size_t %d", sizeof(int), sizeof(long), sizeof(long long), sizeof(size_t)); + __android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "On-screen buttons:"); + for(i = 0; i < SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM; i++) + { + SDL_Rect r; + SDL_ANDROID_GetScreenKeyboardButtonPos(i, &r); + __android_log_print(ANDROID_LOG_VERBOSE, "Ballfield", "{ %d, %d, %d, %d },", r.x, r.y, r.x+r.h, r.y+r.w); + } + while(1) { SDL_Rect r; diff --git a/project/jni/application/openarena/engine b/project/jni/application/openarena/engine index 4997b5070..00e839b40 160000 --- a/project/jni/application/openarena/engine +++ b/project/jni/application/openarena/engine @@ -1 +1 @@ -Subproject commit 4997b50704c7134585a48a03dd595b4155cf3d14 +Subproject commit 00e839b4082aa1682434d70a6e5bd44c39d262c9