Browse Source

[ios] Enable high resolution support

pull/3693/head
Anders Jenbo 4 years ago
parent
commit
d9d72fbbc7
  1. 6
      CMakeLists.txt
  2. 6
      Packaging/apple/Info.plist
  3. 27
      Packaging/apple/LaunchScreen.storyboard
  4. 2
      Source/utils/display.cpp

6
CMakeLists.txt

@ -670,7 +670,8 @@ else()
Source/main.cpp Source/main.cpp
Packaging/windows/devilutionx.exe.manifest Packaging/windows/devilutionx.exe.manifest
Packaging/windows/devilutionx.rc Packaging/windows/devilutionx.rc
Packaging/apple/AppIcon.icns) Packaging/apple/AppIcon.icns
Packaging/apple/LaunchScreen.storyboard)
endif() endif()
target_link_libraries(${BIN_TARGET} PRIVATE libdevilutionx) target_link_libraries(${BIN_TARGET} PRIVATE libdevilutionx)
@ -1168,12 +1169,13 @@ if(APPLE)
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}) set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
set(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${PROJECT_VERSION}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${PROJECT_VERSION}")
if(IOS) if(IOS)
set_target_properties(${BIN_TARGET} PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2")
set(CMAKE_OSX_DEPLOYMENT_TARGET "9.0") set(CMAKE_OSX_DEPLOYMENT_TARGET "9.0")
else() else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12.0") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12.0")
endif() endif()
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns") set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_ICON_FILE "AppIcon.icns")
set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/macOS/Info.plist") set_target_properties(${BIN_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Packaging/apple/Info.plist")
install (TARGETS ${BIN_TARGET} DESTINATION ./) install (TARGETS ${BIN_TARGET} DESTINATION ./)

6
Packaging/apple/Info.plist

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
@ -28,6 +28,10 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>CSResourcesFileMapped</key> <key>CSResourcesFileMapped</key>
<true/> <true/>
<key>LSRequiresCarbon</key> <key>LSRequiresCarbon</key>

27
Packaging/apple/LaunchScreen.storyboard

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="s0d-6b-0kx">
<objects>
<viewController id="Y6W-OH-hqX" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="eJ7-NN-0U7"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="19.419642857142858" y="44.927536231884062"/>
</scene>
</scenes>
</document>

2
Source/utils/display.cpp

@ -205,7 +205,7 @@ bool SpawnWindow(const char *lpWindowName)
SDL_WM_GrabInput(SDL_GRAB_ON); SDL_WM_GrabInput(SDL_GRAB_ON);
atexit(SDL_VideoQuit); // Without this video mode is not restored after fullscreen. atexit(SDL_VideoQuit); // Without this video mode is not restored after fullscreen.
#else #else
int flags = 0; int flags = SDL_WINDOW_ALLOW_HIGHDPI;
if (*sgOptions.Graphics.upscale) { if (*sgOptions.Graphics.upscale) {
if (!gbForceWindowed && *sgOptions.Graphics.fullscreen) { if (!gbForceWindowed && *sgOptions.Graphics.fullscreen) {
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;

Loading…
Cancel
Save