Commit graph

1034 commits

Author SHA1 Message Date
Marcel Admiraal
a38fd4a4c2 Remove unused imports from Android Java code 2021-07-02 12:57:55 +01:00
Rémi Verschelde
6ef0b8fcd3
Merge pull request #50074 from madmiraal/android-replace-c-array
Use Java array declarations not C-style declarations in Android Java code
2021-07-02 13:44:22 +02:00
Rémi Verschelde
42184dd6d5
Merge pull request #50072 from madmiraal/android-remove-interface-modifiers
Remove redundant interface modifiers from Android Java code
2021-07-02 12:35:14 +02:00
Marcel Admiraal
721b3d56c5 Use Java array declarations not C-style declarations in Android Java code 2021-07-02 11:09:09 +01:00
Marcel Admiraal
a74e803a4f Remove redundant interface modifiers from Android Java code 2021-07-02 09:37:45 +01:00
Marcel Admiraal
360447001d Remove unnecessary semicolons from Android Java code 2021-07-02 08:54:09 +01:00
Rémi Verschelde
40a594c6ea
Android: Add isGame application attribute, default to true
It can be turned off in the export preset with `package/classify_as_game`.

Upstream definition: https://developer.android.com/guide/topics/manifest/application-element#isGame

> `android:isGame`
>
> Whether or not the application is a game. The system may group together
> applications classifed as games or display them separately from other
> applications.

Also fixes replacing `android:allowBackup` in custom builds.
2021-07-01 11:00:23 +02:00
Marcel Admiraal
8270e101a7 Fix unchecked call to put() warning in GodotInputHandler.java 2021-06-30 12:13:05 +01:00
Marcel Admiraal
7b63f0a22d Add GDNative libraries to Android custom Gradle builds 2021-06-29 09:26:28 +01:00
ne0fhyk
d1a9363c4c Update config versions and deprecate the use of the jcenter maven repo. 2021-06-24 08:58:56 -07:00
ne0fhyk
532b0e3462 Add support for custom debug keystore. 2021-06-22 10:05:55 -07:00
Aaron Franke
0ce49800ac
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
2021-06-20 11:54:24 -04:00
Aaron Franke
e919d894f8
Move many input enums to their own file 2021-06-20 11:53:01 -04:00
Lightning_A
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Marcel Admiraal
de2acbd495 Add adb output to error message when install fails 2021-06-19 17:46:57 +01:00
Rémi Verschelde
ac73059b56
Merge pull request #49123 from aaronfranke/it-is-time
Add a Time singleton
2021-06-12 22:55:25 +02:00
Pedro J. Estébanez
04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
Rémi Verschelde
8d4046929c
Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-io
Core: Move DirAccess and FileAccess to `core/io`
2021-06-11 16:51:10 +02:00
Rémi Verschelde
6b0183ec89
Merge pull request #49279 from Calinou/rename-string-is-abs-path-method
Rename `String.is_abs_path()` to `String.is_absolute_path()`
2021-06-11 15:58:16 +02:00
Aaron Franke
f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
Rémi Verschelde
9e328bb5b7
Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
Rémi Verschelde
bc1fcb9c65
Merge pull request #49435 from madmiraal/add-android-external-dir
Add OS.get_external_data_dir() to get Android external directory
2021-06-10 22:11:02 +02:00
Marcel Admiraal
b3a962945e Add OS.get_external_data_dir() to get Android external directory 2021-06-10 16:48:17 +01:00
Marcel Admiraal
4ba2ed332e Remove unused AudioDriverAndroid from Android 2021-06-10 08:32:56 +01:00
Rémi Verschelde
d567abd714
Merge pull request #49382 from akien-mga/misc-cleanup
Style: Cleanup uses of double spaces between words
2021-06-07 11:57:47 +02:00
Rémi Verschelde
c1c76850cb
Style: Cleanup uses of double spaces between words
Or after punctuation. Tried to leave third-party stuff alone, unless it has
been heavily modified for Godot.
2021-06-07 11:03:08 +02:00
Marcel Admiraal
78e791045c Update Gradle archiveName and destinationDir properties 2021-06-07 06:41:10 +01:00
Hugo Locurcio
5ea1c75d63
Rename String.is_abs_path() to String.is_absolute_path()
This is more consistent with `NodePath.is_absolute()`.
2021-06-03 16:00:06 +02:00
Rémi Verschelde
af3ee1c860
Merge pull request #48963 from HaywardMorihara/export-android-keystore-debug-warnings
Exporting -> Android: Keystore Warnings
2021-06-01 15:22:05 +02:00
reduz
0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00
Rémi Verschelde
ae5735af60
Merge pull request #49069 from RandomShaper/android_data_backup
Allow basic user data backup on Android
2021-05-25 18:06:46 +02:00
Rémi Verschelde
72a7ddaddc
Merge pull request #48422 from szymonm-google/android_orientation_fix
Fixed changing screen orientation on Android
2021-05-25 18:06:00 +02:00
Pedro J. Estébanez
1179421068 Allow basic user data backup on Android 2021-05-25 17:47:32 +02:00
Marcel Admiraal
da5d7db610 Rename File::get_len() get_length() 2021-05-25 11:54:28 +01:00
Szymon Majewski
5634093703 Fixed screen orientation on Android 2021-05-24 16:58:35 -07:00
Nathaniel Morihara
2cf19293ba Exporting: Android Debug Keystore Warnings 2021-05-24 19:48:29 -04:00
Rémi Verschelde
af03e9c830
Merge pull request #48939 from Calinou/screen-orientation-use-enum
Use an enum to represent screen orientation in the Project Settings
2021-05-24 19:53:19 +02:00
Hugo Locurcio
660952a857
Use an enum to represent screen orientation in the Project Settings
- Tweak the setting property hint to be more informative.
- Make the setting a "basic" setting so it appears when Advanced Settings
  is disabled.
- Remove redundant orientation setting in the iOS export preset.
  The project setting is now used (like on Android).

Projects upgrading from a previous version will have to set the
screen orientation again in the Project Settings if it wasn't set
to the default value ("landscape").
2021-05-24 18:53:10 +02:00
bruvzg
139a9d6370
Add symlink API to the DirAccess (on macOS and Linux). 2021-05-22 17:33:34 +03:00
thebestnom
f5b5e00a01 Android: Add support for cursor icons 2021-05-19 22:01:51 +03:00
Rémi Verschelde
23f7c75126
Android: Remove -fno-integrated-as, it can break arm64v8 build
We found that this flag causes this error on PR #48812 which does not add any
fancy inline assembly:
```
/tmp/tile_set-ce236a.s: Assembler messages:
/tmp/tile_set-ce236a.s:34676: Error: selected processor does not support `bfc x0,#32,#32'
clang++: error: assembler command failed with exit code 1 (use -v to see invocation)
```

That flag is mentioned in various errors related to assembler failures on
arm64v8 with Clang from the Android NDK.

It was added in Godot in #6958 when migrating from GCC to Clang, and is indeed
referenced in the NDK's Clang migration guide:
https://android.googlesource.com/platform/ndk/+/master/docs/ClangMigration.md

> Especially for ARM and ARM64, Clang is much stricter about assembler rules
> than GCC/GAS. Use `-fno-integrated-as` if Clang reports errors in inline
> assembly or assembly files that you don't wish to modernize.

We don't get those errors nowadays so it seems the flag is no longer needed.
2021-05-19 18:55:43 +02:00
Rémi Verschelde
6c367f8e0d
Merge pull request #48168 from LightningAA/control-to-ctrl-4.0 2021-05-17 17:38:02 +02:00
Pedro J. Estébanez
469fa47e06
Make all file access 64-bit (uint64_t)
This changes the types of a big number of variables.

General rules:
- Using `uint64_t` in general. We also considered `int64_t` but eventually
  settled on keeping it unsigned, which is also closer to what one would expect
  with `size_t`/`off_t`.
- We only keep `int64_t` for `seek_end` (takes a negative offset from the end)
  and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means
  we only need to guard against passing negative values in `core_bind.cpp`.
- Using `uint32_t` integers for concepts not needing such a huge range, like
  pages, blocks, etc.

In addition:
- Improve usage of integer types in some related places; namely, `DirAccess`,
  core binds.

Note:
- On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with
  version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for
  big files on 32-bit Windows builds made with that toolchain. We might add a
  workaround.

Fixes #44363.
Fixes godotengine/godot-proposals#400.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-05-17 15:06:19 +02:00
Lightning_A
97fecd1b69 Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods 2021-05-07 14:00:50 -06:00
Rémi Verschelde
35ec0e9be7
OS: Remove native video API only implemented on iOS
See discussion in #43811, it was only implemented on iOS and even that
implementation was fairly limited. This would best be provided as plugins
for Android and iOS without cluttering the shared OS API.
2021-05-07 20:40:24 +02:00
Hugo Locurcio
3f078c99f6
Rename IP_Unix, IP_Address and TCP_Server to remove underscores 2021-05-06 02:52:01 +02:00
Aaron Franke
0de9a7d803
Rename doubleclick to double_click 2021-05-04 04:38:08 -04:00
thebestnom
47bf216af9 [Android] fix generateDevTemplate 2021-04-28 21:59:42 +03:00
Rémi Verschelde
305b2a15bf
Merge pull request #48239 from akien-mga/goodbye-copymem
Core: Drop custom `copymem`/`zeromem` defines
2021-04-28 11:04:05 +02:00
Rémi Verschelde
b999fbc4bd
Merge pull request #48228 from akien-mga/android-build-tools-30.0.3
Android: Upgrade buildTools from 30.0.1 to 30.0.3
2021-04-27 18:42:23 +02:00
Rémi Verschelde
8247667a3e
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.
2021-04-27 16:26:27 +02:00
Fredia Huya-Kouadio
abb21844d8 Remove deprecated xr features properties. These properties are now provided directly by the plugin. 2021-04-26 13:20:12 -07:00
Rémi Verschelde
d88e1f04df
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.
2021-04-26 17:22:53 +02:00
Rémi Verschelde
a09f3833bd
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.
2021-04-23 21:33:13 +02:00
Rémi Verschelde
38b25617fe
Merge pull request #48053 from bruvzg/icu_no_except
Re-add "no-exceptions" for export templates builds with ICU.
2021-04-20 22:35:39 +02:00
Rémi Verschelde
c395b9c4ac
Merge pull request #47552 from szymonm-google/validation_layers_android
Validation layers on Android
2021-04-20 20:53:34 +02:00
bruvzg
7e557bbec6
[JS, Android] Re-add "no-exceptions" for export templates builds with ICU. 2021-04-20 21:50:48 +03:00
Fredia Huya-Kouadio
3a033c44b6 Fix issue causing export to fail with "Could not unzip temporary unaligned APK" error and improve command output logging. 2021-04-15 13:33:37 -07:00
thebestnom
e598acff3a Allow to build dev template with symbols 2021-04-14 00:14:57 +03:00
Rémi Verschelde
a9c29fdc1f
Merge pull request #47844 from m4gr3d/update_activity_result_callback
Add support for forwarding callbacks from Godot's parent activity
2021-04-13 10:10:29 +02:00
Fredia Huya-Kouadio
1f16ba2696 Add support for forwarding callbacks from Godot's parent activity. 2021-04-12 16:48:35 -07:00
Fredia Huya-Kouadio
b51dc2dc44 Fix custom boot splash image scaling. 2021-04-12 16:38:41 -07:00
Szymon Majewski
0a29322991 Validation layers on Android 2021-04-12 10:09:06 -07:00
Fredia Huya-Kouadio
a21457155b Fix issue causing the response callback to be invoked with the invalid requestCode and deprecate support for forwarding callbacks from Godot's parent activity. 2021-04-09 13:42:49 -07:00
Rémi Verschelde
d83761ba80
Style: Apply clang-tidy's readability-braces-around-statements 2021-04-05 14:09:59 +02:00
Rémi Verschelde
9bbe51dc27
Style: Apply clang-tidy's modernize-use-nullptr 2021-04-05 14:05:07 +02:00
Aaron Franke
a5324787c8
Rename some more global enums (Key, Joy, MIDI) 2021-03-23 07:13:23 -04:00
Aaron Franke
10d7fccb54
Rename ButtonList enum and members to MouseButton 2021-03-23 07:13:23 -04:00
Rémi Verschelde
fcddd8c53a
Merge pull request #46966 from qarmin/faster_release
Allow to not optimize release build
2021-03-20 22:44:47 +01:00
Bastiaan Olij
b3a43430aa Fixes on android:
- creating Vulkan context instead of OpenGL
- checking for validity of ENV in wrapper classes
- fix for access to JavaVM from threads
2021-03-18 10:41:54 +11:00
Fredia Huya-Kouadio
8f285d93e8 Fix onMainRequestPermissionsResult callback for Android plugins. 2021-03-17 09:23:58 -07:00
Fredia Huya-Kouadio
4380004176 Enable doNotStrip when doing development/debugging within Android Studio 2021-03-16 17:21:00 -07:00
Fredia Huya-Kouadio
2d574bcc85 Leverage java annotations to simplify the logic used to register the Godot plugin methods. 2021-03-16 01:16:08 -07:00
Rafał Mikrut
0b298d201e Allow to not optimize release build 2021-03-14 15:51:05 +01:00
Rémi Verschelde
8051307efe
Merge pull request #46810 from W4RH4WK/file-access-get-buffer-parameter-checks
Add parameter checks to FileAccess get_buffer functions
2021-03-14 01:11:55 +01:00
Rémi Verschelde
7015027cbf
Merge pull request #46900 from Ev1lbl0w/bugfix-malloc_calls
Replace malloc's with Godot's memalloc macro
2021-03-13 21:55:52 +01:00
Ev1lbl0w
838e7d0a8d
Replace malloc's with Godot's memalloc macro 2021-03-13 11:51:45 +00:00
MrBrain295
b849873da5
Non functional to non-functional 2021-03-12 10:37:53 -06:00
Alex Hirsch
cdf3099c68 Add parameter checkes to FileAccess get_buffer functions
fix #46540
2021-03-09 13:55:20 +01:00
Rémi Verschelde
0e8fae1038
Merge pull request #46457 from m4gr3d/fix_invalid_missing_templates_error_master
Fix invalid missing template error when the Android build template is not installed
2021-02-27 16:52:25 +01:00
Fredia Huya-Kouadio
6f0ca6c9f7 Fix invalid missing template error when the Android build template is not installed. 2021-02-26 12:31:12 -08:00
Fredia Huya-Kouadio
6fd881e43c 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 08:38:39 -08:00
Fredia Huya-Kouadio
eda18fcc1f Update the filtering logic to properly handle directories with .gdignore files. 2021-02-24 18:40:36 -08:00
Rémi Verschelde
7f8bfd6ed1
Merge pull request #46381 from m4gr3d/update_godot_fragment_lifecycle_master
Update the initialization timeline for the Godot fragment
2021-02-24 16:14:16 +01:00
Fredia Huya-Kouadio
3ce7678374 Update the initialization timeline for the Godot fragment to be more consistent with the previous activity based timeline. 2021-02-24 06:16:07 -08:00
Fredia Huya-Kouadio
bc5120eb97 Add logic to record the version of the Godot engine for the Android platform. 2021-02-24 04:23:46 -08:00
Rémi Verschelde
310496a89f
Merge pull request #45617 from RandomShaper/modernize_atomics
Modernize atomics (and fix `volatile`)
2021-02-18 19:40:31 +01:00
Pedro J. Estébanez
8e128726f0 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 bool` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18 17:12:46 +01:00
reduz
64140eaf42 Reorganize Project Settings
-Advanced Settings toggle also hides advanced properties when disabled
-Simplified Advanced Bar (errors were just plain redundant)
-Reorganized rendering quality settings.
-Reorganized miscelaneous settings for clean up.
2021-02-18 11:23:34 -03:00
Fredia Huya-Kouadio
526b99ee36 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:20:49 -08:00
Fredia Huya-Kouadio
edeca16fb6 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).
2021-02-17 19:11:05 -08:00
Fredia Huya-Kouadio
9418197081 Add missing ndkVersion to the library gradle build config. 2021-02-17 16:31:31 -08:00
Fredia Huya-Kouadio
e5311f3523 Revert AGP to version 4.0.1 as a workaround to https://issuetracker.google.com/issues/171235570 in version 4.1.x 2021-02-17 15:39:53 -08:00
Rémi Verschelde
c730da8b20
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.
2021-02-18 00:28:51 +01:00
Fredia Huya-Kouadio
9714abf8cb Add verbose logging to help with troubleshooting the Android build/export process. 2021-02-17 13:18:41 -08:00
Fredia Huya-Kouadio
fe9f0758db 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:55:59 -08:00
Michael Conrad
cc2547a9e9 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:37:22 -05:00
Rémi Verschelde
54857d7e81
Merge pull request #44949 from m4gr3d/specify_project_ndk_version
Improve the logic to compile for Android
2021-02-05 13:27:37 +01:00
Rémi Verschelde
74091a1974
Merge pull request #45579 from zaevi/add_scons_ext
add search extensions for Scons' path
2021-02-01 20:41:25 +01:00
zaevi
befbfecd4d add search extensions for scons' path 2021-01-30 20:13:01 +08:00