Commit Graph
8972 Commits
Author SHA1 Message Date
Eugene Sandulenko c5d91134ee BACKENDS: DS: Use icCLUT8() 2023-02-02 19:33:20 +01:00
Eugene Sandulenko e0736936e9 BACKENDS: OPENGL: Use isCLUT8() 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
Vladimir Serbinenko a1fdd9df20 MIYOO: Use 640x480 GUI
it looks nice and crisp on this handheld
2023-01-29 10:41:10 +01:00
sluicebox 7c2ff3687f WIN32: Disable libjpeg-turbo SSE usage on Win95
Fixes bug #13643
2023-01-26 13:57:23 -08:00
Le Philousophe 0416279980 OPENGL: Fix glitch when shaking screen
Everything was converted to unsigned instead of the opposite.
2023-01-24 19:40:48 +01:00
Christophe Branchereau 7fa860166e OPENDINGUX: use 320x200 videomode for the RG99 instead of 320x240
This allows the software upscaler to kick in, which looks
much better than IPU upscaling on the RG99

Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
2023-01-23 12:04:25 +01: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 0fdf53f984 ANDROID: Remove platform specific code from shared code 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
Le Philousophe 54fd20c36c POSIX: Refactor DrivePOSIXFilesystemNode to allow for dynamic drives 2023-01-20 14:14:03 +01:00
Le Philousophe 787d4e1db6 POSIX: Allow to subclass DrivePOSIXFilesystemNode
Without this, there are some cases where the nodes created are not the
subclass.
Also make _config available to derived classes.
2023-01-20 14:14:03 +01:00
AndywinXp aae1cac682 GUI: Only show the quit dialog in absence of an engine GUI override 2023-01-20 10:03:37 +01:00
Vladimir Serbinenko 42a5aac407 SURFACESDL: Fix overlay background when using hardware palette 2023-01-20 05:45:37 +03: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
Martin Gerhardy f101941710 NETWORKING: fixed mixed malloc/delete/delete[]
==84284== Mismatched free() / delete / delete []
==84284==    at 0x484371B: operator delete(void*) (vg_replace_malloc.c:923)
==84284==    by 0x5BFBBF: Networking::CurlRequest::~CurlRequest() (curlrequest.cpp:38)
==84284==    by 0x5C0963: Networking::CurlJsonRequest::~CurlJsonRequest() (curljsonrequest.cpp:40)
==84284==    by 0x5ACF0B: Cloud::GoogleDrive::GoogleDriveTokenRefresher::~GoogleDriveTokenRefresher() (googledrivetokenrefresher.cpp:37)
==84284==    by 0x5ACF27: Cloud::GoogleDrive::GoogleDriveTokenRefresher::~GoogleDriveTokenRefresher() (googledrivetokenrefresher.cpp:37)
==84284==    by 0x5BC2FC: Networking::ConnectionManager::interateRequests() (connectionmanager.cpp:189)
==84284==    by 0x5BC0FA: Networking::ConnectionManager::handle() (connectionmanager.cpp:158)
==84284==    by 0x5BBF45: Networking::connectionsThread(void*) (connectionmanager.cpp:127)
==84284==    by 0x5E6932: DefaultTimerManager::handler() (default-timer.cpp:110)
==84284==    by 0x5D7F04: timer_handler(unsigned int, void*) (sdl-timer.cpp:32)
==84284==    by 0x49283D3: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.2600.1)
==84284==    by 0x4927F64: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.2600.1)
2023-01-17 23:17:17 +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
Vladimir Serbinenko a0cb2fb05e SURFACESDL: Don't pass private flags to SDL_CreateRGBSurface
sdl_video.h names all of SDL_RLEACCEL, SDL_SRCCOLORKEY and SDL_SRCALPHA
as private and read-only. Documentation mentions them in
SDL_CreateRGBSurface but also says they are automatically set on
either SDL_SetColorKey or on non-zero Amask.

Previously passing them created no problem but miyoo mini SDL gets confused,
so let's never pass the private flags.
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 5bdabeed7e SURFACESDL: Make getDefaultResolution overideable by custom backends 2023-01-17 13:48:50 +03:00
Vladimir Serbinenko 81fdd308cf SURFACESDL: Extract initing of graphics surface into a separate method. 2023-01-17 13:48:50 +03:00
Vladimir Serbinenko 4a0d9c2665 SDL: Add missing init of _prevCursorNeedsRedraw 2023-01-17 13:48:20 +03:00
Vladimir Serbinenko de6fa88217 OPENDINGUX: Separate miyoo from opendingux 2023-01-16 23:01:25 +03:00
Cameron Cawley 40f797fdef SDL: Support VSync with OpenGL in SDL1 builds 2023-01-16 18:09:53 +01:00
Cameron Cawley 138a983d80 COMMON: Refactor VSync handling to match the other options 2023-01-16 18:09:53 +01: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
Christophe Branchereau 2994ab025d OPENDINGUX: force 320x240 for the RG99
The device has a 320x480 screen and aspect of gui is wrong if we use
the full resolution

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