[Scummvm-git-logs] scummvm master -> 38eb53f1db22bfaa589ec24e1d2dd14dc9e30583
larsamannen
noreply at scummvm.org
Fri Jul 21 21:06:05 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9a980c9dd4 IOS7: Fix show/hide of virtual controller in iOS 15
38eb53f1db IOS7: Add X and Y buttons to virtual controller
Commit: 9a980c9dd42773a655b491713bfc1fb2cf54b4e4
https://github.com/scummvm/scummvm/commit/9a980c9dd42773a655b491713bfc1fb2cf54b4e4
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-07-21T23:06:01+02:00
Commit Message:
IOS7: Fix show/hide of virtual controller in iOS 15
The change in commit 1b3c783b9eebbb3ee784a56db73b0a635328a4c3 assumed
that the orientation already had been updated when the system called
viewWillTransitionToSize. This seems to be true for iOS 16 while in
iOS 15 the orientation seems to be updated a bit later.
In iOS 16, make sure that the current orientation is updated when the
function viewWillTransitionToSize is called to make sure it's updated
when the adjustViewFrameForSafeArea is called. This makes sure that the
screen size is updated correctly when forcing the orientation based on
the backend user setting.
In iOS 15 (and below), set the current orientation when the transition
animation finishes to make sure that the interface orientation has been
updated to make sure the virtual controller is connected/disconnected
properly based on the orientation.
Changed paths:
backends/platform/ios7/ios7_scummvm_view_controller.mm
diff --git a/backends/platform/ios7/ios7_scummvm_view_controller.mm b/backends/platform/ios7/ios7_scummvm_view_controller.mm
index 8acaa4c98ca..576704327b4 100644
--- a/backends/platform/ios7/ios7_scummvm_view_controller.mm
+++ b/backends/platform/ios7/ios7_scummvm_view_controller.mm
@@ -88,11 +88,26 @@
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
+
+ // In iOS 16, make sure that the current orientation is updated when the
+ // function viewWillTransitionToSize is called to make sure it's updated
+ // when the adjustViewFrameForSafeArea is called. This makes sure that the
+ // screen size is updated correctly when forcing the orientation based on
+ // the backend user setting.
UIInterfaceOrientation orientationAfter = [self interfaceOrientation];
- if (orientationAfter != UIInterfaceOrientationUnknown && orientationAfter != currentOrientation) {
- currentOrientation = orientationAfter;
- [[iOS7AppDelegate iPhoneView] interfaceOrientationChanged:currentOrientation];
+ if (orientationAfter != UIInterfaceOrientationUnknown) {
+ [self setCurrentOrientation:orientationAfter];
}
+ // In iOS 15 (and below), set the current orientation when the transition
+ // animation finishes to make sure that the interface orientation has been
+ // updated to make sure the virtual controller is connected/disconnected
+ // properly based on the orientation.
+ [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
+ UIInterfaceOrientation orientationAfter = [self interfaceOrientation];
+ if (orientationAfter != UIInterfaceOrientationUnknown) {
+ [self setCurrentOrientation:orientationAfter];
+ }
+ }];
}
#endif
Commit: 38eb53f1db22bfaa589ec24e1d2dd14dc9e30583
https://github.com/scummvm/scummvm/commit/38eb53f1db22bfaa589ec24e1d2dd14dc9e30583
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-07-21T23:06:01+02:00
Commit Message:
IOS7: Add X and Y buttons to virtual controller
Changed paths:
backends/platform/ios7/ios7_gamepad_controller.mm
diff --git a/backends/platform/ios7/ios7_gamepad_controller.mm b/backends/platform/ios7/ios7_gamepad_controller.mm
index 20c1776bce1..157693093c3 100644
--- a/backends/platform/ios7/ios7_gamepad_controller.mm
+++ b/backends/platform/ios7/ios7_gamepad_controller.mm
@@ -56,7 +56,7 @@
if (@available(iOS 15.0, *)) {
// Configure a simple game controller with dPad and A and B buttons
_config = [[GCVirtualControllerConfiguration alloc] init];
- _config.elements = [[NSSet alloc] initWithObjects:GCInputDirectionPad, GCInputButtonA, GCInputButtonB, nil];
+ _config.elements = [[NSSet alloc] initWithObjects:GCInputDirectionPad, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY, nil];
_virtualController = [[GCVirtualController alloc] initWithConfiguration:_config];
}
#endif
More information about the Scummvm-git-logs
mailing list