When run from terminal, it'd spit out `NSDocumentController Info.plist warning: The values of CFBundleTypeRole entries must be 'Editor', 'Viewer', 'None', or 'Shell'.` This silences that warning.
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.
The Apple TV OS requires a different type of storyboard than iOS. Also,
the Info.plist file differ since the tvOS platform doesn't handle
different orientations.
The Apple TV OS also need a different set of icons with different
resolutions more suitable for TV screens.
The application icons are required to be of layered type, which means
that a single PNG file is not accepted as an icon file. The icons must
have at least two layers, hence the ScummVM icon is defined by a back
image with just the background color and a front image with the ScummVM
logo.
The icons are then put together when archiving the application in Xcode
to an Assets.car file. However the linux builds are not building the
application using Xcode. Therefore a pre-compiled Assets.car file
containing the image assets (icons, splash screen etc) is added to the
tvos folder. This file is copied to the application bundle. If the icons
are changed in the future a new Assets.car file has to be compiled. This
can only be done on a computer with Xcode installed. To compile run the
following command in the tvos folder:
xcrun actool ./Images.xcassets --compile build --platform appletvos \
--minimum-deployment-target 9.0 --app-icon AppIcon \
--output-partial-info-plist build/partial.plist \
--launch-image LaunchImage
The partial.plist file generated will show what to add to the Info.plist
and if something must be changed in the ports.mk section for the
tvosbundle.