diff --git a/project/java/Settings.java b/project/java/Settings.java index b0301669c..11e30a543 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -66,6 +66,7 @@ import android.app.AlarmManager; import android.util.DisplayMetrics; import android.net.Uri; import java.util.concurrent.Semaphore; +import android.graphics.Color; // TODO: too much code here, split into multiple files, possibly auto-generated menus? class Settings @@ -2194,8 +2195,10 @@ class Settings { MainActivity p; FrameLayout layout = null; - ImageView imgs[] = new ImageView[Globals.ScreenKbControlsLayout.length]; + ImageView imgs[] = new ImageView[Globals.ScreenKbControlsLayout.length]; Bitmap bmps[] = new Bitmap[Globals.ScreenKbControlsLayout.length]; + ImageView boundary = null; + Bitmap boundaryBmp = null; int currentButton = 0; int buttons[] = { R.drawable.dpad, @@ -2213,7 +2216,27 @@ class Settings p = _p; layout = new FrameLayout(p); p.getVideoLayout().addView(layout); + boundary = new ImageView(p); + boundary.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); + boundary.setScaleType(ImageView.ScaleType.MATRIX); + boundaryBmp = BitmapFactory.decodeResource( p.getResources(), R.drawable.rectangle ); + boundary.setImageBitmap(boundaryBmp); + layout.addView(boundary); currentButton = 0; + if( Globals.TouchscreenKeyboardTheme == 2 ) + { + int buttons2[] = { + R.drawable.sun_dpad, + R.drawable.sun_keyboard, + R.drawable.sun_b1, + R.drawable.sun_b2, + R.drawable.sun_b3, + R.drawable.sun_b4, + R.drawable.sun_b5, + R.drawable.sun_b6 + }; + buttons = buttons2; + } setupButton(true); } @@ -2240,11 +2263,28 @@ class Settings if( imgs[currentButton] == null ) { imgs[currentButton] = new ImageView(p); - imgs[currentButton].setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); + imgs[currentButton].setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); imgs[currentButton].setScaleType(ImageView.ScaleType.MATRIX); bmps[currentButton] = BitmapFactory.decodeResource( p.getResources(), buttons[currentButton] ); imgs[currentButton].setImageBitmap(bmps[currentButton]); layout.addView(imgs[currentButton]); + boundary.bringToFront(); + } + if( Globals.ScreenKbControlsLayout[currentButton][0] == Globals.ScreenKbControlsLayout[currentButton][2] || + Globals.ScreenKbControlsLayout[currentButton][1] == Globals.ScreenKbControlsLayout[currentButton][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[currentButton][0] = displayX / 2 - displayX / 6; + Globals.ScreenKbControlsLayout[currentButton][2] = displayX / 2 + displayX / 6; + Globals.ScreenKbControlsLayout[currentButton][1] = displayY / 2 - displayY / 4; + Globals.ScreenKbControlsLayout[currentButton][3] = displayY / 2 + displayY / 4; } Matrix m = new Matrix(); RectF src = new RectF(0, 0, bmps[currentButton].getWidth(), bmps[currentButton].getHeight()); @@ -2252,6 +2292,10 @@ class Settings Globals.ScreenKbControlsLayout[currentButton][2], Globals.ScreenKbControlsLayout[currentButton][3]); m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL); imgs[currentButton].setImageMatrix(m); + m = new Matrix(); + src = new RectF(0, 0, boundaryBmp.getWidth(), boundaryBmp.getHeight()); + m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL); + boundary.setImageMatrix(m); } public void onTouchEvent(final MotionEvent ev) @@ -2286,6 +2330,10 @@ class Settings Globals.ScreenKbControlsLayout[currentButton][2], Globals.ScreenKbControlsLayout[currentButton][3]); m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL); imgs[currentButton].setImageMatrix(m); + m = new Matrix(); + src = new RectF(0, 0, boundaryBmp.getWidth(), boundaryBmp.getHeight()); + m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL); + boundary.setImageMatrix(m); if( ev.getAction() == MotionEvent.ACTION_UP ) setupButton(false); diff --git a/project/jni/application/openarena/AndroidAppSettings.cfg b/project/jni/application/openarena/AndroidAppSettings.cfg index eee9e555b..f663b7649 100644 --- a/project/jni/application/openarena/AndroidAppSettings.cfg +++ b/project/jni/application/openarena/AndroidAppSettings.cfg @@ -37,10 +37,10 @@ HiddenMenuOptions='OptionalDownloadConfig DisplaySizeConfig' FirstStartMenuOptions='' MultiABI=y AppMinimumRAM=300 -AppVersionCode=08817 -AppVersionName="0.8.8.17" -ResetSdlConfigForThisVersion=y -DeleteFilesOnUpgrade="libsdl-DownloadFinished-10.flag .openarena/baseoa/q3config.cfg" +AppVersionCode=08818 +AppVersionName="0.8.8.18" +ResetSdlConfigForThisVersion=n +DeleteFilesOnUpgrade="libsdl-DownloadFinished-10.flag" CompiledLibraries="sdl_mixer sdl_image freetype curl vorbis ogg" CustomBuildScript=y AppCflags='-O2 -finline-functions' diff --git a/project/jni/application/openarena/engine b/project/jni/application/openarena/engine index 82513e886..d99f7bbd7 160000 --- a/project/jni/application/openarena/engine +++ b/project/jni/application/openarena/engine @@ -1 +1 @@ -Subproject commit 82513e88619941eef9649a0ef73c2b866d3fd005 +Subproject commit d99f7bbd73c9d05942c93ebc144bd3e210e24bff diff --git a/project/jni/application/openarena/vm b/project/jni/application/openarena/vm index 5c6363076..7e15a99f5 160000 --- a/project/jni/application/openarena/vm +++ b/project/jni/application/openarena/vm @@ -1 +1 @@ -Subproject commit 5c6363076d61fecfa97889f5c45ec422ba890d99 +Subproject commit 7e15a99f54248e86070473a5e2588016f1d03ee4 diff --git a/project/res/drawable/rectangle.png b/project/res/drawable/rectangle.png new file mode 100644 index 000000000..1cf77c79b Binary files /dev/null and b/project/res/drawable/rectangle.png differ diff --git a/project/res/drawable/sun_b1.png b/project/res/drawable/sun_b1.png new file mode 100644 index 000000000..faa1f8b24 Binary files /dev/null and b/project/res/drawable/sun_b1.png differ diff --git a/project/res/drawable/sun_b2.png b/project/res/drawable/sun_b2.png new file mode 100644 index 000000000..b9f58e5dd Binary files /dev/null and b/project/res/drawable/sun_b2.png differ diff --git a/project/res/drawable/sun_b3.png b/project/res/drawable/sun_b3.png new file mode 100644 index 000000000..6e5fbe515 Binary files /dev/null and b/project/res/drawable/sun_b3.png differ diff --git a/project/res/drawable/sun_b4.png b/project/res/drawable/sun_b4.png new file mode 100644 index 000000000..a92dd6af6 Binary files /dev/null and b/project/res/drawable/sun_b4.png differ diff --git a/project/res/drawable/sun_b5.png b/project/res/drawable/sun_b5.png new file mode 100644 index 000000000..d40c10820 Binary files /dev/null and b/project/res/drawable/sun_b5.png differ diff --git a/project/res/drawable/sun_b6.png b/project/res/drawable/sun_b6.png new file mode 100644 index 000000000..9b644d122 Binary files /dev/null and b/project/res/drawable/sun_b6.png differ diff --git a/project/res/drawable/sun_dpad.png b/project/res/drawable/sun_dpad.png new file mode 100644 index 000000000..f653f2550 Binary files /dev/null and b/project/res/drawable/sun_dpad.png differ diff --git a/project/res/drawable/sun_keyboard.png b/project/res/drawable/sun_keyboard.png new file mode 100644 index 000000000..10b740e92 Binary files /dev/null and b/project/res/drawable/sun_keyboard.png differ