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.
Cherry-pick of: 2eb03dbc04
When building the iOS port of ScummVM using configure instead of
Xcode, the on-screen icons were not copied to the generated bundle.
Assets not being application icons or launch images are compiled to
an Assets.car file by Xcode and put in the root directory of the
application bundle.
Generate a Assets.car containg the on-screen icons by running the
following command in the dists/ios7 directory:
xcrun actool ./Images.xcassets --compile build --platform iphoneos \
--minimum-deployment-target 7.0 --app-icon AppIcon \
--output-partial-info-plist partial.plist \
--launch-image LaunchImage
The Assets.car seems to be a proprietary Apple’s archive that first
appeared in iOS 7.
This commit adds a compiled Assets.car contating the assets to the
ios7 dists, just as in the tvos dist. The Assets.car file is then
copied to the root directory of the app bundle in the ports.mk file
when running "make ios7bundle"
The Android backend have two on-screen controls. One for configuring
the touch mode setting and one for accessing the main menu.
The on-screen controls are presented as two clickable buttons.
The image of the touch mode setting changes depending on which mode
that is configured.
Add the same images as assets to the iOS port. Unfortunately it's
not possible to share the same resource files becuase the assets
in Android are of type Android vector drawable.
iOS can handle vector based images, but only in form as a PDF.
There's a lot to read about this format but luckily there are free
converter tools between the formats.
Add converted versions to the iOS7 port.
Every time ScummVM iOS application is submitted to TestFlight or the
App Store, App Store Connect asks a question about the application's
export compliance. To not have to answer that question on every
upload, set the property ITSAppUsesNonExemptEncryption in Info.plist
to NO.
ScummVM uses third-party libraries that utilizes encryption, however
these are configured to use standard encryption algorithms or crypto
functionality within Apple’s operating system, thus fulfilling the
export compliance.
Apple requires a 1024x1024 icon with no transparency as an AppStore
icon.
When updating the icon set Xcode automatically changed the json file
structure to have the file names on top of each record.
Add support for Extended Gamepad controllers. What defines extended
gamepad controllers can be found here:
https://developer.apple.com/documentation/gamecontroller/gcextendedgamepad
Support has been added for controlling the pointer position using the
left thumbstick, left clicks using the A-button and right clicks using
the B-button. Also the Main menu can be accessed using the Home/Menu
button.
The thumbstick values are received when changed, however if holding the
thumbstick in the same position the valueChangedHandler will not be
called. Therefore store the X- and Y-axis values and begin to poll
readings of the stored values for as long as the thumbstick is out of
the center position.
Move touch inputs to a TouchController class to move some logic from the
iPhoneView class. Only do this for touches on screen since connected
trackpads can generate touches as well. The latter ones are of type
UITouchTypeIndirectPointer while touches on screen are of type
UITouchTypeDirect. They are separated thanks to the preference key
UIApplicationSupportsIndirectInputEvents set to YES in Info.plist.
Without the preference above, there is no way to distinguish touches
from screen from a trackpad.
Add the GameController framework to the project and enable support for
controller user interaction in the Info.plist file. This allows for
Game Controller compatible devices to notify the application when
connected.
Add GameController framework to configure and ports.mk if not using
Xcode to build the target.
This partially revert commit 0ff00cca2a and should hopefully
fix bug #12647.
The issue is that the executable name in the Info.plist did not
match the name of the executable generated by Xcode (ScummVM vs
scummvm). I changed it back to $(EXECUTABLE_NAME), which is
automatically replaced by Xcode, and added a sed command to the
make target to replace it with the actual executable name (as
we did with the $(PRODUCT_BUNDLE_IDENTIFIER) already).
An alternative would be to hardcode the name to "scummvm" in the
Info.plist and change the iphonebundle and ios7bundle target to
also use all lower case scummvm when copying the executable.
iOS 12 drops support for libstdc++, so the project needs to be compiled explicitly using libc++.
Support the "safe area" when redrawing the view to leave space for the notch in portrait and
landscape orientations.