diff --git a/.gitmodules b/.gitmodules index 405b658..c6a7f8d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "Submodules/vcpkg"] path = Submodules/vcpkg url = https://github.com/microsoft/vcpkg.git +[submodule "Submodules/SDL"] + path = Submodules/SDL + url = https://github.com/XITRIX/SDL.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e3fc4c2..1adff3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,22 @@ add_executable(${PROJECT_NAME} app/main.cpp ) -target_link_libraries(${PROJECT_NAME} PUBLIC +target_link_libraries(${PROJECT_NAME} PRIVATE UIKit ) -setup_project() \ No newline at end of file +setup_project() + +#list(APPEND google_angle_libs +# ${EXTERN_PATH}/angle/mac/libEGL.dylib +# ${EXTERN_PATH}/angle/mac/libGLESv2.dylib +#) +# +#set_property( +# SOURCE ${google_angle_libs} +# PROPERTY MACOSX_PACKAGE_LOCATION "Frameworks" +#) +# +#target_sources(${PROJECT_NAME} PRIVATE +# ${google_angle_libs} +#) \ No newline at end of file diff --git a/Submodules/SDL b/Submodules/SDL new file mode 160000 index 0000000..d98f18f --- /dev/null +++ b/Submodules/SDL @@ -0,0 +1 @@ +Subproject commit d98f18f7fdba8de3e4de458034e0c28c63899dcb diff --git a/Submodules/UIKit/CMakeLists.txt b/Submodules/UIKit/CMakeLists.txt index 6eaae28..b839820 100644 --- a/Submodules/UIKit/CMakeLists.txt +++ b/Submodules/UIKit/CMakeLists.txt @@ -12,31 +12,23 @@ if (APPLE) # MAC if (PLATFORM_DESKTOP) - list(APPEND google_angle_libs - ${EXTERN_PATH}/angle/mac/libEGL.dylib - ${EXTERN_PATH}/angle/mac/libGLESv2.dylib - ) + find_library(SDL2 NAMES SDL2-static SDL2main) list(APPEND platform_libs - ${google_angle_libs} + SDL2-static SDL2main ${EXTERN_PATH}/skia/out/mac-arm64-angle/libskia.a ${EXTERN_PATH}/skia/out/mac-arm64-angle/libwindow.a ) # IOS elseif (PLATFORM_IOS) - list(APPEND FRAMEWORKS ${EXTERN_PATH}/angle/ios/MetalANGLE.framework) + find_library(SDL2 NAMES SDL2-static SDL2main) list(APPEND platform_libs - ${google_angle_libs} + SDL2-static SDL2main ${EXTERN_PATH}/skia/out/ios-arm64-angle/libskia.a ${EXTERN_PATH}/skia/out/ios-arm64-angle/libwindow.a ) endif () - - set_property( - SOURCE ${google_angle_libs} - PROPERTY MACOSX_PACKAGE_LOCATION "Frameworks" - ) endif () add_library(UIKit @@ -45,18 +37,18 @@ add_library(UIKit ) target_include_directories(UIKit PUBLIC + ${EXTERN_PATH}/SDL/include ${EXTERN_PATH}/skia include lib ) -find_package(SDL2 REQUIRED) -target_link_libraries(UIKit PUBLIC - ${platform_libs} - SDL2::SDL2 -) +if (PLATFORM_IOS) + target_include_directories(SDL2-static PRIVATE ${EXTERN_PATH}/angle/ios/MetalANGLE.framework/Headers) +endif () if (APPLE) - set_target_properties(${PROJECT_NAME} PROPERTIES - XCODE_EMBED_FRAMEWORKS "${FRAMEWORKS}") -endif () \ No newline at end of file + list(APPEND platform_libs "-framework Foundation" "-framework VideoToolbox" "-framework AVKit" "-framework MetalKit") +endif () + +target_link_libraries(UIKit PRIVATE ${platform_libs}) \ No newline at end of file diff --git a/Submodules/UIKit/include/platforms/SkiaInit.h b/Submodules/UIKit/include/platforms/SkiaInit.h index 081ef45..0f4b16c 100644 --- a/Submodules/UIKit/include/platforms/SkiaInit.h +++ b/Submodules/UIKit/include/platforms/SkiaInit.h @@ -5,4 +5,4 @@ std::unique_ptr skiaMakeWindow(SDL_Window* window); -bool platformRunLoop(const std::function& runLoop); \ No newline at end of file +bool platformRunLoop(const std::function& runLoop); diff --git a/Submodules/UIKit/lib/Application.cpp b/Submodules/UIKit/lib/Application.cpp index 851063a..a520b61 100644 --- a/Submodules/UIKit/lib/Application.cpp +++ b/Submodules/UIKit/lib/Application.cpp @@ -1,6 +1,6 @@ #include "Application.h" -#include +#include #include #include diff --git a/Submodules/UIKit/lib/platforms/apple/SkiaInit.mm b/Submodules/UIKit/lib/platforms/apple/SkiaInit.mm index b57bd32..58f0ac1 100644 --- a/Submodules/UIKit/lib/platforms/apple/SkiaInit.mm +++ b/Submodules/UIKit/lib/platforms/apple/SkiaInit.mm @@ -17,6 +17,19 @@ #endif #ifdef PLATFORM_IOS +#include "tools/window/ios/WindowContextFactory_ios.h" +#import "UIKit/UIKit.h" + +std::unique_ptr skiaMakeWindow(SDL_Window* window) { + auto metalView = SDL_Metal_CreateView(window); + + auto appWindow = UIApplication.sharedApplication.keyWindow; + skwindow::IOSWindowInfo info{}; + info.fWindow = appWindow; + info.fViewController = appWindow.rootViewController; + return skwindow::MakeMetalForIOS(info, std::make_unique()); +} + #endif bool platformRunLoop(const std::function& runLoop) { diff --git a/Submodules/cmake/toolchain.cmake b/Submodules/cmake/toolchain.cmake index e9c92c5..5361d7d 100644 --- a/Submodules/cmake/toolchain.cmake +++ b/Submodules/cmake/toolchain.cmake @@ -1,8 +1,5 @@ message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}") -# Setup Sunmodules directory -set(CMAKE_TOOLCHAIN_FILE ${EXTERN_PATH}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE PATH "vcpkg toolchain file") - # Include Submodules function(check_libromfs_generator) if (NOT DEFINED LIBROMFS_PREBUILT_GENERATOR OR NOT EXISTS "${LIBROMFS_PREBUILT_GENERATOR}") @@ -22,18 +19,62 @@ function(add_libromfs app res) set(LIBROMFS_RESOURCE_LOCATION "${res}" PARENT_SCOPE) endfunction() +function(ios_bundle iosStoryBoard assets plist) + set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "The code sign identity to use when building the IPA.") + set(IOS_GUI_IDENTIFIER "" CACHE STRING "The package name") + if(IOS_CODE_SIGN_IDENTITY STREQUAL "") + set(IOS_CODE_SIGNING_ENABLED NO) + else() + set(IOS_CODE_SIGNING_ENABLED YES) + endif() + if (IOS_GUI_IDENTIFIER STREQUAL "") + set(IOS_GUI_IDENTIFIER "${PACKAGE_NAME}") + message(WARNING "Using default package name: ${PACKAGE_NAME}") + endif () + + set(IOS_SPLASH_STORYBOARD "${iosStoryBoard}") + + set(IOS_ASSETS ${assets}) + set_target_properties(${PROJECT_NAME} PROPERTIES + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${IOS_CODE_SIGN_IDENTITY}" + XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED YES + XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "${IOS_CODE_SIGNING_ENABLED}" + BUNDLE TRUE + MACOSX_BUNDLE_INFO_PLIST ${plist} + XCODE_ATTRIBUTE_ENABLE_BITCODE NO + XCODE_ATTRIBUTE_SKIP_INSTALL NO + ) + set_property( + SOURCE ${IOS_ASSETS} + PROPERTY MACOSX_PACKAGE_LOCATION "Resources" + ) + set_property( + SOURCE ${IOS_SPLASH_STORYBOARD} + PROPERTY MACOSX_PACKAGE_LOCATION "Resources" + ) + target_sources(${PROJECT_NAME} PRIVATE + ${IOS_ASSETS} + ${IOS_SPLASH_STORYBOARD} + ) +endfunction() + # Platform specific configs if (PLATFORM_DESKTOP) message("Building for Desktop") add_definitions( -DPLATFORM_DESKTOP ) if (APPLE) + set(PLATFORM_MAC ON) add_definitions( -DPLATFORM_MAC ) endif () + + set(CMAKE_TOOLCHAIN_FILE ${EXTERN_PATH}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE PATH "vcpkg toolchain file") elseif (PLATFORM_IOS) message("Building for iOS") add_definitions( -DPLATFORM_IOS ) + set(BUILD_SHARED_LIBS OFF) set(PLATFORM OS64) + set(CMAKE_TOOLCHAIN_FILE ${EXTERN_PATH}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE PATH "vcpkg toolchain file") set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${EXTERN_PATH}/cmake/ios.toolchain.cmake CACHE PATH "ios toolchain file") set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") # iphone, ipad endif () @@ -42,14 +83,9 @@ endif () check_libromfs_generator() function(setup_project) - # Include Submodules - add_subdirectory(${EXTERN_PATH}) - add_subdirectory(${EXTERN_PATH}/UIKit) - - add_libromfs(${PROJECT_NAME} ${PROJECT_RESOURCES}) - add_subdirectory(${EXTERN_PATH}/libromfs EXCLUDE_FROM_ALL) - if (APPLE) + add_subdirectory(${EXTERN_PATH}/SDL) + set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME} @@ -65,11 +101,59 @@ function(setup_project) XCODE_ATTRIBUTE_INSTALL_PATH $(LOCAL_APPS_DIR) XCODE_EMBED_RESOURCES_CODE_SIGN_ON_COPY ON # Not work XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON # Not work - XCODE_EMBED_FRAMEWORKS "${IOS_FRAMEWORKS}" + XCODE_EMBED_FRAMEWORKS "${FRAMEWORKS}" INSTALL_RPATH "@executable_path/../Frameworks" XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks" ) + endif () + + if (PLATFORM_MAC) + list(APPEND google_angle_libs + ${EXTERN_PATH}/angle/mac/libEGL.dylib + ${EXTERN_PATH}/angle/mac/libGLESv2.dylib + ) - target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Foundation" "-framework VideoToolbox" "-framework AVKit" "-framework MetalKit") + list(APPEND platform_libs + ${google_angle_libs} + ) + + set_property( + SOURCE ${google_angle_libs} + PROPERTY MACOSX_PACKAGE_LOCATION "Frameworks" + ) + + target_sources(${PROJECT_NAME} PRIVATE + ${google_angle_libs} + ) + elseif (PLATFORM_IOS) + ios_bundle("${CMAKE_CURRENT_SOURCE_DIR}/app/platforms/ios/iphoneos/Splash.storyboard" + "${CMAKE_CURRENT_SOURCE_DIR}/app/platforms/ios/Images.xcassets" + "${CMAKE_CURRENT_SOURCE_DIR}/app/platforms/ios/iOSBundleInfo.plist.in") + + set_target_properties(${PROJECT_NAME} PROPERTIES + INSTALL_RPATH @executable_path/Frameworks + XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON + MACOSX_BUNDLE_COPYRIGHT "Copyright 2024 ${PROJECT_AUTHOR}" + XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION "${VERSION_BUILD}" + XCODE_ATTRIBUTE_INFOPLIST_KEY_GCSupportsGameMode YES + XCODE_ATTRIBUTE_INFOPLIST_KEY_GCSupportsControllerUserInteraction YES + XCODE_ATTRIBUTE_INFOPLIST_KEY_GCRequiresControllerUserInteraction YES + XCODE_ATTRIBUTE_INFOPLIST_KEY_LSApplicationCategoryType "public.app-category.games" + XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" + XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS "${EXTERN_PATH}/angle/ios/" + XCODE_ATTRIBUTE_INSTALL_PATH $(LOCAL_APPS_DIR)) + + set_target_properties(${PROJECT_NAME} PROPERTIES + XCODE_EMBED_FRAMEWORKS ${EXTERN_PATH}/angle/ios/MetalANGLE.framework + ) endif () + + # Include Submodules + add_subdirectory(${EXTERN_PATH}) + add_subdirectory(${EXTERN_PATH}/UIKit) + + add_libromfs(${PROJECT_NAME} ${PROJECT_RESOURCES}) + add_subdirectory(${EXTERN_PATH}/libromfs EXCLUDE_FROM_ALL) + +# target_link_libraries(${PROJECT_NAME} fmt tweeny yogacore ${PLATFORM_LIBS}) endfunction() \ No newline at end of file diff --git a/app/platforms/ios/Images.xcassets/AppIcon.appiconset/Contents.json b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..021f7c8 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,28 @@ +{ + "images" : [ + { + "filename" : "moonlight 1.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "filename" : "moonlight 2.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024", + "unassigned" : true + }, + { + "filename" : "moonlight.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024", + "unassigned" : true + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight 1.png b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight 1.png new file mode 100644 index 0000000..c3b0314 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight 1.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight 2.png b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight 2.png new file mode 100644 index 0000000..5aa2a18 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight 2.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight.png b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight.png new file mode 100644 index 0000000..c3b0314 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIcon.appiconset/moonlight.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..c1802be --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "Frame 5@3x.png", + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Frame 5@3x.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Frame 5@3x.png new file mode 100644 index 0000000..9fb106d Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Frame 5@3x.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..c1802be --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "Frame 5@3x.png", + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Frame 5@3x.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Frame 5@3x.png new file mode 100644 index 0000000..cd23240 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Frame 5@3x.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..c1802be --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "Frame 5@3x.png", + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5@3x.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5@3x.png new file mode 100644 index 0000000..7ec6fe6 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5@3x.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..362717d --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "Frame 5.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "Frame 5@2x.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Frame 5.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Frame 5.png new file mode 100644 index 0000000..6a823aa Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Frame 5.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Frame 5@2x.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Frame 5@2x.png new file mode 100644 index 0000000..a41b8f5 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Frame 5@2x.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..362717d --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "Frame 5.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "Frame 5@2x.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Frame 5.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Frame 5.png new file mode 100644 index 0000000..1357b58 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Frame 5.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Frame 5@2x.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Frame 5@2x.png new file mode 100644 index 0000000..ab6d631 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Frame 5@2x.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..362717d --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "Frame 5.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "Frame 5@2x.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5.png new file mode 100644 index 0000000..b07d440 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5@2x.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5@2x.png new file mode 100644 index 0000000..371c7d6 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Frame 5@2x.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Contents.json new file mode 100644 index 0000000..f47ba43 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "filename" : "App Icon - App Store.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "1280x768" + }, + { + "filename" : "App Icon.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "400x240" + }, + { + "filename" : "Top Shelf Image Wide.imageset", + "idiom" : "tv", + "role" : "top-shelf-image-wide", + "size" : "2320x720" + }, + { + "filename" : "Top Shelf Image.imageset", + "idiom" : "tv", + "role" : "top-shelf-image", + "size" : "1920x720" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 0000000..005a823 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "topshelf-wide@1.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "topshelf-wide@2.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/topshelf-wide@1.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/topshelf-wide@1.png new file mode 100644 index 0000000..a14ef59 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/topshelf-wide@1.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/topshelf-wide@2.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/topshelf-wide@2.png new file mode 100644 index 0000000..5e532f4 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image Wide.imageset/topshelf-wide@2.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/Contents.json b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 0000000..4bce57e --- /dev/null +++ b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "filename" : "topshelf@1.png", + "idiom" : "tv", + "scale" : "1x" + }, + { + "filename" : "topshelf@2.png", + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/topshelf@1.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/topshelf@1.png new file mode 100644 index 0000000..99646a7 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/topshelf@1.png differ diff --git a/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/topshelf@2.png b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/topshelf@2.png new file mode 100644 index 0000000..830a274 Binary files /dev/null and b/app/platforms/ios/Images.xcassets/AppIconTvOS.brandassets/Top Shelf Image.imageset/topshelf@2.png differ diff --git a/app/platforms/ios/Images.xcassets/Contents.json b/app/platforms/ios/Images.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/ios/Images.xcassets/Logo.imageset/Contents.json b/app/platforms/ios/Images.xcassets/Logo.imageset/Contents.json new file mode 100644 index 0000000..1529886 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/Logo.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "moonlight_96.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/app/platforms/ios/Images.xcassets/Logo.imageset/moonlight_96.svg b/app/platforms/ios/Images.xcassets/Logo.imageset/moonlight_96.svg new file mode 100644 index 0000000..f89ef24 --- /dev/null +++ b/app/platforms/ios/Images.xcassets/Logo.imageset/moonlight_96.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/platforms/ios/apple_display.mm b/app/platforms/ios/apple_display.mm new file mode 100644 index 0000000..f882261 --- /dev/null +++ b/app/platforms/ios/apple_display.mm @@ -0,0 +1,41 @@ +#ifdef PLATFORM_TVOS + +#import +#import +#import +#import +#include "Limelight.h" +#include "Settings.hpp" + +@interface AVDisplayCriteria() +@property(readonly) int videoDynamicRange; +@property(readonly, nonatomic) float refreshRate; +- (id)initWithRefreshRate:(float)arg1 videoDynamicRange:(int)arg2; +@end + +void updatePreferredDisplayMode(bool streamActive) { + UIWindow* window = [[[UIApplication sharedApplication] delegate] window]; + AVDisplayManager* displayManager = [window avDisplayManager]; + + // This logic comes from Kodi and MrMC + if (streamActive) { + int dynamicRange; + + if (LiGetCurrentHostDisplayHdrMode()) { + dynamicRange = 2; // HDR10 + } + else { + dynamicRange = 0; // SDR + } + + AVDisplayCriteria* displayCriteria = [[AVDisplayCriteria alloc] initWithRefreshRate:Settings::instance().fps() + videoDynamicRange:dynamicRange]; + displayManager.preferredDisplayCriteria = displayCriteria; + } + else { + // Switch back to the default display mode + displayManager.preferredDisplayCriteria = nil; + } +} + +#endif diff --git a/app/platforms/ios/apple_mdns.mm b/app/platforms/ios/apple_mdns.mm new file mode 100644 index 0000000..af85da6 --- /dev/null +++ b/app/platforms/ios/apple_mdns.mm @@ -0,0 +1,313 @@ +#include +#import +#include +#include + +std::vector foundHosts; +std::function _callback; + +@interface MDNSManager : NSObject + +- (id) init; +- (void) searchForHosts; +- (void) stopSearching; +- (void) forgetHosts; + +@end + +@implementation MDNSManager { + NSNetServiceBrowser* mDNSBrowser; + NSMutableArray* services; + BOOL scanActive; + BOOL timerPending; +} + +static NSString* NV_SERVICE_TYPE = @"_nvstream._tcp"; + +- (id) init { + self = [super init]; + + scanActive = FALSE; + + mDNSBrowser = [[NSNetServiceBrowser alloc] init]; + [mDNSBrowser setDelegate:self]; + + services = [[NSMutableArray alloc] init]; + + return self; +} + +- (void) searchForHosts { + if (scanActive) { + return; + } + + brls::Logger::info("Starting mDNS discovery"); + scanActive = TRUE; + + if (!timerPending) { + timerPending = TRUE; + + // Just invoke the timer callback to save a little code + [self startSearchTimerCallback:nil]; + } +} + +- (void) stopSearching { + if (!scanActive) { + return; + } + + brls::Logger::info("Stopping mDNS discovery"); + scanActive = FALSE; + [mDNSBrowser stop]; +} + +- (void) forgetHosts { + [services removeAllObjects]; +} + ++ (NSString*)sockAddrToString:(NSData*)addrData { + char addrStr[INET6_ADDRSTRLEN]; + struct sockaddr* addr = (struct sockaddr*)[addrData bytes]; + if (addr->sa_family == AF_INET) { + inet_ntop(addr->sa_family, &((struct sockaddr_in*)addr)->sin_addr, addrStr, sizeof(addrStr)); + unsigned short port = ntohs(((struct sockaddr_in*)addr)->sin_port); + return [NSString stringWithFormat: @"%s:%u", addrStr, port]; + } + else { + struct sockaddr_in6* sin6 = (struct sockaddr_in6*)addr; + inet_ntop(addr->sa_family, &sin6->sin6_addr, addrStr, sizeof(addrStr)); + unsigned short port = ntohs(((struct sockaddr_in6*)addr)->sin6_port); + if (sin6->sin6_scope_id != 0) { + // Link-local addresses with scope IDs are special + return [NSString stringWithFormat: @"[%s%%%u]:%u", addrStr, sin6->sin6_scope_id, port]; + } + else { + return [NSString stringWithFormat: @"[%s]:%u", addrStr, port]; + } + } +} + ++ (BOOL)isAddress:(uint8_t*)address inSubnet:(uint8_t*)subnet netmask:(int)bits { + for (int i = 0; i < bits; i++) { + uint8_t mask = 1 << (i % 8); + if ((address[i / 8] & mask) != (subnet[i / 8] & mask)) { + return NO; + } + } + return YES; +} + ++ (BOOL)isLocalIpv6Address:(NSData*)addrData { + struct sockaddr_in6* sin6 = (struct sockaddr_in6*)[addrData bytes]; + if (sin6->sin6_family != AF_INET6) { + return NO; + } + + uint8_t* addrBytes = sin6->sin6_addr.s6_addr; + uint8_t prefix[2]; + + // fe80::/10 + prefix[0] = 0xfe; + prefix[1] = 0x80; + if ([MDNSManager isAddress:addrBytes inSubnet:prefix netmask:10]) { + // Link-local + return YES; + } + + // fec0::/10 + prefix[0] = 0xfe; + prefix[1] = 0xc0; + if ([MDNSManager isAddress:addrBytes inSubnet:prefix netmask:10]) { + // Site local + return YES; + } + + // fc00::/7 + prefix[0] = 0xfc; + prefix[1] = 0x00; + if ([MDNSManager isAddress:addrBytes inSubnet:prefix netmask:7]) { + // ULA + return YES; + } + + return NO; +} + ++ (NSString*)getBestIpv6Address:(NSArray*)addresses { + for (NSData* addrData in addresses) { + struct sockaddr_in6* sin6 = (struct sockaddr_in6*)[addrData bytes]; + if (sin6->sin6_family != AF_INET6) { + continue; + } + + if ([MDNSManager isLocalIpv6Address:addrData]) { + // Skip non-global addresses + continue; + } + + uint8_t* addrBytes = sin6->sin6_addr.s6_addr; + uint8_t prefix[2]; + + // 2002::/16 + prefix[0] = 0x20; + prefix[1] = 0x02; + if ([MDNSManager isAddress:addrBytes inSubnet:prefix netmask:16]) { +// brls::Logger::info("Ignoring 6to4 address: {}", [MDNSManager sockAddrToString:addrData]); + continue; + } + + // 2001::/32 + prefix[0] = 0x20; + prefix[1] = 0x01; + if ([MDNSManager isAddress:addrBytes inSubnet:prefix netmask:32]) { +// brls::Logger::info("Ignoring Teredo address: {}", [MDNSManager sockAddrToString:addrData]); + continue; + } + + return [MDNSManager sockAddrToString:addrData]; + } + + return nil; +} + +- (void)netServiceDidResolveAddress:(NSNetService *)service { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + NSArray* addresses = [service addresses]; + + for (NSData* addrData in addresses) { +// brls::Logger::info("Resolved address: {} -> {}", [service hostName], [MDNSManager sockAddrToString: addrData]); + } + + Host host; + NSString* hostAddress; + + // First, look for an IPv4 record for the local address + for (NSData* addrData in addresses) { + struct sockaddr_in* sin = (struct sockaddr_in*)[addrData bytes]; + if (sin->sin_family != AF_INET) { + continue; + } + + hostAddress = [MDNSManager sockAddrToString:addrData]; +// brls::Logger::info("Local address chosen: {} -> {}", [service hostName], host.localAddress); + break; + } + + if (hostAddress == nil) { + // If we didn't find an IPv4 record, look for a local IPv6 record + for (NSData* addrData in addresses) { + if ([MDNSManager isLocalIpv6Address:addrData]) { + hostAddress = [MDNSManager sockAddrToString:addrData]; +// brls::Logger::info("Local address chosen: {} -> {}", [service hostName], host.localAddress); + break; + } + } + } + + if (hostAddress == nil) return; + auto hostName = [service.hostName stringByReplacingOccurrencesOfString:@".local." withString:@""]; + + host.address = std::string([hostAddress UTF8String]); + host.hostname = std::string([hostName UTF8String]); + foundHosts.push_back(host); + + _callback(); + }); +} + +- (void)netService:(NSNetService *)sender didNotResolve:(NSDictionary *)errorDict { +// brls::Logger::warning("Did not resolve address for: {}\n{}", sender, [errorDict description]); + + // Schedule a retry in 2 seconds + [NSTimer scheduledTimerWithTimeInterval:2.0 + target:self + selector:@selector(retryResolveTimerCallback:) + userInfo:sender + repeats:NO]; +} + +- (void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didFindService:(NSNetService *)aNetService moreComing:(BOOL)moreComing { +// brls::Logger::debug("Found service: {}", aNetService); + + if (![services containsObject:aNetService]) { + brls::Logger::info("Found new host: {}", [aNetService.name cStringUsingEncoding:NSUTF8StringEncoding]); + [aNetService setDelegate:self]; + [aNetService resolveWithTimeout:5]; + [services addObject:aNetService]; + } +} + +- (void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didRemoveService:(NSNetService *)aNetService moreComing:(BOOL)moreComing { +// brls::Logger::info("Removing service: {}", aNetService); + [services removeObject:aNetService]; +} + +- (void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser didNotSearch:(NSDictionary *)errorDict { +// brls::Logger::warning("Did not perform search: \n{}", [errorDict description]); + + // We'll schedule a retry in startSearchTimerCallback +} + +- (void)startSearchTimerCallback:(NSTimer *)timer { + // Check if we've been stopped since this was queued + if (!scanActive) { + timerPending = FALSE; + return; + } + + brls::Logger::debug("Restarting mDNS search"); + [mDNSBrowser stop]; + [mDNSBrowser searchForServicesOfType:NV_SERVICE_TYPE inDomain:@""]; + + // Search again in 5 seconds. We need to do this because + // we want more aggressive querying than Bonjour will normally + // do for when we're at the hosts screen. This also covers scenarios + // where discovery didn't work, like if WiFi was disabled. + [NSTimer scheduledTimerWithTimeInterval:5.0 + target:self + selector:@selector(startSearchTimerCallback:) + userInfo:nil + repeats:NO]; +} + +- (void)retryResolveTimerCallback:(NSTimer *)timer { + // Check if we've been stopped since this was queued + if (!scanActive) { + return; + } + + NSNetService* service = timer.userInfo; +// brls::Logger::info("Retrying mDNS resolution for {}", service); + + if (service.hostName == nil) { + [service setDelegate:self]; + [service resolveWithTimeout:5]; + } +} + +@end + +MDNSManager* mDNSManager = [[MDNSManager alloc] init]; + +void *get_in_addr(struct sockaddr *sa) { + if (sa->sa_family == AF_INET) + return &(((struct sockaddr_in*)sa)->sin_addr); + return &(((struct sockaddr_in6*)sa)->sin6_addr); +} + +void darwin_mdns_start(ServerCallback>& callback) { + _callback = [callback]() { + brls::sync([callback] { + callback(GSResult>::success(foundHosts)); + }); + }; + [mDNSManager searchForHosts]; +} + +void darwin_mdns_stop() { + [mDNSManager stopSearching]; + [mDNSManager forgetHosts]; + foundHosts.clear(); +} diff --git a/app/platforms/ios/iOSBundleInfo.plist.in b/app/platforms/ios/iOSBundleInfo.plist.in new file mode 100644 index 0000000..1ea4be2 --- /dev/null +++ b/app/platforms/ios/iOSBundleInfo.plist.in @@ -0,0 +1,87 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleSignature + ???? + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + UILaunchStoryboardName + Splash + UIRequiresFullScreen + + UIApplicationSupportsIndirectInputEvents + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + + + NSBluetoothPeripheralUsageDescription + MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app. + NSBluetoothAlwaysUsageDescription + MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app. + CADisableMinimumFrameDurationOnPhone + + NSBonjourServices + + _nvstream._tcp + + UIRequiresFullScreen + + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + GCSupportedGameControllers + + + ProfileName + ExtendedGamepad + + + GCSupportsControllerUserInteraction + + LSApplicationCategoryType + public.app-category.games + GCSupportsGameMode + + NSLocalNetworkUsageDescription + Network usage is required to find hosts in your local network + ITSAppUsesNonExemptEncryption + + + diff --git a/app/platforms/ios/iphoneos/Splash.storyboard b/app/platforms/ios/iphoneos/Splash.storyboard new file mode 100644 index 0000000..41dd993 --- /dev/null +++ b/app/platforms/ios/iphoneos/Splash.storyboard @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/platforms/ios/tvos/Splash.storyboard b/app/platforms/ios/tvos/Splash.storyboard new file mode 100644 index 0000000..660ba53 --- /dev/null +++ b/app/platforms/ios/tvos/Splash.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256 1.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256 1.png new file mode 100644 index 0000000..c2ac17d Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256 1.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256.png new file mode 100644 index 0000000..c2ac17d Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@0.5x.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@0.5x.png new file mode 100644 index 0000000..fdc13fe Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@0.5x.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@16w.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@16w.png new file mode 100644 index 0000000..e005ee8 Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@16w.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@2x 1.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@2x 1.png new file mode 100644 index 0000000..1d8392f Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@2x 1.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@2x.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@2x.png new file mode 100644 index 0000000..1d8392f Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@2x.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@32w 1.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@32w 1.png new file mode 100644 index 0000000..c6dcace Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@32w 1.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@32w.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@32w.png new file mode 100644 index 0000000..c6dcace Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@32w.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@4x.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@4x.png new file mode 100644 index 0000000..c0308a2 Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@4x.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@64w.png b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@64w.png new file mode 100644 index 0000000..bb6c8cc Binary files /dev/null and b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/256x256@64w.png differ diff --git a/app/platforms/mac/Images.xcassets/AppIcon.appiconset/Contents.json b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2fb802a --- /dev/null +++ b/app/platforms/mac/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "filename" : "256x256@16w.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "filename" : "256x256@32w 1.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "filename" : "256x256@32w.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "filename" : "256x256@64w.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "filename" : "256x256@0.5x.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "filename" : "256x256 1.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "filename" : "256x256.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "filename" : "256x256@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "filename" : "256x256@2x 1.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "filename" : "256x256@4x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/mac/Images.xcassets/Contents.json b/app/platforms/mac/Images.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/app/platforms/mac/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/app/platforms/psv/module/libGLESv2.suprx b/app/platforms/psv/module/libGLESv2.suprx new file mode 100644 index 0000000..57515c9 Binary files /dev/null and b/app/platforms/psv/module/libGLESv2.suprx differ diff --git a/app/platforms/psv/module/libIMGEGL.suprx b/app/platforms/psv/module/libIMGEGL.suprx new file mode 100644 index 0000000..f81afa7 Binary files /dev/null and b/app/platforms/psv/module/libIMGEGL.suprx differ diff --git a/app/platforms/psv/module/libgpu_es4_ext.suprx b/app/platforms/psv/module/libgpu_es4_ext.suprx new file mode 100644 index 0000000..afa3e01 Binary files /dev/null and b/app/platforms/psv/module/libgpu_es4_ext.suprx differ diff --git a/app/platforms/psv/sce_sys/icon0.png b/app/platforms/psv/sce_sys/icon0.png new file mode 100644 index 0000000..77e50fe Binary files /dev/null and b/app/platforms/psv/sce_sys/icon0.png differ diff --git a/app/platforms/psv/sce_sys/livearea/contents/bg.png b/app/platforms/psv/sce_sys/livearea/contents/bg.png new file mode 100644 index 0000000..6e563da Binary files /dev/null and b/app/platforms/psv/sce_sys/livearea/contents/bg.png differ diff --git a/app/platforms/psv/sce_sys/livearea/contents/startup.png b/app/platforms/psv/sce_sys/livearea/contents/startup.png new file mode 100644 index 0000000..61edda2 Binary files /dev/null and b/app/platforms/psv/sce_sys/livearea/contents/startup.png differ diff --git a/app/platforms/psv/sce_sys/livearea/contents/template.xml b/app/platforms/psv/sce_sys/livearea/contents/template.xml new file mode 100644 index 0000000..15a2dd1 --- /dev/null +++ b/app/platforms/psv/sce_sys/livearea/contents/template.xml @@ -0,0 +1,37 @@ + + + + bg.png + + + + startup.png + + + + + + MOONLIGHT + + + + + + + + AN OPEN SOURCE +NVIDIA GAMESTREAM CLIENT + + + + + + + + v0.9.3 + + + + + + diff --git a/app/platforms/psv/sce_sys/livearea/contents/template.xml.format b/app/platforms/psv/sce_sys/livearea/contents/template.xml.format new file mode 100644 index 0000000..383045e --- /dev/null +++ b/app/platforms/psv/sce_sys/livearea/contents/template.xml.format @@ -0,0 +1,37 @@ + + + + bg.png + + + + startup.png + + + + + + MOONLIGHT + + + + + + + + AN OPEN SOURCE +NVIDIA GAMESTREAM CLIENT + + + + + + + + v{version} + + + + + + diff --git a/vcpkg.json b/vcpkg.json index 5344b89..87dcde4 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,8 +2,5 @@ "name" : "thorvg", "version-string" : "1.0.0", "builtin-baseline" : "b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c", - "dependencies" : [ { - "name" : "sdl2", - "version>=" : "2.30.9" - } ] -} \ No newline at end of file + "dependencies" : [] +}