Commit graph

672 commits

Author SHA1 Message Date
Le Philousophe
106f9caa89 ANDROID: Improve emulated gamepad buttons handling
When triggering buttons on the virtual gamepad, the down and up events
are sent on release. That's a leftover from the previous virtual gamepad
which didn't allow to select the buttons easily.
On the new virtual gamepad, the button choice is better so we can
trigger a button down as soon as the finger is on it.
This fixes a bug in some AGS games which missed the button press because
the release was sent too soon.
Fixes Trac#15444.
2025-02-09 14:00:19 +01:00
Le Philousophe
dc13fcf633 ANDROID: Use the proper USAGE category
We are more game than movies.
2025-02-02 12:22:36 +01:00
Le Philousophe
ddfccef675 ANDROID: Add a LED widget and use it to indicate IO activity in SAF
This will notify the user of IOs by blinking the LED. This indicates
that ScummVM is busy and not hung.
2025-01-26 18:17:05 +01:00
Le Philousophe
b82bfc006b ANDROID: Track time spent in SAF queries
This allows to monitor times where we are busy because of I/Os and we
will be able to notify the user.
2025-01-26 18:17:05 +01:00
Le Philousophe
402f31122c ANDROID: Don't track SAFFSNode using JNI global references anymore
The JNI global references are limited in count and we overflow it for
games with a huge number of files (like Zork Nemesis).
Instead, track all the nodes from Java side using a unique identifier
generated using an atomic counter.
Then, all JNI calls either use a temporary local reference to access
node data or use the unique identifier.
2025-01-26 18:17:05 +01:00
Le Philousophe
8ae47f50e2 ANDROID: Store the main activity layout in XML
This lightens the code a bit and make it simpler to understand.
In addition, migrate the buttons layout to GridLayout for future
additions.
2025-01-26 18:17:05 +01:00
Le Philousophe
57c4599dcd ANDROID: Make assets installation depend on config.mk
This makes sure new needed files following a reconfigure are copied.
This does not do the cleanup though.
2025-01-26 18:17:05 +01:00
Le Philousophe
2efc9dd830 ANDROID: Don't use a 0 API level
That doesn't exist, use 1 instead.
2025-01-26 18:17:05 +01:00
Le Philousophe
d0909e102d ANDROID: Allocate enough stack
Default stack allocation for Java thread is 1MB which is shared with
Java side.
On a traditional Linux, the main thread is often up to 8MB.
2025-01-22 19:14:15 +01:00
Le Philousophe
663333de4e BACKENDS: ANDROID: Fix memchr calls
Android libc (Bionic) had a bug in their memchr function where the
needle wasn't considered as an unsigned char for Android below 6.0
except for aarch64 where the implementation was in assembly and behaves
correctly.
This means that on every impacted platform, passing a needle made of a
char >= 0x80 makes memchr never find a match because the value is signed
extended.
Make sure we avoid this case by forcing a cast to unsigned char before
passing an int.
2025-01-13 13:23:06 +01:00
Le Philousophe
0b791ce2e3 BACKENDS: ANDROID: Make the build script executable 2024-12-27 21:35:24 +01:00
Le Philousophe
5925ca5371 BACKENDS: ANDROID: Add build script for release
It builds a fat AAB for Google Play submission and several slim APKs for
the website.
It also uses the proper flags for configure and handles games bundling.
2024-12-27 21:34:53 +01:00
Le Philousophe
3e509f2379 ANDROID: Use getScummVMAssetsPath to access the assets
This fixes cacert lookup
2024-11-15 16:01:23 +01:00
Le Philousophe
60de117a8f ANDROID: Add helper method to compute assets path 2024-11-15 16:01:23 +01:00
Le Philousophe
ae061f0341 ANDROID: Remove useless variable 2024-11-14 22:20:34 +01:00
Le Philousophe
43a4e09d6f ANDROID: Fix shaders loading
When loaded from internal storage, the assets must go deeper than before
as we now extract folders.
2024-11-14 22:20:34 +01:00
Le Philousophe
b634b70dcb ANDROID: Fix bad cacert.pem target
It's a missing change.
2024-11-12 22:57:24 +01:00
Le Philousophe
aef1690c1d ANDROID: Allow packagers to bundle games in the assets
They get copied on update and automatically added.
Removed games located in the assets are cleaned up too.
2024-11-12 22:46:21 +01:00
Le Philousophe
90f7892e3b ANDROID: Forward to C++ side the assets change status 2024-11-12 22:46:21 +01:00
Le Philousophe
5603f64873 ANDROID: Use a checksum of all assets to determine if an update is needed 2024-11-12 22:46:21 +01:00
Le Philousophe
eed4d8a219 ANDROID: Add folders support to copyAssetsToInternalMemory
This allows to extract shaders too.
Move the assets inside a specific subfolder.
This avoid extracting some data from system assets.
2024-11-12 22:46:21 +01:00
Le Philousophe
fdc6ab09f5 ANDROID: Make fat target more generic
It is now possible to build a fat debug APK, release APK, release bundle
2024-11-12 22:43:57 +01:00
Le Philousophe
83091c3f0f ANDROID: Cleanup PHONY targets 2024-11-12 22:43:57 +01:00
Le Philousophe
12b35fb741 ANDROID: Update clean rule
Make it verbose as the other clean rules and clean AAB files too
2024-11-12 22:43:57 +01:00
Le Philousophe
7ad5218e5a ANDROID: Add ability to build a fat bundle
This bundle contains all architectures.
To build it, a base architecture must be configured and the build
process will invoke the make process for all other architectures in
different subfolders.
Then, the bundle will be made with all libraries merged in the base
build directory.
2024-11-12 22:43:57 +01:00
Le Philousophe
47e711e501 ANDROID: Split assets in its own pack for AAB
The AAB is still unique but there are several parts in it.
2024-11-12 22:42:22 +01:00
Le Philousophe
c7584e6f7f ANDROID: Make custom shortcuts really custom
Before this change, the user may not have been able to set its own label
if a shortcut with the same name already existed.
2024-11-12 22:39:58 +01:00
Le Philousophe
d9dcf93f65 ANDROID: Make ShortcutCreatorActivity edge-to-edge compliant 2024-11-12 22:39:58 +01:00
Le Philousophe
cc6a069c69 ANDROID: Rework the insets helper to handle cutouts and system bars
Also fix copy paste bugs and linting errors from Android Studio.
2024-11-12 22:39:58 +01:00
Le Philousophe
5ea3ac6d51 ANDROID: Add support for predictive back gestures
This should make the code future proof.
With this flag enabled, the KEYCODE_BACK event is never sent through
the onKey callback but using a dedicated callback.
2024-11-12 22:39:58 +01:00
Le Philousophe
9a365241f9 ANDROID: Store the ScummVMActivity object in ScummVMEvents
This avoids unsafe casts and makes things cleaner.
2024-11-12 22:39:58 +01:00
Le Philousophe
5d58196643 ANDROID: Merge ScummVMEventsModern and ScummVMEventsBase
The split was done to allow to support versions before HONEYCOMB_MR1 but
we don't support these versions anymore.
2024-11-12 22:39:58 +01:00
Le Philousophe
08f1383dc9 ANDROID: Use PointerIcon.TYPE_ARROW
PointerIcon.TYPE_DEFAULT is deprecated and has always been equal to
TYPE_ARROW.
2024-11-12 22:39:58 +01:00
Le Philousophe
72dcdcc9c6 ANDROID: Allow showing the soft keyboard when a HW is present
When a hardware keybaord is present, Android may display the IME
dependng on a (secure) user setting.
Even if this setting is not documented, as it's here since 2014, it
seems quite safe to use.
In addition, long pressing the input method icon will forcibly display
the soft keyboard even if a HW keyboard is present.
2024-11-09 13:10:57 +01:00
antoniou79
f9251fc030 ANDROID: Improve multitap gesture handling for direct touch mode
More guards were added to hopefully link the mouse down and up events that should be executed in sequence, albeit delayed

Also a new case was added for a delayed mouse up event (in JE_MULTI) to avoid it being executed out of order / too soon.
2024-11-07 17:50:47 +02:00
Le Philousophe
70b1b16a93 ANDROID: Monitor shader changes when building assets 2024-10-27 20:02:39 +01:00
Le Philousophe
1a1315ed2b ANDROID: Drop androidx appcompat requirement 2024-10-27 09:43:34 +01:00
tunnelsociety
e533413c34 JANITORIAL: Fix typo in helpTabs Touch Controls 2024-09-29 21:28:28 +02:00
Eugene Sandulenko
c84a71596f
ANDROID: Drop accidental +x flag on source files 2024-09-24 10:47:17 +02:00
Hubert Maier
4533e12280 JANITORIAL: BACKENDS: Fix typos 2024-09-16 02:13:34 +03:00
Le Philousophe
c8c3a316d6 ANDROID: Properly apply touch settings when starting a game
The 2D graphics backend is recycled from the GUI when starting a game.
As a consequence, touch settings were never applied.
2024-09-14 16:51:19 +02:00
Le Philousophe
ba57ad3a9d ANDROID: Release the AudioTrack instead of stopping it
Stopping throws an exception when the audio track is not initialized.
Releasing is what we want: it stops the track, ignores the error and do
more cleanups.
2024-09-09 18:27:27 +02:00
Le Philousophe
867cbfcd0d ANDROID: Create a dedicated define for Android backend
This allows other backends (SDL, libretro) to be used on Android without
hacks.
2024-09-02 20:53:57 +03:00
Le Philousophe
1d6dc51bb8 ANDROID: Hide the keyboard before _scummvm is null
Else there is a NPE in showScreenKeyboardWithoutTextInputField
2024-09-01 19:14:41 +02:00
Le Philousophe
a98df4e445 ANDROID: Rework the virtual gamepad controller
- Use a SVG asset to allow for better scalability
- Make the controller visible when touching the screen
- Allow for oblique moving by placing finger between two directions
- Add more buttons on the center area of the screen (GUIDE, START, LEFT
  STICK, RIGHT STICK) and simplify right area (only four buttons)
- Don't track all fingers, only the ones needed
- Cleanup now unused code
2024-08-31 16:45:32 +02:00
Le Philousophe
5065891f0c ANDROID: Make system gestures insets available to C++
This will be used by touch controls
2024-08-31 16:45:32 +02:00
Le Philousophe
64eff5293a ANDROID: Add compatibility helper to get system gestures insets 2024-08-31 16:45:32 +02:00
Le Philousophe
e34b92fc2f ANDROID: Push a dynamic shortcut when starting a game
This allows users to fast recall the last games with a long press on the
launcher icon.
This also allows users to pin these shortcuts without having to go by
the widgets selector (which is not implemented in some launchers).
2024-07-27 14:31:44 +02:00
Le Philousophe
8a5628b19c ANDROID: Make some functions static and allow to get a unique game
This will be used later
2024-07-27 14:31:44 +02:00
Le Philousophe
4f742d28e0 ANDROID: Add new compatibility shim to push dynamic shortcuts 2024-07-27 14:31:44 +02:00