[Scummvm-git-logs] scummvm master -> ceb54851c53c65f62a29a030b2c5f168ce3368c0
larsamannen
noreply at scummvm.org
Sun Jan 21 09:57:33 UTC 2024
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4db72b15d2 IOS7: Fix toggling of mouse mode when HW keyboard connected
20d14337c9 IOS7: Make "Designed for iPad" on Mac silicon great again
da19f39164 IOS7: Update the window size correctly
ceb54851c5 IOS7: Make specific options if running in macOS
Commit: 4db72b15d21c39dfc5d958c82ff127022e86e19e
https://github.com/scummvm/scummvm/commit/4db72b15d21c39dfc5d958c82ff127022e86e19e
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-01-21T10:57:27+01:00
Commit Message:
IOS7: Fix toggling of mouse mode when HW keyboard connected
It was not possible to change the mouse mode between "Direct mouse"
and "Touchpad emulation" if a hardware keyboard was connected when
using the on-screen control button.
Fix this by checking if a hardware keyboard is connected.
Changed paths:
backends/platform/ios7/ios7_video.mm
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index d0522b130c7..42877eda7a5 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -389,7 +389,14 @@ bool iOS7_fetchEvent(InternalEvent *event) {
#if TARGET_OS_IOS
- (void)triggerTouchModeChanged {
- if ([self isKeyboardShown]) {
+ BOOL hwKeyboardConnected = NO;
+ if (@available(iOS 14.0, *)) {
+ if (GCKeyboard.coalescedKeyboard != nil) {
+ hwKeyboardConnected = YES;
+ }
+ }
+
+ if ([self isKeyboardShown] && !hwKeyboardConnected) {
[self hideKeyboard];
} else {
[self addEvent:InternalEvent(kInputTouchModeChanged, 0, 0)];
Commit: 20d14337c9e6d094ff991689afca4138a11d96d1
https://github.com/scummvm/scummvm/commit/20d14337c9e6d094ff991689afca4138a11d96d1
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-01-21T10:57:27+01:00
Commit Message:
IOS7: Make "Designed for iPad" on Mac silicon great again
It is possible to run iOS applications on macOS on Mac computers
running on Apple Silicon. This was possible before moving to the
ModularGraphicsBackend implementation in the iOS7 port with just
a little tweaking.
After the move to ModularGraphicsBackend, the ScummVM application
crashed on launch. There were two reasons for crashing;
1. dlsym() was called with the special handle RTLD_SELF to search
for the address binding of the GLES2 load symbol. Using RTLD_SELF
the search for the symbol is limited to the shared object issuing
the call to dlsym() and those shared objjects which were loaded
after it. When running an iOS app in macOS it seems that the app
is running inside a wrapper, which means that the objects resides
in a different level. Changing the search level to RTLD_DEFAULT
changes the search to also include all objects loaded at program
start-up.
2. As for the native macOS application, XCode also adds the
argument -NSDocumentRevisionsDebugMode YES if XCode option
"Allow debugging when using document Versions Browser" is on.
Make sure not to parse that argument also when building the
IPHONE target.
Changed paths:
backends/platform/ios7/ios7_osys_main.cpp
base/commandLine.cpp
diff --git a/backends/platform/ios7/ios7_osys_main.cpp b/backends/platform/ios7/ios7_osys_main.cpp
index 52b5b9fa4b7..241501e70f2 100644
--- a/backends/platform/ios7/ios7_osys_main.cpp
+++ b/backends/platform/ios7/ios7_osys_main.cpp
@@ -114,7 +114,7 @@ OSystem_iOS7::~OSystem_iOS7() {
#if defined(USE_OPENGL) && defined(USE_GLAD)
void *OSystem_iOS7::getOpenGLProcAddress(const char *name) const {
- return dlsym(RTLD_SELF, name);
+ return dlsym(RTLD_DEFAULT, name);
}
#endif
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index aec21fd26e2..2123ccd63ce 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -626,7 +626,7 @@ Common::String parseCommandLine(Common::StringMap &settings, int argc, const cha
// to pass the process serial number. We need to ignore it to avoid an error.
// When using XCode it also adds -NSDocumentRevisionsDebugMode YES argument if XCode option
// "Allow debugging when using document Versions Browser" is on (which is the default).
-#ifdef MACOSX
+#if defined(MACOSX) || defined(IPHONE)
if (strncmp(s, "-psn_", 5) == 0)
continue;
if (strcmp(s, "-NSDocumentRevisionsDebugMode") == 0) {
Commit: da19f3916407116df0b636f788cec2ade8d81b53
https://github.com/scummvm/scummvm/commit/da19f3916407116df0b636f788cec2ade8d81b53
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-01-21T10:57:27+01:00
Commit Message:
IOS7: Update the window size correctly
Applications running on iOS are usually full screen. On newer iPads
and when running iOS applications on macOS the application window
size can be changed.
When running the iOS application on macOS using "Designed for iPad"
option, the window can be changed, also to full screen. The function
"safeAreaInsetsDidChange" is then called. Update the screen size
using the view window property instead of checking the UIScreen
window bounds since these never changes.
If forcing the application to run in full screen setting the option
UIRequiresFullScreen to TRUE, it seems to trigger ScummVM to run
in portrait mode instead of landscape mode when running the app in
macOS using "Designed for iPad" on Apple silicon macs.
The UI doesn't require full screen since the application handles
resolution changes nice.
Changed paths:
backends/platform/ios7/ios7_video.mm
dists/ios7/Info.plist
dists/ios7/Info.plist.in
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 42877eda7a5..7089a33d563 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -471,7 +471,7 @@ bool iOS7_fetchEvent(InternalEvent *event) {
if ( @available(iOS 11, tvOS 11, *) ) {
CGRect newFrame = self.frame;
#if TARGET_OS_IOS
- CGRect screenSize = [[UIScreen mainScreen] bounds];
+ CGRect screenSize = self.window.bounds;
UIEdgeInsets inset = [[[UIApplication sharedApplication] keyWindow] safeAreaInsets];
UIInterfaceOrientation orientation = [iOS7AppDelegate currentOrientation];
diff --git a/dists/ios7/Info.plist b/dists/ios7/Info.plist
index 6046f9c4b8a..a03661c7d8c 100644
--- a/dists/ios7/Info.plist
+++ b/dists/ios7/Info.plist
@@ -53,7 +53,7 @@
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiresFullScreen</key>
- <true/>
+ <false/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
diff --git a/dists/ios7/Info.plist.in b/dists/ios7/Info.plist.in
index 03fd5c2799d..247e7f0d568 100644
--- a/dists/ios7/Info.plist.in
+++ b/dists/ios7/Info.plist.in
@@ -53,7 +53,7 @@
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiresFullScreen</key>
- <true/>
+ <false/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
Commit: ceb54851c53c65f62a29a030b2c5f168ce3368c0
https://github.com/scummvm/scummvm/commit/ceb54851c53c65f62a29a030b2c5f168ce3368c0
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2024-01-21T10:57:27+01:00
Commit Message:
IOS7: Make specific options if running in macOS
Add a convenience function to check if the application is running
in macOS. Use this method to change the default visibility of on-
screen control buttons and function bar.
Neither of these are needed when running on macOS since both mouse
and keyboard are available. Also the mouse pointer in ScummVM does
not access the on-screen control buttons.
However this requires function keys and key combinations like e.g.
Alt+X to work to be able to save and quit games.
These will be added in future commits.
Changed paths:
backends/platform/ios7/ios7_options.mm
backends/platform/ios7/ios7_osys_main.h
backends/platform/ios7/ios7_osys_video.mm
backends/platform/ios7/ios7_video.h
backends/platform/ios7/ios7_video.mm
diff --git a/backends/platform/ios7/ios7_options.mm b/backends/platform/ios7/ios7_options.mm
index 2cd9c265a54..42c48a86381 100644
--- a/backends/platform/ios7/ios7_options.mm
+++ b/backends/platform/ios7/ios7_options.mm
@@ -521,13 +521,13 @@ void OSystem_iOS7::registerDefaultSettings(const Common::String &target) const {
ConfMan.registerDefault("touch_mode_2d_games", "touchpad");
ConfMan.registerDefault("touch_mode_3d_games", "gamepad");
- ConfMan.registerDefault("keyboard_fn_bar", true);
+ ConfMan.registerDefault("keyboard_fn_bar", isiOSAppOnMac() ? false : true);
#if TARGET_OS_IOS
ConfMan.registerDefault("orientation_menus", "auto");
ConfMan.registerDefault("orientation_games", "auto");
- ConfMan.registerDefault("onscreen_control", true);
+ ConfMan.registerDefault("onscreen_control", isiOSAppOnMac() ? false : true);
#endif
}
diff --git a/backends/platform/ios7/ios7_osys_main.h b/backends/platform/ios7/ios7_osys_main.h
index 70c31b3fa0e..ed0b884f779 100644
--- a/backends/platform/ios7/ios7_osys_main.h
+++ b/backends/platform/ios7/ios7_osys_main.h
@@ -157,6 +157,7 @@ public:
bool isConnectionLimited() override;
void virtualController(bool connect);
+ bool isiOSAppOnMac() const;
virtual Common::Path getDefaultLogFileName() override { return Common::Path("/scummvm.log"); }
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm
index 46282bc6793..9b58074b11e 100644
--- a/backends/platform/ios7/ios7_osys_video.mm
+++ b/backends/platform/ios7/ios7_osys_video.mm
@@ -165,6 +165,14 @@ void OSystem_iOS7::virtualController(bool connect) {
});
}
+bool OSystem_iOS7::isiOSAppOnMac() const {
+ __block bool isiOSAppOnMac = false;
+ execute_on_main_thread(^ {
+ isiOSAppOnMac = [[iOS7AppDelegate iPhoneView] isiOSAppOnMac];
+ });
+ return isiOSAppOnMac;
+}
+
void OSystem_iOS7::setShowKeyboard(bool show) {
if (show) {
#if TARGET_OS_IOS
diff --git a/backends/platform/ios7/ios7_video.h b/backends/platform/ios7/ios7_video.h
index 8b222786b9e..011c75ae0e0 100644
--- a/backends/platform/ios7/ios7_video.h
+++ b/backends/platform/ios7/ios7_video.h
@@ -77,6 +77,7 @@ uint getSizeNextPOT(uint size);
#if TARGET_OS_IOS
- (void)interfaceOrientationChanged:(UIInterfaceOrientation)orientation;
- (void)updateTouchMode;
+- (BOOL)isiOSAppOnMac;
#endif
- (void)showKeyboard;
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 7089a33d563..9b8ece3b782 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -423,6 +423,13 @@ bool iOS7_fetchEvent(InternalEvent *event) {
[_menuButton setEnabled:isEnabled];
[_menuButton setHidden:!isEnabled];
}
+
+- (BOOL)isiOSAppOnMac {
+ if (@available(iOS 14.0, *)) {
+ return [NSProcessInfo processInfo].isiOSAppOnMac;
+ }
+ return NO;
+}
#endif
- (void)dealloc {
More information about the Scummvm-git-logs
mailing list