Commit Graph
4393 Commits
Author SHA1 Message Date
Eugene Sandulenko c5d91134ee BACKENDS: DS: Use icCLUT8() 2023-02-02 19:33:20 +01:00
Lars Sundström 235ebcbfb8 IOS7: Fix compiler warnings
This commit fixes the compiler warnings regarding:
- The local declaration of 'view' hides instance variable [-Wshadow-ivar]
- Some of the gamepad controller buttons is only available in specific
versions of iOS and tvOS.
- Use of non-standard escape character '\E'. \E is a GNU shortcut.
2023-01-29 21:13:52 +00:00
Lars Sundström fde0aa965d IOS7: Add general handling of the menu button on game controllers
Expose the handleMainMenuKey function and call that when pressing the
menu button on game controllers.
2023-01-29 21:13:52 +00:00
Lars Sundström 770ab0ca50 IOS7: Suspend application if menu key pressed and no game is running
Add isInGame property to track if the launcher is shown of if a game is
running. Handle press on menu key different depending on if launcher is
shown or not. If launcher is shown suspend the application to return to
Apple TV Home Screen since that is the parent view of the launcher. If
in game pause the game and show menu. This is according to Apple
guidelines which can ge read here:
https://developer.apple.com/design/human-interface-guidelines/inputs/remotes
2023-01-29 21:13:52 +00:00
Lars Sundström 4c0cd6f2eb IOS7: Check keyboard visible if inputView being first responder
The keyboard can be presented and dismissed without being triggered by
the showKeyboard/hideKeyboard functions e.g. by pressing the menu button
on the Apple TV remote while the keyboard is shown.
If the keyboard visibility is not set entirely by the showKeyboard/
hideKeyboard functions that means that the _keyboardVisible state
variable can be out of sync.

Check if the keyboard is shown based on if the inputView is the first
responder or not. The check has to be made on the main thread.
2023-01-29 21:13:51 +00:00
Lars Sundström b2b2d2cf9f IOS7: Trigger joystick presses only once for buttons A and B
All buttons and triggers on MFi game controllers are pressure sensitive
which means that when pressing buttons the registered
valueChangedHandler function is called multiple times providing updates
on the pressure value the button is pressed with. This causes multiple
kInputJoystickButtonDown events to be sent to the EventManager.
In adventure games the pressure value is not relevant and could cause
problems for the user that it triggers multiple presses on e.g. the B
button which often is mapped to the right mouse button. In some games
a click on the right mouse button changes what action that should be
performed.

Keep track on if the joystick buttons A or B (often mapped as left and
right mouse buttons) are being pressed. If the button is already
pressed do not add a new event until the button isn't pressed anymore.

To not interfere with any open dialog, don't send key events while the
keyboard is visible.
2023-01-29 21:13:51 +00:00
Lars Sundström 8a2a6aa197 IOS7: Show inputAccessoryView when hardware keyboad is connected
The inputAccessoryView is only shown if no hardware keyboard is
connected. Some hardware keyboards doesn't necessary have all keys,
e.g. the Apple magic keyboard to the iPads which lacks the escape
key and all function keys.

To give the user the possibility to use these buttons, always show
the inputAccessoryView.
2023-01-29 21:13:51 +00:00
Lars Sundström 3dae4b033e IOS7: Replace UIAlertView with UIAlertAction
The UIAlertView was deprecated in iOS 9 and therefore not supported in
tvOS. Replace the UIAlertView with the suggested UIAlertAction, which is
supported by both iOS and tvOS.

Define a macro to find the root view controller of a view. Use the view
controller of the iPhoneView to present the alert.
2023-01-29 21:13:51 +00:00
Lars Sundström 14ee8b07d3 IOS7: Forward backward key presses when textField is empty
There's a difference between UITextFields and UITextViews that the
delegate function textView:shouldChangeTextInRange:replacementText:
is called when pressing the backward button on a keyboard also when
the textView is empty. This is not the case for UITextFields, the
function textField:shouldChangeTextInRange:replacementText: is not
called if the textField is empty which is problematic in the cases
where there's already text in the open dialog (e.g. the save dialog
when the user wants to overwrite an existing slot). There's currently
no possibility to propagate existing text elements from dialog into
the textField. To be able to handle the cases where the user wants to
delete existing texts when the textField is empty the inputView has
to implement the UITextInput protocol function deleteBackward that is
called every time the backward key is pressed.
2023-01-29 21:13:51 +00:00
Lars Sundström d731c9c290 IOS7: Implement keyboard support for Apple TV OS
The UITextView is becoming focused by default in iOS and brings up the
keyboard for user input. This is not the case in tvOS. UITextView in
tvOS is not becoming focused by default and if manually setting it to
focused it will still not bring up the keyboard screen.

The UITextField is however becoming focused in both iOS and tvOS and
requires basically the same implementation. So the UITextView is
replaced with UITextField to bring up keyboard in both iOS and tvOS.

The UIToolbar class is not supported in tvOS. Instead implement the
toolbar as a UITabBar. The UITabBar is set directly as the
inputAccessoryView to the keyboard view in tvOS while in iOS it's put in
a UIScrollView (as the previous UIToolbar) to be able to scale the
inputAccessoryView better for small screens.

The UITabBar behaves a little bit different on iOS and tvOS where in
tvOS the delegate function
-(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
is called when navigated to a specific toolbar item, while in iOS called
when clicking on an item. To get the tvOS to trigger action on presses,
add a gesture recognizer to handle touch events.

Since the keyboard view on Apple TV always full screen prompted texts
gets hidden behind the keyboard. Delay the showing of the keyboard to
allow the user to understand what's requested as input.
2023-01-29 21:13:51 +00:00
Lars Sundström 5aeef796bc IOS7: Implement support for Apple TV remote
The Apple TV remote has a touch area which functions as a touch
controller. It also has a few buttons that can be programmed for
different actions.

The "touchpad mode" is not really relevant for the Apple TV remote.
However the pointer should be moved when swiping on the touch area
on the remote. Since we don't want to generate actions on touchBegan
and touchEnded for the remote, make sure these are only triggered if
the touch is made on direct contact with the screen, UITouchTypeDirect.

Implement the button handling by implement the microGamepad profile in
the GamepadController class. Only buttons A, X and the menu buttons are
relevant since the touch area is using the touch controller class.
The tvOS simulator however doesn't call the lambda functions defined for
the microGamepad buttons, hence the implementation of the "pressesBegan"
and "pressesEnded" which is called instead when running the simulator.

Implement common handling of the menu button. If the menu button is
pressed the soft keyboard will be shown. If pressing the menu button
again the soft keyboard will be hidden. If pressing the menu button
a third time the application will be suspended.

Implement new gesture recognizers that can be used with the Apple TV
remote. Up/down/left/right actions are triggered on press on the arrow
buttons, or tap on the edges of the touch area.

A long press, 5 seconds, of "Play/Pause" button toggles Mouse-click-and-
drag mode needed by some games.
2023-01-29 21:13:51 +00:00
Lars Sundström c24ee0d61e IOS7: Add missing break to kInputJoystickButtonUp
Joystick button up events was not sent to the EventManager due to a
missing break in the kInputJoystickButtonUp case. This caused button
presses in the launcher and dialogs not to be triggered.

Adding the break enables use of joystick buttons in ScummVM GUIs.
2023-01-29 21:13:51 +00:00
Lars Sundström 5f54aedbb9 IOS7: Put iOS specific code within platform specific macros
iOS and tvOS shares a lot of code. However some there are parts that are
specific to iOS, for instance handling of UI device orientation and
certain types of gestures.

Currently there are also some limitations on the Apple TV that needs to
be flagged to the  engine. There is no support for virtual keyboard, no
clipboard support and no possibility to open URLs.

Put code specific for iOS within the ObjC platfrom macro TARGET_OS_IOS.
The code specific for tvOS are put within the macro TARGET_OS_TV.
2023-01-29 21:13:51 +00:00
sluicebox 7c2ff3687f WIN32: Disable libjpeg-turbo SSE usage on Win95
Fixes bug #13643
2023-01-26 13:57:23 -08:00
Lothar Serra Mari baa0a1fa10 RELEASE: This is 2.8.0git 2023-01-20 20:31:01 +01:00
Le Philousophe baf42ae7e6 ANDROID: Add a dialog to revoke SAF authorizations
Remove old all-in-one revoke authorizations process
2023-01-20 14:14:03 +01:00
Le Philousophe f78e79fd4f ANDROID: Clear SAF cache when activity is hidden
This allows to refresh when user changed the folders behind ScummVM back
2023-01-20 14:14:03 +01:00
Le Philousophe a465718c24 ANDROID: Fix comment
For coherence sake
2023-01-20 14:14:03 +01:00
Le Philousophe ca1dbfc9d6 ANDROID: Add SAF support 2023-01-20 14:14:03 +01:00
Le Philousophe c60ad0a554 ANDROID: Various cleanups in JNI
Mostly fixing memory leaks (Java references).
No need to preinit semaphore (sem_init is called).
First initialize methods ID before starting anything.
Aborts if a method is not found.
2023-01-20 14:14:03 +01:00
Le Philousopheandantoniou79 9631567923 ANDROID: Add a method to get running SDK version
Co-authored-by: antoniou79 <a.antoniou79@gmail.com>
2023-01-20 14:14:03 +01:00
Le Philousophe e17b34c9dc ANDROID: Store JNI environment in a thread local variable
This avoids to query JVM every time we need to do a JNI call.
A different environment is attached to each thread, hence the TLS
variable.
2023-01-20 14:14:03 +01:00
Christophe Branchereau 12b22ab6a4 OPENDINGUX: update the Readme with better controls description
Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
2023-01-19 11:33:29 +01:00
Vladimir Serbinenko d4675e7ddc MIYOO: Correct gamepad mapping and corresponding documentation 2023-01-19 01:07:07 +01:00
Vladimir Serbinenko 378d1721ed MIYOO: Adjust button bindings for miyoo mini 2023-01-18 00:51:38 +03:00
Vladimir Serbinenko 4eb090775e MIYOO: Set right paths for Miyoo Mini 2023-01-18 00:51:38 +03:00
Vladimir Serbinenko 576b2be0cb SDL: Workaround for broken SDL on Miyoo Mini 2023-01-18 00:51:38 +03:00
Vladimir Serbinenko 66202f3a32 MIYOO: Configure and makefile support for Miyoo mini 2023-01-18 00:51:38 +03:00
Christophe Branchereau 09be5f6e7a OPENDINGUX: remove export CXXFLAGS="-funsigned-char"
The tolower() bug doesn't happen anymore

Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
2023-01-17 12:57:53 +01:00
Vladimir Serbinenko 1bc4fe5279 SDL: Move RS90-specific code to opendingux directory 2023-01-17 13:48:50 +03:00
Vladimir Serbinenko de6fa88217 OPENDINGUX: Separate miyoo from opendingux 2023-01-16 23:01:25 +03:00
Christophe Branchereau 2724ce7753 OPENDINGUX: simplify build scripts
The rs90 and rg99 can use the exact same binary and opk including
the .desktop file

Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
2023-01-16 10:31:14 +01:00
Eugene Sandulenko 625e1e4500 BACKENDS: DC: Fix compilation 2023-01-13 00:03:44 +01:00
Vladimir Serbinenko d924671cec OPENDINGUX: Miyoo (1st gen) support 2023-01-12 16:39:38 +03:00
Vladimir Serbinenko c86975e7e7 OPENDINGUX: Switch to using modules
Those devices are low on memory. Modules allow not to load extra egines.
2023-01-12 10:27:20 +03:00
Vladimir Serbinenko 16cd6d7512 OPENDINGUX: Create combined opk for rs90 and rg99 2023-01-12 10:27:20 +03:00
Cameron Cawley 7f2d9fd0fd GRAPHICS: Split conversion.cpp into multiple files 2022-12-22 23:45:14 +01:00
Cameron Cawley 8cd1f1413f DS: Fix building from a clean source directory 2022-12-22 19:36:56 +00:00
Cameron Cawley 066979c96a DS: Display the ScummVM logo on the top screen when the launcher is active 2022-12-22 18:21:04 +00:00
Cameron Cawley 435ced7c5c DS: Separate the Background class from Graphics::Surface 2022-12-22 12:25:47 +00:00
Rudis Muiznieks 930028522e ANDROID: Simplify Joystick axis scaling
The scaling of Joystick axis values has been moved to the Java event
handler.
2022-12-19 00:36:51 +00:00
Rudis Muiznieks c33a65e32b ANDROID: Map Joystick inputs to Joystick events
Previously joystick motion inputs were being translated to direct mouse
movement events. This changes those into Joystick AXIS events instead.
Also updates joystick button inputs into joystick button events instead
of mouse clicks and key presses.
2022-12-19 00:36:51 +00:00
Rudis Muiznieks fb9416eacb ANDROID: Map gamepad inputs to joystick events
Previously most buttons were being ignored and A and B were mapped to
mouse clicks. This maps A and B and several more buttons to Joypad
button presses instead.
2022-12-19 00:36:51 +00:00
Vladimir Serbinenko 2638e6b2a0 3DS: Make path to bannertool and makerom configurable.
This allows to set them without adding to path
2022-12-14 12:17:39 +01:00
Vladimir Serbinenko e34c41eaaa 3DS: Add explicit path to picasso, bin2s and co
This avoid the need to add them to $PATH explicitly
2022-12-14 12:17:39 +01:00
sluicebox 442792eb78 WIN32: Remove SHGetSpecialFolderPath warnings on Win95 2022-12-07 16:26:07 -08:00
Lars Sundström f76cf2195e IOS7: Make "touchpad mode" usable again
"Touchpad mode" is a mode where the mouse cursor is moved based on touch
movements rather on clicks. The problem was that when "touchpad mode"
was enabled it was very hard to click on items because the cursor moved
on every single click.

Make the action occur based on the current pointer position rather on
the touch location  when in "touchpad mode".

Make the movement more intuitive when in "touchpad mode" by calculating
the delta of locations of touches and update the pointerPosition based
on that. That will give a feeling of using a real touchpad where the
location of where the touch occur doesn't matter for the cursor.

This will solve issue #13917
2022-12-05 22:02:13 +00:00
Donovan Watteau af87992771 DS: Clean map.txt leftover from -Wl,-Map,map.txt 2022-12-02 13:46:09 +01:00
Eugene Sandulenko fb7095f5a4 COMMON: Move all compression-related files to a separate directory 2022-12-01 11:53:02 +01:00
Donovan Watteau 06380fc9c3 MACOSX: Prefer openURL/openURLs over openFile on macOS 10.15+
They're the recommended APIs now, and openFile is deprecated starting
with macOS 11.0. openURLs:withApplicationAtURL (for TextEdit usage)
requires macOS 10.15+, so we need different code paths.
2022-11-29 00:11:03 +01:00