axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
908 stars 198 forks source link

[feature] Support for tvOS #826

Closed paulocoutinhox closed 2 years ago

paulocoutinhox commented 2 years ago

Hi,

Can you add support for tvOS and tvOS simulator?

Example:

Thanks.

paulocoutinhox commented 2 years ago

Im trying to add support to my project and post here all the diffs.

AppController.mm

#if not TARGET_OS_TV
_viewController.wantsFullScreenLayout = YES;
#endif
#if not TARGET_OS_TV
    [[UIApplication sharedApplication] setStatusBarHidden:true];
#endif

RootViewController.mm

#if not TARGET_OS_TV
    [eaglView setMultipleTouchEnabled:NO];
#endif

CMakeLists.txt

LaunchScreen

Linkage

libbz2.tdb need be linked with Apple TV version:

ld: building for tvOS Simulator, but linking in .tbd built for iOS, file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk/usr/lib/libbz2.tbd' for architecture arm64

Im putting the assets as attachment

tv-assets.zip

paulocoutinhox commented 2 years ago

Im near to finish the port, but has a problem:

#ifndef __ARM_FP
#error "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
#else

on arm_neon.h file.

I tried add the flags:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=softfp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfloat-abi=softfp")

But the same error happens.

What to do in this case?

paulocoutinhox commented 2 years ago

I found a solution disabling it on thirdparty/astc/CMakeLists.txt when is tvOS

paulocoutinhox commented 2 years ago

Hi,

Can you add libs for AppleTV and Apple TV Simulator in prebuilt folders? Only have for ios.

ld: in /Users/paulo/Developer/workspaces/cpp/axys/thirdparty/openssl/prebuilt/ios/libcrypto.a(libcrypto-lib-aes_cfb.o), building for tvOS Simulator, but linking in object file built for iOS Simulator, for architecture x86_64

Example:

image
halx99 commented 2 years ago

Needs modify https://github.com/axmolengine/buildware

paulocoutinhox commented 2 years ago

@halx99 https://github.com/axys1/buildware/pull/7