Commit graph

467 commits

Author SHA1 Message Date
Rémi Verschelde b87d819aad Android: Restore support for android_stl=no builds
Two modules fail building with this option, so we force users to disable them.
Small cleanup based on 2.1 branch and cherry-pick 01e65c4555
to fix support for NDK r20 (fixes #30688).
2019-07-30 15:21:12 +02:00
Rémi Verschelde b896eb5fd4
Merge pull request #30291 from akien-mga/3.0
Assorted cherry-picks from the master branch for Godot 3.0.7
2019-07-09 08:46:19 +02:00
Rémi Verschelde 3600735b24 Android: Target SDK 28, required by Google from Aug 2019
(cherry picked from commit 7249992b62)
2019-07-08 14:08:23 +02:00
Hein-Pieter van Braam cada03eedb Don't use -ffast-math or other unsafe math optimizations
Godot supports many different compilers and for production releases we
have to support 3 currently: GCC8, Clang6, and MSVC2017. These compilers
all do slightly different things with -ffast-math and it is causing
issues now. See #24841, #24540, #10758, #10070. And probably other
complaints about physics differences between release and release_debug
builds.

I've done some performance comparisons on Linux x86_64. All tests are
ran 20 times.

Bunnymark: (higher is better)
(bunnies)    min    max  stdev average
fast-math   7332   7597    71     7432
this pr     7379   7779   108     7621 (102%)

FPBench (gdscript port http://fpbench.org/) (lower is better)
(ms)
fast-math  15441  16127   192    15764
this pr    15671  16855   326    16001  (99%)

Float_add (adding floats in a tight loop) (lower is better)
(sec)
fast-math   5.49   5.78  0.07     5.65
this pr     5.65   5.90  0.06     5.76  (98%)

Float_div (dividing floats in a tight loop) (lower is better)
(sec)
fast-math  11.70  12.36  0.18    11.99
this pr    11.92  12.32  0.12    12.12  (99%)

Float_mul (multiplying floats in a tight loop) (lower is better)
(sec)
fast-math  11.72  12.17  0.12    11.93
this pr    12.01  12.62  0.17    12.26  (97%)

I have also looked at FPS numbers for tps-demo, 3d platformer, 2d
platformer, and sponza and could not find any measurable difference.

I believe that given the issues and oft-reported (physics) glitches on
release builds I believe that the couple of percent of tight-loop
floating point performance regression is well worth it.

This fixes #24540 and fixes #24841

(cherry picked from commit e5b335d367)
2019-07-03 15:53:22 +02:00
Xavier Sellier 9776f0da4d Prevent a device to be added/deleted more than once on Android
cherry-picked from fb5a601217

(cherry picked from commit 7dcf779a8b)
2019-07-03 14:41:29 +02:00
Karen Schwane 6392a7d7f1 Move jcenter behind mavenCentral and google gradle repos to fix build problems
(cherry picked from commit a01ce6299c)
2019-07-03 14:41:03 +02:00
volzhs a3753eda62 Ignore invalid device for Android
(cherry picked from commit 3a2d707697)
2019-07-03 14:25:22 +02:00
Ibrahn Sahir b890ed527b fixed branch on uninit and data race in editor android device polling
Initialised relevant variables before stating thread,
to prevent a branch on uninitialised data.
Fixed race condition in polling that could miss a device change.

(cherry picked from commit fe4265ad46)
2019-07-03 13:06:46 +02:00
Rémi Verschelde 917d027941 Android: Enable arm64-v8a export by default
From August 1, 2019, Google Play requires that all new apps and app updates
include 64-bit versions, so we enable ARM64 by default.

IINM support for x86 and x86_64 is still be optional, so not enabling them
out of the box.

Part of #25030.

(cherry picked from commit 9e820cdf20)
2019-01-16 13:59:41 +01:00
Rémi Verschelde 0aa350306b SCons: Drop unused MPC_FIXED_POINT define
(cherry picked from commit eebca76be5)
2019-01-16 13:02:53 +01:00
Rémi Verschelde 392e5cfa1e Android: Add support for x86_64 architecture
Like arm64v8, this is only supported by API 21 and later,
so we enforce 21 as min API for x86_64.

Part of #25030.

(cherry picked from commit 7f4ee36469)
2019-01-16 12:51:56 +01:00
Rémi Verschelde 0eab0d9343 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-03 11:41:35 +01:00
volzhs 5dd8f775f9 Fix keep screen on property path for Android/iOS/UWP
(cherry picked from commit d18235bc38)
2018-11-28 10:27:41 +01:00
M. Huri e6ae704f32 Repaired mistyped of 'its' on several files.
(cherry picked from commit b46ba24e3b)
2018-11-01 11:39:26 +01:00
Wojciech Milkowski 74fe5968c1 Fix build with Android NDK r18
As a bonus there is no need to use undocumented Gradle API any more.

(cherry picked from commit 3598165c4d)
2018-10-15 16:27:40 +02:00
Wojciech Milkowski 8c714bf8cd No need to link with libandroid_support in NDK 17
According to https://github.com/bytedeco/javacpp/pull/244 in NDK 17
libandroid_support library is not needed any more, and on armv8 is
already gone which breaks compilation.

(cherry picked from commit 3a3ea6d514)
2018-10-09 09:23:19 +02:00
Ridwan Abdul Hafidh d3ca68aee4 add support libc++_shared stl on android
(cherry picked from commit b0419db46f)
2018-10-09 09:23:03 +02:00
Tiago Quendera a063074346 Update detect.py
Fixed a typo in detect.py

(cherry picked from commit aa594614db)
2018-10-09 09:20:31 +02:00
Konstantin Zaitsev c00c3f10a4 Fix possible NullPointerException crash on cancel payment
(cherry picked from commit d05db4de8e)
2018-07-28 16:06:30 +02:00
Rémi Verschelde c709dff1a2 Style: Format code with clang-format 6.0.1
(cherry picked from commit 7c9f7452f4)

Travis: Update style checks to clang-format 6.0.1

(cherry picked from commit 003ac67df1)
2018-07-18 16:37:23 +02:00
Hein-Pieter van Braam 861d341dff Write new permissions to the AndroidManifest.xml
Instead of editing the placeholder permissions actually write new ones.
This should solve the privacy statement problems for the Play store.
This means we also no longer need to placeholder permissions in the
template.

(cherry picked from commit 2a126242dd)
2018-07-08 15:48:08 +02:00
Patrick Kaster 9190ae2be7 added 'android_add_asset_dir('...') method to Android module gradle build config 2018-07-04 23:04:14 +02:00
Hugo Locurcio 403f7dc35f Change ".." punctuation for "..." in editor strings (#16507)
(cherry picked from commit 1c419531a0)
2018-06-05 21:42:33 +02:00
Dmitry Pupinin 188bfd2ac9 Increase versionCode range 3.0
(cherry picked from commit d71d968987)
2018-06-01 17:33:27 +02:00
Hein-Pieter van Braam 5917063192
Merge pull request #18082 from RandomShaper/improve-gui-touch-3.0
Implement universal translation of touch to mouse (3.0)
2018-05-13 21:30:37 +02:00
Rémi Verschelde 1905e1c8a2 Android: Increase targetSdkVersion to 27
Matches the change for 2.1 in #18626, and the new requirements from Google
for new apps starting with August 2018 (targetSdkVersion 26 or higher):
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

(cherry picked from commit a6552819b1)
2018-05-08 15:30:11 +02:00
RameshRavone fa19d01c7b Fix: JAR files signed with the MD5 algorithm as unsigned
(cherry picked from commit d3182248c4)
2018-05-08 09:06:54 +02:00
Pedro J. Estébanez e10a2e5999 Implement universal translation of touch to mouse
Now generating mouse events from touch is optional (on by default) and it's performed by `InputDefault` instead of having each OS abstraction doing it. (*)

The translation algorithm waits for a touch index to be pressed and tracks it translating its events to mouse events until it is raised, while ignoring other pointers.

Furthermore, to avoid an stuck "touch mouse", since not all platforms may report touches raised when the window is unfocused, it checks if touches are still down by the time it's focused again and if so it resets the state of the emulated mouse.

*: In the case of Windows, since it already provides touch-to-mouse translation by itself, "echo" mouse events are filtered out to have it working like the rest.

On X11 a little hack has been needed to avoid a case of a spurious mouse motion event that is generated during touch interaction.

Plus: Improve/fix tracking of current mouse position.
2018-04-30 19:04:35 +02:00
Ignacio Etcheverry 00c55bb2eb Fix _export_begin not being called when exporting to android
(cherry picked from commit c8884ce3bd)
2018-04-29 18:45:09 +02:00
Ruslan Mustakov 4eed7cb9b2 Fix Android input source checks
Input source types are not pure bit flags, they are combinations of
flags, so != 0 check was incorrect and resulted in crashes later, when
trying to obtain the device.

(cherry picked from commit 5dffa506dc)
2018-04-28 22:50:25 +02:00
Ruslan Mustakov c8d0d38cab Add safety checks when handling Android input
It is possible that input comes before the engine is fully initialized.
This fixes the crashes that ocurred when that happens.

(cherry picked from commit 995724b762)
2018-04-28 19:58:00 +02:00
volzhs b09d06fcf7 Fix getting Android device information
Fix #17644

(cherry picked from commit 4e378aeeb8)
2018-03-29 00:34:31 +02:00
Xavier Sellier fa9e03996c Prevent android to split-screen
(cherry picked from commit 61e8f8a866)
2018-03-29 00:19:49 +02:00
Ruslan Mustakov 61a9ef5d81 Fix intermittent audio driver crash during startup on Android
set_pause can be called before the driver is initialized, and there
already is a check for that. The problem is that the 'active' field
was not initialied in the constructor, which lead to it having an
undefined value.

(cherry picked from commit c10749d51f)
2018-03-01 21:05:15 +01:00
Rémi Verschelde a4b077a0ba Android: Mark GLES3 as required in the manifest
Fixes #17076.

(cherry picked from commit 7d09e6540a)
2018-02-27 13:33:59 +01:00
luz.paz 751806b5c7 Fix typos with codespell
Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt`
Whitelist consists of:
```
ang
doubleclick
lod
nd
que
te
unselect
```

(cherry picked from commit 612ab4bbc6)
2018-02-22 12:17:06 +01:00
Rémi Verschelde fd033473c7 Fix broken APK expansion due to missed option renames
Command line options were refactored for 3.0 to follow the common usage
of double-dashed long options, but `--main-pack` went through the cracks.

Fixes #16533.

(cherry picked from commit e3658a6464)
2018-02-19 22:19:08 +01:00
Colin Kinloch 611caa06a5 Fixed android arm64v8
(cherry picked from commit 853b1daa49)
2018-02-19 20:46:49 +01:00
Ruslan Mustakov 8d41175cae Fix Android onTextChanged crash
As it turns out, onTextChanged supplies a mutable CharSequence, which
lead to crashes or unexpected behaviour when input was coming faster
than it was processed.
2018-01-17 19:28:27 +07:00
Rémi Verschelde fb0cd802c4
Merge pull request #15773 from endragor/android-gdnative-remote-fs
Make remote FS work with GDNative on Android
2018-01-16 22:26:27 +01:00
Ruslan Mustakov 99f93ea440 Make remote FS work with GDNative on Android
.so files are added to the .apk when remote FS is used.
2018-01-16 15:18:47 +07:00
Ruslan Mustakov 1d763a2cb8 Fix open_dynamic_library for Android 2018-01-13 20:40:20 +07:00
volzhs dfdc8c2d9a Fix Android build error
Fix #15603
Fix #15513
2018-01-12 04:24:11 +09:00
Rémi Verschelde 06bb4acae0
Merge pull request #15440 from volzhs/fix-android-touch
Fix Android multi touch
2018-01-08 08:04:33 +01:00
volzhs 8fbb82719e Fix Android multi touch
Fix #11798
2018-01-07 23:29:44 +09:00
volzhs d2dc70d7d5 Fix Android build error 2018-01-06 22:32:39 +09:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Emmanuel Leblond e315c94900 Change OS::initialize signature to return Error (fix segfault on x11) 2018-01-04 15:15:55 +01:00
Rémi Verschelde b7b0ffd5c4
Merge pull request #15279 from volzhs/android-update-build
Update android build tool to latest
2018-01-03 18:06:08 +01:00
volzhs 4bea7d1b5f Update android build tool to latest 2018-01-03 17:25:07 +09:00