Commit graph

843 commits

Author SHA1 Message Date
Rémi Verschelde
64a63e0861
Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine 2021-05-04 14:45:15 +02:00
Rémi Verschelde
3d15f04668
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine 2021-05-04 14:45:15 +02:00
Rémi Verschelde
6e600cb3f0
Style: Set clang-format Standard to c++14 2021-05-04 14:45:15 +02:00
Rémi Verschelde
3f5c106e64
Merge pull request #48276 from thebestnom/cherrypick/allow-build-android-with-symbols 2021-04-29 21:15:42 +02:00
Rémi Verschelde
e94161dada
SCons: Add explicit dependencies on thirdparty code in cloned env
Since we clone the environments to build thirdparty code, we don't get an
explicit dependency on the build objects produced by that environment.

So when we update thirdparty code, Godot code using it is not necessarily
rebuilt (I think it is for changed headers, but not for changed .c/.cpp files),
which can lead to an invalid compilation output (linking old Godot .o files
with a newer, potentially ABI breaking version of thirdparty code).

This was only seen as really problematic with bullet updates (leading to
crashes when rebuilding Godot after a bullet update without cleaning .o files),
but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.

(cherry picked from commit c7b53c03ae)
2021-04-29 16:57:00 +02:00
Rémi Verschelde
70ae90e0e8
Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.

Backport of #48239.
2021-04-29 12:34:11 +02:00
Rémi Verschelde
1489b814aa
Android: Upgrade buildTools from 30.0.1 to 30.0.3
It seems 30.0.1 had issues with compatibility with JDK 8 and 11,
which appear to be solved in 30.0.3 as per godotengine/godot-docs#4796.

(cherry picked from commit d88e1f04df)
2021-04-29 12:28:51 +02:00
thebestnom
0477256793 [Android] fix generateDevTemplate 2021-04-28 22:00:25 +03:00
thebestnom
fd7141fc03 [Android] Allow to build dev template with symbols 2021-04-28 22:00:25 +03:00
Rémi Verschelde
5820e36705
Android: Fix get_buffer false positive on empty dest buffer
Follow-up to #46810, this was missed in #47079 when fixing the issue
for other platforms.

Fixes #48135.

(cherry picked from commit a09f3833bd)
2021-04-23 21:49:31 +02:00
Rémi Verschelde
d91c1a60a4
Merge pull request #47954 from m4gr3d/automatically_remove_legacy_storage_attribute
Disable the `requestLegacyExternalStorage` attribute when there are no storage permissions
2021-04-16 17:11:22 +02:00
Fredia Huya-Kouadio
bc68872e2d Disable the requestLegacyExternalStorage attribute when there are no storage permissions. 2021-04-16 07:26:24 -07:00
Fredia Huya-Kouadio
d7e5c8fad5 Fix issue causing export to fail with "Could not unzip temporary unaligned APK" error and improve command output logging. 2021-04-15 13:26:05 -07:00
Fredia Huya-Kouadio
158c848ac5 Fix custom boot splash image scaling. 2021-04-12 16:39:32 -07:00
Fredia Huya-Kouadio
dedeada310 Fix issue causing the response callback to be invoked with the invalid requestCode. 2021-04-09 13:38:36 -07:00
Bastiaan Olij
abaa032fae
Fixes on android:
- checking for validity of ENV in wrapper classes
- fix for access to JavaVM from threads

(cherry picked from commit b3a43430aa)
2021-04-06 22:02:10 +02:00
Rafał Mikrut
6b6324441f
Allow to not optimize release build
(cherry picked from commit 0b298d201e)
2021-03-20 23:05:13 +01:00
Fredia Huya-Kouadio
14e7f6fa7c Fix onMainRequestPermissionsResult callback for Android plugins. 2021-03-17 09:30:19 -07:00
Fredia Huya-Kouadio
864f4201b9
Enable doNotStrip when doing development/debugging within Android Studio
(cherry picked from commit 4380004176)
2021-03-17 15:17:02 +01:00
Fredia Huya-Kouadio
94df08aae1 Leverage java annotations to simplify the logic used to register the Godot plugin methods. 2021-03-16 01:20:43 -07:00
Alex Hirsch
5a882a659a
Add parameter checkes to FileAccess get_buffer functions
fix #46540

(cherry picked from commit cdf3099c68)
2021-03-14 12:03:22 +01:00
Ev1lbl0w
a586f9daae
Replace malloc's with Godot's memalloc macro
(cherry picked from commit 838e7d0a8d)
2021-03-13 22:01:27 +01:00
Rémi Verschelde
8385a0d8ad
Merge pull request #46458 from m4gr3d/fix_invalid_missing_templates_error
[3.2] Fix invalid missing template error when the Android build template is not installed
2021-02-27 16:52:41 +01:00
Fredia Huya-Kouadio
92d3287648 Fix invalid missing template error when the Android build template is not installed. 2021-02-26 12:28:19 -08:00
Fredia Huya-Kouadio
c5fb32d594 Update the logic to load Godot Android plugins packaged into the binary.
The previous logic had the side effect of imposing a limit of one plugin per `aar` binary. The update lifts that restriction.
2021-02-26 09:09:40 -08:00
Fredia Huya-Kouadio
65eb5fdf1e Update the initialization timeline for the Godot fragment to be more consistent with the previous activity based timeline.
(cherry picked from commit 3ce7678374)
2021-02-25 15:14:32 +01:00
Fredia Huya-Kouadio
9fb5215db5 Add logic to record the version of the Godot engine for the Android platform.
(cherry picked from commit bc5120eb97)
2021-02-25 15:14:32 +01:00
Fredia Huya-Kouadio
48108444f1 Update the filtering logic to properly handle directories with .gdignore files. 2021-02-22 20:18:56 -08:00
Hein-Pieter van Braam
220f24c191
Merge pull request #45618 from RandomShaper/modernize_mt_3.2
Backport of all the multi-threading modernization (3.2)
2021-02-18 20:47:24 +01:00
Fredia Huya-Kouadio
ca6e1c1c45
Override ANDROID_NDK_ROOT based on the project ndk version.
This helps resolve issues where the project ndk version differs from the one pointed by the `ANDROID_NDK_ROOT` environment variable (if it exists).

(cherry picked from commit edeca16fb6)
2021-02-18 14:59:10 +01:00
Pedro J. Estébanez
4485b43a57 Modernize atomics
- Based on C++11's `atomic`
- Reworked `SafeRefCount` (based on the rewrite by @hpvb)
- Replaced free atomic functions by the new `SafeNumeric<T>`
- Replaced wrong cases of `volatile` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18 12:23:25 +01:00
Fredia Huya-Kouadio
ef9d945e16 Disable engine splash logic on Android; this is now handled by the Android theme api.
In addition, add support for scaling and applying filter to the splash screen on Android.
One limitation of the api being used is that the splash screen aspect ratio is not maintained when it's scaled up.
2021-02-18 03:17:58 -08:00
Pedro J. Estébanez
6d89f675b1 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-02-18 11:58:08 +01:00
Pedro J. Estébanez
4ddcdc031b Modernize Mutex
- Based on C++11's `mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
- `BinaryMutex` added for special cases as the non-recursive version
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
2021-02-18 11:58:08 +01:00
Fredia Huya-Kouadio
96a3f01ac5
Add missing ndkVersion to the library gradle build config.
(cherry picked from commit 9418197081)
2021-02-18 10:37:59 +01:00
Fredia Huya-Kouadio
1557bc8396
Revert AGP to version 4.0.1 as a workaround to https://issuetracker.google.com/issues/171235570 in version 4.1.x
(cherry picked from commit e5311f3523)
2021-02-18 10:37:28 +01:00
Rémi Verschelde
48b73e4532
Android: Bump NDK version to 21.4.7075529
This is what GitHub Actions now provide and they removed the previous 21.3.6528147.
A bit annoying to have our hand forced this way but it's still 21.x so should be good
to upgrade.

(cherry picked from commit c730da8b20)
2021-02-18 00:36:46 +01:00
Fredia Huya-Kouadio
d559def1a9 Add verbose logging to help with troubleshooting the Android build/export process. 2021-02-17 13:30:01 -08:00
Fredia Huya-Kouadio
64f5a7b8ca Expose GodotPlugin's utility methods used for registration and signal emitting.
This enables creation and use of a plugin like class by composition rather than inheritance.
2021-02-15 15:57:36 -08:00
Michael Conrad
8777282c40 Fix joystick axis mapping issues with NVIDIA shield. Probably others.
Issues addressed:

a) Axis mappings were including virtual mouse axes on NVIDIA Shield TV.

The virtual mouse axes have the same axis numbers as the normal analog stick numbers. This was completely breaking joypad support on NVIDIA Shield TV.

b) Joypads were being tracked in a List with the index in the list being treated as the Godot device id.

If a device were to be removed, any device later in the list would be shifted, potentially causing future events with the shifted joypads to have incorrect IDs according to the Godot engine.

c) Unnecessary events were being sent to the Godot engine.

A check was added (per Joystick) that will prevent sending events for all axes when only a single axis value changed.
A similar check was added for "HATs".

See #45712
2021-02-09 08:33:42 -05:00
Fredia Huya-Kouadio
5886d09521 Improve the logic to compile for Android by automatically detecting and setting up the Android NDK if needed.
(cherry picked from commit eee213e01a)
2021-02-05 13:29:02 +01:00
zaevi
56535539d4
add search extensions for scons' path
(cherry picked from commit befbfecd4d)
2021-02-02 13:02:47 +01:00
Sergey Minakov
64923945b3 [Plugins] Rename 'PluginConfig' struct to platform specific name 2021-01-15 02:12:53 +03:00
Rémi Verschelde
49646383f1
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
Rémi Verschelde
188609e5ab
CI: Update to clang-format 11 and apply ternary operator changes
(cherry picked from commit af878716f2)
2021-01-13 16:14:35 +01:00
Fredia Huya-Kouadio
170752c5a5 Update the logic to sign prebuilt Godot Android apks.
The previously used tool, `jarsigner` has been deprecated in favor of `apksigner` which is bundled with the Android SDK.
The logic is refactored accordingly and a few editor settings have been deprecated in the process as they're no longer necessary.

Note: As a side effect, specifying the Android SDK path is now required. The docs will be updated to reflect that change.
2021-01-01 13:27:27 -08:00
Rémi Verschelde
95b3feb675
Merge pull request #44639 from m4gr3d/export_format_util_method_3_2
[3.2] Hardcode the export format for the editor 'run' feature
2020-12-30 09:12:00 +01:00
Fredia Huya-Kouadio
3ba1a8ccb3 Add utility method to export the project using a preset format and sign parameter. 2020-12-29 09:01:21 -08:00
Fredia Huya-Kouadio
c27c436785
Fix invalid invocation of get_class_loader.
The call was made on a `Godot` instance instead of an `Activity` instance.

(cherry picked from commit 2d492ff8ba)
2020-12-29 16:02:02 +01:00
Marcel Admiraal
e21adf2bc6 Don't handle BaseException in build scripts 2020-12-12 10:10:23 +00:00