From 27f9bd0919cfee0347f9314c91e1a8a121fd7307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 7 May 2024 21:48:56 +0200 Subject: [PATCH] Create a .xcassets folder for the icons, link it properly --- CMakeLists.txt | 16 +++++++++---- ios/PPSSPP-AppStore.plist | 17 ++++++++------ ios/PPSSPP-AppStoreGold.plist | 22 ++++++++---------- ios/PPSSPPUIApplication.mm | 6 +++++ .../AppIcon.appiconset/Contents.json | 14 +++++++++++ .../icon_backfill_1024.png | Bin .../AppIconGold.appiconset/Contents.json | 14 +++++++++++ .../icon_gold_backfill_1024.png | Bin ios/assets.xcassets/Contents.json | 6 +++++ 9 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 ios/assets.xcassets/AppIcon.appiconset/Contents.json rename ios/{assets => assets.xcassets/AppIcon.appiconset}/icon_backfill_1024.png (100%) create mode 100644 ios/assets.xcassets/AppIconGold.appiconset/Contents.json rename ios/{assets => assets.xcassets/AppIconGold.appiconset}/icon_gold_backfill_1024.png (100%) create mode 100644 ios/assets.xcassets/Contents.json diff --git a/CMakeLists.txt b/CMakeLists.txt index ec77892678..b8480b1de8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2782,7 +2782,12 @@ if(TargetBin) endif() if(IOS) - add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard") + set(AssetCatalog "") + if(IOS_APP_STORE) + message("Adding asset catalog to build") + set(AssetCatalog "${CMAKE_SOURCE_DIR}/ios/assets.xcassets") + endif() + add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${AssetCatalog} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard") if(NOT IOS_APP_STORE) file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/iOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPP.app/Frameworks/") endif() @@ -2831,8 +2836,8 @@ if(IOS AND NOT LIBRETRO) if(IOS_DEBUG) file(INSTALL pspautotests DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/assets) endif() - set(RSRC_XIB_FILES assets/Icon@2x.png) - set(RSRC_XIB_FILES "Launch Screen.storyboard") + set(RSRC_XIB_FILES assets/Icon@2x.png "Launch Screen.storyboard" ${CMAKE_CURRENT_SOURCE_DIR}/ios/assets.xcassets) + set_source_files_properties(${RSRC_XIB_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) @@ -2849,12 +2854,12 @@ if(IOS AND NOT LIBRETRO) if(GOLD) set(BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/ios/PPSSPP-AppStoreGold.plist") set(BUNDLE_IDENTIFIER "org.ppsspp.ppsspp-gold") - set(ICON_NAME "IconGold") + set(ICON_NAME "AppIconGold") set(PRODUCT_NAME "PPSSPP") else() set(BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/ios/PPSSPP-AppStore.plist") set(BUNDLE_IDENTIFIER "org.ppsspp.ppsspp-free") - set(ICON_NAME "Icon") + set(ICON_NAME "AppIcon") set(PRODUCT_NAME "PPSSPP") endif() message(STATUS "DevTeam: ${DEVELOPMENT_TEAM_ID} Icon: ${ICON_NAME} Target: ${TargetBin}") @@ -2875,6 +2880,7 @@ if(IOS AND NOT LIBRETRO) XCODE_GENERATE_SCHEME YES # Avoid the scheme bloat in XCode by only setting it to YES for this target. RESOURCE "ios/Launch Screen.storyboard" RESOURCE "ios/Settings.bundle" + RESOURCE "ios/assets.xcassets" RESOURCE "ext/vulkan/iOS/Frameworks" XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${BUNDLE_IDENTIFIER} XCODE_ATTRIBUTE_PRODUCT_NAME ${PRODUCT_NAME} diff --git a/ios/PPSSPP-AppStore.plist b/ios/PPSSPP-AppStore.plist index 4dace2bd9f..0c089fc93a 100644 --- a/ios/PPSSPP-AppStore.plist +++ b/ios/PPSSPP-AppStore.plist @@ -28,6 +28,16 @@ ???? CFBundleVersion 1.0 + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + assets + + + LSRequiresIPhoneOS UIViewControllerBasedStatusBarAppearance @@ -50,13 +60,6 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CFBundleIconFiles - - assets/Icon-72.png - assets/Icon-72@2x.png - assets/Icon.png - assets/Icon@2x.png - UILaunchImageFile Default.png UIFileSharingEnabled diff --git a/ios/PPSSPP-AppStoreGold.plist b/ios/PPSSPP-AppStoreGold.plist index 8d28cf3abf..b958f5eba6 100644 --- a/ios/PPSSPP-AppStoreGold.plist +++ b/ios/PPSSPP-AppStoreGold.plist @@ -28,6 +28,16 @@ ???? CFBundleVersion 1.0 + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + assets + + + LSRequiresIPhoneOS UIViewControllerBasedStatusBarAppearance @@ -50,22 +60,10 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CFBundleIconFiles - - assets/IconGold-72.png - assets/IconGold-72@2x.png - assets/IconGold.png - assets/IconGold@2x.png - UILaunchImageFile Default.png UIFileSharingEnabled - UIDeviceFamily - - 1 - 2 - UILaunchStoryboardName Launch Screen CFBundleDocumentTypes diff --git a/ios/PPSSPPUIApplication.mm b/ios/PPSSPPUIApplication.mm index 1a25db20e1..b5df31df32 100644 --- a/ios/PPSSPPUIApplication.mm +++ b/ios/PPSSPPUIApplication.mm @@ -35,6 +35,8 @@ #include #include +// This stuff reads directly from _gsEvent which is not allowed on the App Store. + #ifndef IS_IOS7 #define IS_IOS7 ([[UIDevice currentDevice].systemVersion floatValue]>=7.0) #endif @@ -63,6 +65,8 @@ @implementation PPSSPPUIApplication +#if !PPSSPP_PLATFORM(IOS_APP_STORE) + - (void)decodeKeyEvent:(NSInteger *)eventMem { NSInteger eventType = eventMem[GSEVENT_TYPE]; NSInteger eventScanCode = eventMem[GSEVENTKEY_KEYCODE]; @@ -108,4 +112,6 @@ } } +#endif // IOS_APP_STORE + @end diff --git a/ios/assets.xcassets/AppIcon.appiconset/Contents.json b/ios/assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..d4884cbc70 --- /dev/null +++ b/ios/assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "icon_backfill_1024.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/assets/icon_backfill_1024.png b/ios/assets.xcassets/AppIcon.appiconset/icon_backfill_1024.png similarity index 100% rename from ios/assets/icon_backfill_1024.png rename to ios/assets.xcassets/AppIcon.appiconset/icon_backfill_1024.png diff --git a/ios/assets.xcassets/AppIconGold.appiconset/Contents.json b/ios/assets.xcassets/AppIconGold.appiconset/Contents.json new file mode 100644 index 0000000000..bfce343b0b --- /dev/null +++ b/ios/assets.xcassets/AppIconGold.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "icon_gold_backfill_1024.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/assets/icon_gold_backfill_1024.png b/ios/assets.xcassets/AppIconGold.appiconset/icon_gold_backfill_1024.png similarity index 100% rename from ios/assets/icon_gold_backfill_1024.png rename to ios/assets.xcassets/AppIconGold.appiconset/icon_gold_backfill_1024.png diff --git a/ios/assets.xcassets/Contents.json b/ios/assets.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/ios/assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +}