Add apple tvos support (#846)

* support tvos

* support tvos and fix run command

* support tvos, fix run script and fix windows files

* support tvos on ci

* support tvos on ci and fix windows zlib

* support tvos on ci

* support tvos

* support tvos and tvos tests
This commit is contained in:
Paulo Coutinho 2022-09-05 03:13:52 -03:00 committed by GitHub
parent 6038cfb531
commit f5aeb5a8c2
433 changed files with 4684 additions and 1360 deletions

38
.editorconfig Normal file
View File

@ -0,0 +1,38 @@
root = true
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.py]
indent_style = space
indent_size = 4
[{*[Mm]akefile*,*.mak,*.mk,depend}]
indent_style = tab
[*.{bat, cmd, cmd.*}]
end_of_line = crlf
indent_style = space
indent_size = 4
[*.yml]
indent_style = space
indent_size = 2
[*.md]
indent_size = 4
trim_trailing_whitespace = false
[*.gemspec]
indent_size = 2
[*.rb]
indent_size = 2
[*.bat]
end_of_line = crlf

View File

@ -118,3 +118,23 @@ jobs:
run: |
tools/unix-ci/before-install.sh
tools/unix-ci/run-script.sh
build-tvos:
name: build-tvos
runs-on: macos-latest
env:
GH_OS_NAME: osx
BUILD_TARGET: tvos
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# since github latest macos-latest(220807) env(3.24.0) break our ci, so we set cmake version explicit
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
with:
cmake-version: '3.23.3'
- name: Build
run: |
tools/unix-ci/before-install.sh
tools/unix-ci/run-script.sh

45
.github/workflows/tvos-ci.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: tvos
on:
push:
branches:
- dev
- release
paths-ignore:
- '**.md'
- 'docs/**'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
GH_OS_NAME: osx
BUILD_TARGET: tvos
BUILD_TYPE: Release
jobs:
build:
if: ${{ !startsWith(github.event.commits[0].message, 'Merge pull request') }}
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# since github latest macos-latest(220807) env(3.24.0) break our ci, so we set cmake version explicit
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
with:
cmake-version: '3.23.3'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all
run: tools/unix-ci/before-install.sh
- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: tools/unix-ci/run-script.sh

View File

@ -1040,7 +1040,7 @@ Developers:
Allow setting bundle to use in file utils on iOS and Mac OS X
yongkangchen
Fixed a bug that font size of EditBox is not scaled when glview is scaled on Mac OS X
Fixed a bug that font size of EditBox is not scaled when glView is scaled on Mac OS X
Fixed a bug that Label::setTextColor does not have any effect on Mac OS X
wagulu

View File

@ -13,6 +13,7 @@
[![Windows Build Status](https://github.com/axys1/axys/actions/workflows/windows-ci.yml/badge.svg)](https://github.com/axys1/axys/actions/workflows/windows-ci.yml)
[![Android Build Status](https://github.com/axys1/axys/workflows/android/badge.svg)](https://github.com/axys1/axys/actions?query=workflow%3Aandroid)
[![iOS Build Status](https://github.com/axys1/axys/workflows/ios/badge.svg)](https://github.com/axys1/axys/actions?query=workflow%3Aios)
[![tvOS Build Status](https://github.com/axys1/axys/workflows/tvos/badge.svg)](https://github.com/axys1/axys/actions?query=workflow%3Atvos)
[![Linux Build Status](https://github.com/axys1/axys/workflows/linux/badge.svg)](https://github.com/axys1/axys/actions?query=workflow%3Alinux)
[![macOS Build Status](https://github.com/axys1/axys/workflows/osx/badge.svg)](https://github.com/axys1/axys/actions?query=workflow%3Aosx)
@ -46,14 +47,14 @@
* Extensions having own license as part of there package.
* Refactor AudioEngine, OpenAL for all platforms
* [OpenAL Soft](https://github.com/kcat/openal-soft), pass -DAX_USE_ALSOFT=ON to cmake to force enabling it
* [OpenAL.framework](https://opensource.apple.com/tarballs/OpenAL), if no ```AX_USE_ALSOFT``` option specified, cmake script will choose it on osx/ios, even though it was marked as deprecated, but still available.
* [OpenAL.framework](https://opensource.apple.com/tarballs/OpenAL), if no ```AX_USE_ALSOFT``` option specified, cmake script will choose it on osx/ios/tvos, even though it was marked as deprecated, but still available.
* Refactor UserDefault with [mio](https://github.com/mandreyel/mio)
* Modularize all optional extensions, move from engine core folder to an extensions folder
* Implement all .wav formats supported by ```OpenAL Soft```, such as MS-ADPCM, ADPCM, ...
* Use a modern GL loader ```Glad```
* Google [angle](https://github.com/google/angle) renderer backend support
* C++ 17 standard
* IOS SDK 9.0 as minimal deployment
* IOS/TVOS SDK 9.0 as minimal deployment
* Use fast pugixml
* Use [curl](https://github.com/curl/curl) for transferring data with URL syntax
* Use SAX parser for all plist files
@ -134,24 +135,30 @@ See [windows workflow guide](https://github.com/axys1/axys/issues/564)
.\gradlew.bat assembleRelease -PPROP_BUILD_TYPE=cmake -PPROP_APP_ABI=arm64-v8a --parallel --info
```
#### iOS and macOS
#### iOS, tvOS and macOS
1. Ensure xcode12+ & [cmake3.21+](https://github.com/Kitware/CMake/releases) are installed, install cmake command line support: ```sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install```
2. Execute the following command
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
3. Generate xcode project
- for ios arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=arm64```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=OS64```
- for ios armv7,arm64 combined:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=OS```
- for ios simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=SIMULATOR64```
- for tvos arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=TVOS```
- for tvos simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=SIMULATOR_TVOS```
- for macos x86_64(Intel)
`cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64`
```cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64```
- for macos arm64(M1)
`cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64`
```cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64```
4. After cmake finishes generating, you can open the xcode project at ```build``` folder and run cpp-tests or other test targets.
5. Notes
- **The code signing is required to run the ios app on your device, just change the bundle identifier until the auto manage signing is solved**
- **axys only provides armv7, arm64, x86_64 prebuilt libraries for ios**
- **The code signing is required to run the ios/tvos app on your device, just change the bundle identifier until the auto manage signing is solved**
- **axys only provides armv7, arm64, x86_64 prebuilt libraries for ios/tvos**
### New Project
- Cpp: `axys new -p org.axys1.hellocpp -d D:\dev\projects\ -l cpp --portrait HelloCpp`

View File

@ -86,12 +86,20 @@
2. 执行如下命令确保cmake能成功生成xcode工程:
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
3. 生成xcode工程, 进入axys根目录执行如下命令之一:
- for arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=arm64```
- for armv7,arm64 combined:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.mini.cmake "-DCMAKE_OSX_ARCHITECTURES=armv7;arm64"```
- for simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64```
- for ios arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=OS64```
- for ios armv7,arm64 combined:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=OS```
- for ios simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=SIMULATOR64```
- for tvos arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=TVOS```
- for tvos simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=SIMULATOR_TVOS```
- for macos x86_64(Intel)
```cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64```
- for macos arm64(M1)
```cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64```
4. 之后就可以用xcode打开, 选择cpp-tests编译运行

View File

@ -38,6 +38,11 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS")
set(APPLE TRUE)
set(IOS TRUE)
set(PLATFORM_FOLDER ios)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "tvOS")
set(APPLE TRUE)
set(IOS TRUE)
set(TVOS TRUE)
set(PLATFORM_FOLDER tvos)
else()
message(FATAL_ERROR "Unsupported platform, CMake will exit")
return()
@ -125,6 +130,14 @@ function(use_ax_compile_define target)
)
endif()
if(IOS)
if(TVOS)
target_compile_definitions(${target} PUBLIC AX_TARGET_OS_TVOS)
else()
target_compile_definitions(${target} PUBLIC AX_TARGET_OS_IPHONE)
endif()
endif()
elseif(LINUX)
target_compile_definitions(${target} PUBLIC LINUX)
target_compile_definitions(${target} PUBLIC _GNU_SOURCE)

View File

@ -75,31 +75,40 @@ macro(ax_depend)
# Locate system libraries on iOS
find_library(UIKIT_LIBRARY UIKit)
find_library(OPENGLES_LIBRARY OpenGLES)
find_library(CORE_MOTION_LIBRARY CoreMotion)
find_library(AVKIT_LIBRARY AVKit)
find_library(CORE_MEDIA_LIBRARY CoreMedia)
find_library(CORE_TEXT_LIBRARY CoreText)
find_library(SECURITY_LIBRARY Security)
find_library(CORE_GRAPHICS_LIBRARY CoreGraphics)
find_library(AV_FOUNDATION_LIBRARY AVFoundation)
find_library(WEBKIT_LIBRARY WebKit)
find_library(ZLIB z)
#find_library(ICONVLIB iconv)
if(NOT TVOS)
find_library(CORE_MOTION_LIBRARY CoreMotion)
find_library(WEBKIT_LIBRARY WebKit)
endif()
list(APPEND PLATFORM_SPECIFIC_LIBS
${UIKIT_LIBRARY}
${OPENGLES_LIBRARY}
${CORE_MOTION_LIBRARY}
${AVKIT_LIBRARY}
${CORE_MEDIA_LIBRARY}
${CORE_TEXT_LIBRARY}
${SECURITY_LIBRARY}
${CORE_GRAPHICS_LIBRARY}
${AV_FOUNDATION_LIBRARY}
${WEBKIT_LIBRARY}
${_AX_APPLE_LIBS}
${ZLIB}
#${ICONVLIB}
)
if(NOT TVOS)
list(APPEND PLATFORM_SPECIFIC_LIBS
${CORE_MOTION_LIBRARY}
${WEBKIT_LIBRARY}
)
endif()
endif()
endif()
endmacro()

View File

@ -50,7 +50,7 @@ open mac-build/axys.xcodeproj
```sh
cd axys
mkdir ios-build
cmake -B ios-build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake
cmake -B ios-build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=OS64
open ios-build/axys.xcodeproj
```

View File

@ -1,70 +0,0 @@
# See: https://github.com/yasio/ios.mini.cmake
if(NOT DEFINED CMAKE_SYSTEM_NAME)
set(CMAKE_SYSTEM_NAME "iOS" CACHE STRING "The CMake system name for iOS")
endif()
# The best solution for fix try_compile failed with code sign currently
# since cmake-3.18.2, not required
# everyting for cmake toolchain config before project(xxx) is better
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
${CMAKE_TRY_COMPILE_PLATFORM_VARIABLES}
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED"
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED NO)
# set(CMAKE_BUILD_WITH_INSTALL_RPATH YES)
# set(CMAKE_INSTALL_RPATH "@executable_path/Frameworks")
# set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" ${CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS})
# Default deployment target is 9.0
# a. armv7 maximum deployment 10.x
# b. armv7 TLS require minimal deployment 9.0
set(IOS_DEFAULT_DEPLOYMENT_TARGET "9.0")
# Fix compile failed with armv7 deployment target >= 11.0, xcode clang will report follow error
# clang: error: invalid iOS deployment version '--target=armv7-apple-ios13.6',
# iOS 10 is the maximum deployment target for 32-bit targets
# If not defined CMAKE_OSX_DEPLOYMENT_TARGET, cmake will choose latest deployment target
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES ".*armv7.*")
if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET
OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" VERSION_GREATER "11.0"
OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" VERSION_EQUAL "11.0")
message(STATUS "Forcing osx minimum deployment target to ${IOS_DEFAULT_DEPLOYMENT_TARGET} for armv7")
set(CMAKE_OSX_DEPLOYMENT_TARGET ${IOS_DEFAULT_DEPLOYMENT_TARGET} CACHE STRING "Minimum OS X deployment version")
endif()
else()
if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
message(STATUS "The CMAKE_OSX_DEPLOYMENT_TARGET not defined, sets iOS minimum deployment target to ${IOS_DEFAULT_DEPLOYMENT_TARGET}")
set(CMAKE_OSX_DEPLOYMENT_TARGET ${IOS_DEFAULT_DEPLOYMENT_TARGET} CACHE STRING "Minimum OS X deployment version")
endif()
endif()
if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET)
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET} CACHE STRING "Minimum iphoneos deployment version")
endif()
# Regard x86_64 as iphonesimulator
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64")
set(CMAKE_OSX_SYSROOT "iphonesimulator" CACHE STRING "")
endif()
# Sets CMAKE_SYSTEM_PROCESSOR for iphoneos and iphonesimulator
string(TOLOWER "${CMAKE_OSX_SYSROOT}" lowercase_CMAKE_OSX_SYSROOT)
if("${lowercase_CMAKE_OSX_SYSROOT}" MATCHES "iphonesimulator")
set(IMC_IOS_PLAT "SIMULATOR" CACHE STRING "")
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "i386")
set(CMAKE_SYSTEM_PROCESSOR i386)
elseif("${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64")
set(CMAKE_SYSTEM_PROCESSOR x86_64)
else() # Since xcode12, default arch for iphonesimulator is arm64
if(${XCODE_VERSION} LESS "12.0.0")
set(CMAKE_SYSTEM_PROCESSOR x86_64)
else()
set(CMAKE_SYSTEM_PROCESSOR arm64)
endif()
endif()
else()
set(IMC_IOS_PLAT "DEVICE" CACHE STRING "")
set(CMAKE_SYSTEM_PROCESSOR arm64)
endif()

1014
cmake/ios.toolchain.cmake Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1323,10 +1323,10 @@ void Console::commandResolutionSubCommandEmpty(socket_native_type fd, std::strin
auto director = Director::getInstance();
Vec2 points = director->getWinSize();
Vec2 pixels = director->getWinSizeInPixels();
auto glview = director->getOpenGLView();
Vec2 design = glview->getDesignResolutionSize();
ResolutionPolicy res = glview->getResolutionPolicy();
Rect visibleRect = glview->getVisibleRect();
auto glView = director->getOpenGLView();
Vec2 design = glView->getDesignResolutionSize();
ResolutionPolicy res = glView->getResolutionPolicy();
Rect visibleRect = glView->getVisibleRect();
Console::Utility::mydprintf(fd,
"Window size:\n"

View File

@ -82,12 +82,12 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
JNIEXPORT void JNICALL Java_org_axys1_lib_AxysRenderer_nativeInit(JNIEnv*, jclass, jint w, jint h)
{
auto director = ax::Director::getInstance();
auto glview = director->getOpenGLView();
if (!glview)
auto glView = director->getOpenGLView();
if (!glView)
{
glview = ax::GLViewImpl::create("Android app");
glview->setFrameSize(w, h);
director->setOpenGLView(glview);
glView = ax::GLViewImpl::create("Android app");
glView->setFrameSize(w, h);
director->setOpenGLView(glView);
ax::Application::getInstance()->run();
}

View File

@ -464,8 +464,8 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
++i;
}
auto glview = ax::Director::getInstance()->getOpenGLView();
glview->handleTouchesBegin(i, (intptr_t*)ids, xs, ys);
auto glView = ax::Director::getInstance()->getOpenGLView();
glView->handleTouchesBegin(i, (intptr_t*)ids, xs, ys);
}
- (void)touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
@ -499,8 +499,8 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
++i;
}
auto glview = ax::Director::getInstance()->getOpenGLView();
glview->handleTouchesMove(i, (intptr_t*)ids, xs, ys, fs, ms);
auto glView = ax::Director::getInstance()->getOpenGLView();
glView->handleTouchesMove(i, (intptr_t*)ids, xs, ys, fs, ms);
}
- (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
@ -524,8 +524,8 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
++i;
}
auto glview = ax::Director::getInstance()->getOpenGLView();
glview->handleTouchesEnd(i, (intptr_t*)ids, xs, ys);
auto glView = ax::Director::getInstance()->getOpenGLView();
glView->handleTouchesEnd(i, (intptr_t*)ids, xs, ys);
}
- (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event
@ -549,8 +549,8 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
++i;
}
auto glview = ax::Director::getInstance()->getOpenGLView();
glview->handleTouchesCancel(i, (intptr_t*)ids, xs, ys);
auto glView = ax::Director::getInstance()->getOpenGLView();
glView->handleTouchesCancel(i, (intptr_t*)ids, xs, ys);
}
- (void)showKeyboard
@ -577,8 +577,8 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
if (dis < 0.0f)
dis = 0.0f;
auto glview = ax::Director::getInstance()->getOpenGLView();
dis *= glview->getScaleY();
auto glView = ax::Director::getInstance()->getOpenGLView();
dis *= glView->getScaleY();
dis /= self.contentScaleFactor;
@ -666,6 +666,7 @@ UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrien
- (void)onUIKeyboardNotification:(NSNotification*)notif
{
#if !defined(AX_TARGET_OS_TVOS)
NSString* type = notif.name;
NSDictionary* info = [notif userInfo];
@ -718,9 +719,9 @@ UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrien
break;
}
auto glview = ax::Director::getInstance()->getOpenGLView();
float scaleX = glview->getScaleX();
float scaleY = glview->getScaleY();
auto glView = ax::Director::getInstance()->getOpenGLView();
float scaleX = glView->getScaleX();
float scaleY = glView->getScaleY();
// Convert to pixel coordinate
begin = CGRectApplyAffineTransform(
@ -728,7 +729,7 @@ UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrien
end = CGRectApplyAffineTransform(
end, CGAffineTransformScale(CGAffineTransformIdentity, self.contentScaleFactor, self.contentScaleFactor));
float offestY = glview->getViewPortRect().origin.y;
float offestY = glView->getViewPortRect().origin.y;
if (offestY < 0.0f)
{
begin.origin.y += offestY;
@ -766,6 +767,7 @@ UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrien
self.isKeyboardShown = NO;
dispatcher->dispatchKeyboardDidHide(notiInfo);
}
#endif
}
// Close the keyboard opened by EditBox

View File

@ -63,7 +63,7 @@ public:
virtual bool isRetinaDisplay() const override { return getContentScaleFactor() == 2.0; }
/** returns the objective-c CCEAGLView instance */
virtual void* getEAGLView() const override { return _eaglview; }
virtual void* getEAGLView() const override { return _eaglView; }
// overrides
virtual bool isOpenGLReady() override;
@ -82,7 +82,7 @@ protected:
bool initWithFullScreen(std::string_view viewName);
// the objective-c CCEAGLView instance
void* _eaglview;
void* _eaglView;
};
NS_AX_END

View File

@ -37,10 +37,10 @@ void* GLViewImpl::_pixelFormat = kEAGLColorFormatRGB565;
int GLViewImpl::_depthFormat = GL_DEPTH_COMPONENT16;
int GLViewImpl::_multisamplingCount = 0;
GLViewImpl* GLViewImpl::createWithEAGLView(void* eaglview)
GLViewImpl* GLViewImpl::createWithEAGLView(void* eaglView)
{
auto ret = new GLViewImpl;
if (ret->initWithEAGLView(eaglview))
if (ret->initWithEAGLView(eaglView))
{
ret->autorelease();
return ret;
@ -122,18 +122,18 @@ GLViewImpl::GLViewImpl() {}
GLViewImpl::~GLViewImpl()
{
// CCEAGLView *glview = (CCEAGLView*) _eaglview;
//[glview release];
// CCEAGLView *glView = (CCEAGLView*) _eaglView;
//[glView release];
}
bool GLViewImpl::initWithEAGLView(void* eaglview)
bool GLViewImpl::initWithEAGLView(void* eaglView)
{
_eaglview = eaglview;
CCEAGLView* glview = (CCEAGLView*)_eaglview;
_eaglView = eaglView;
CCEAGLView* glView = (CCEAGLView*)_eaglView;
_screenSize.width = _designResolutionSize.width = [glview getWidth];
_screenSize.height = _designResolutionSize.height = [glview getHeight];
// _scaleX = _scaleY = [glview contentScaleFactor];
_screenSize.width = _designResolutionSize.width = [glView getWidth];
_screenSize.height = _designResolutionSize.height = [glView getHeight];
// _scaleX = _scaleY = [glView contentScaleFactor];
return true;
}
@ -142,7 +142,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const Rect& rect, float
{
CGRect r = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
convertAttrs();
CCEAGLView* eaglview = [CCEAGLView viewWithFrame:r
CCEAGLView* eaglView = [CCEAGLView viewWithFrame:r
pixelFormat:(NSString*)_pixelFormat
depthFormat:_depthFormat
preserveBackbuffer:NO
@ -152,14 +152,14 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const Rect& rect, float
// Not available on tvOS
#if !defined(AX_TARGET_OS_TVOS)
[eaglview setMultipleTouchEnabled:YES];
[eaglView setMultipleTouchEnabled:YES];
#endif
_screenSize.width = _designResolutionSize.width = [eaglview getWidth];
_screenSize.height = _designResolutionSize.height = [eaglview getHeight];
// _scaleX = _scaleY = [eaglview contentScaleFactor];
_screenSize.width = _designResolutionSize.width = [eaglView getWidth];
_screenSize.height = _designResolutionSize.height = [eaglView getHeight];
// _scaleX = _scaleY = [eaglView contentScaleFactor];
_eaglview = eaglview;
_eaglView = eaglView;
return true;
}
@ -178,7 +178,7 @@ bool GLViewImpl::initWithFullScreen(std::string_view viewName)
bool GLViewImpl::isOpenGLReady()
{
return _eaglview != nullptr;
return _eaglView != nullptr;
}
bool GLViewImpl::setContentScaleFactor(float contentScaleFactor)
@ -186,17 +186,17 @@ bool GLViewImpl::setContentScaleFactor(float contentScaleFactor)
AX_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode
_scaleX = _scaleY = contentScaleFactor;
CCEAGLView* eaglview = (CCEAGLView*)_eaglview;
[eaglview setNeedsLayout];
CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
[eaglView setNeedsLayout];
return true;
}
float GLViewImpl::getContentScaleFactor() const
{
CCEAGLView* eaglview = (CCEAGLView*)_eaglview;
CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
float scaleFactor = [eaglview contentScaleFactor];
float scaleFactor = [eaglView contentScaleFactor];
// AXASSERT(scaleFactor == _scaleX == _scaleY, "Logic error in GLView::getContentScaleFactor");
@ -208,36 +208,36 @@ void GLViewImpl::end()
[CCDirectorCaller destroy];
// destroy EAGLView
CCEAGLView* eaglview = (CCEAGLView*)_eaglview;
CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
[eaglview removeFromSuperview];
//[eaglview release];
[eaglView removeFromSuperview];
//[eaglView release];
release();
}
void GLViewImpl::swapBuffers()
{
CCEAGLView* eaglview = (CCEAGLView*)_eaglview;
[eaglview swapBuffers];
CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
[eaglView swapBuffers];
}
void GLViewImpl::setIMEKeyboardState(bool open)
{
CCEAGLView* eaglview = (CCEAGLView*)_eaglview;
CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
if (open)
{
[eaglview showKeyboard];
[eaglView showKeyboard];
}
else
{
[eaglview hideKeyboard];
[eaglView hideKeyboard];
}
}
Rect GLViewImpl::getSafeAreaRect() const
{
CCEAGLView* eaglview = (CCEAGLView*)_eaglview;
CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
float version = [[UIDevice currentDevice].systemVersion floatValue];
@ -245,14 +245,14 @@ Rect GLViewImpl::getSafeAreaRect() const
{
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpartial-availability"
UIEdgeInsets safeAreaInsets = eaglview.safeAreaInsets;
UIEdgeInsets safeAreaInsets = eaglView.safeAreaInsets;
# pragma clang diagnostic pop
// Multiply contentScaleFactor since safeAreaInsets return points.
safeAreaInsets.left *= eaglview.contentScaleFactor;
safeAreaInsets.right *= eaglview.contentScaleFactor;
safeAreaInsets.top *= eaglview.contentScaleFactor;
safeAreaInsets.bottom *= eaglview.contentScaleFactor;
safeAreaInsets.left *= eaglView.contentScaleFactor;
safeAreaInsets.right *= eaglView.contentScaleFactor;
safeAreaInsets.top *= eaglView.contentScaleFactor;
safeAreaInsets.bottom *= eaglView.contentScaleFactor;
// Get leftBottom and rightTop point in UI coordinates
Vec2 leftBottom = Vec2(safeAreaInsets.left, _screenSize.height - safeAreaInsets.bottom);

View File

@ -61,17 +61,17 @@ int Application::run()
std::chrono::steady_clock::time_point lastTime{};
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
auto glView = director->getOpenGLView();
// Retain glview to avoid glview being released in the while loop
glview->retain();
// Retain glView to avoid glView being released in the while loop
glView->retain();
while (!glview->windowShouldClose())
while (!glView->windowShouldClose())
{
lastTime = std::chrono::steady_clock::now();
director->mainLoop();
glview->pollEvents();
glView->pollEvents();
auto interval = std::chrono::steady_clock::now() - lastTime;
if (interval < _animationInterval)
@ -89,13 +89,13 @@ int Application::run()
* when we want to close the window, we should call Director::end();
* then call Director::mainLoop to do release of internal resources
*/
if (glview->isOpenGLReady())
if (glView->isOpenGLReady())
{
director->end();
director->mainLoop();
director = nullptr;
}
glview->release();
glView->release();
return EXIT_SUCCESS;
}

View File

@ -64,17 +64,17 @@ int Application::run()
constexpr std::chrono::nanoseconds _1ms{1000000};
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
auto glView = director->getOpenGLView();
// Retain glview to avoid glview being released in the while loop
glview->retain();
// Retain glView to avoid glView being released in the while loop
glView->retain();
while (!glview->windowShouldClose())
while (!glView->windowShouldClose())
{
lastTime = std::chrono::steady_clock::now();
director->mainLoop();
glview->pollEvents();
glView->pollEvents();
auto interval = std::chrono::steady_clock::now() - lastTime;
auto waitDuration = _animationInterval - interval - _1ms;
@ -89,13 +89,13 @@ int Application::run()
* when we want to close the window, we should call Director::end();
* then call Director::mainLoop to do release of internal resources
*/
if (glview->isOpenGLReady())
if (glView->isOpenGLReady())
{
director->end();
director->mainLoop();
}
glview->release();
glView->release();
return 0;
}

View File

@ -50,8 +50,8 @@ void ccMessageBox(const char* msg, const char* title)
[alert setInformativeText:tmpTitle];
[alert setAlertStyle:NSAlertStyleWarning];
auto glview = Director::getInstance()->getOpenGLView();
id window = glview->getCocoaWindow();
auto glView = Director::getInstance()->getOpenGLView();
id window = glView->getCocoaWindow();
[alert beginSheetModalForWindow:window completionHandler:nil];
}

View File

@ -90,10 +90,10 @@ int Application::run()
}
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
auto glView = director->getOpenGLView();
// Retain glview to avoid glview being released in the while loop
glview->retain();
// Retain glView to avoid glView being released in the while loop
glView->retain();
LONGLONG interval = 0LL;
LONG waitMS = 0L;
@ -101,7 +101,7 @@ int Application::run()
LARGE_INTEGER freq;
QueryPerformanceFrequency(&freq);
while (!glview->windowShouldClose())
while (!glView->windowShouldClose())
{
QueryPerformanceCounter(&nNow);
interval = nNow.QuadPart - nLast.QuadPart;
@ -109,7 +109,7 @@ int Application::run()
{
nLast.QuadPart = nNow.QuadPart;
director->mainLoop();
glview->pollEvents();
glView->pollEvents();
}
else
{
@ -125,13 +125,13 @@ int Application::run()
}
// Director should still do a cleanup if the window was closed manually.
if (glview->isOpenGLReady())
if (glView->isOpenGLReady())
{
director->end();
director->mainLoop();
director = nullptr;
}
glview->release();
glView->release();
///////////////////////////////////////////////////////////////////////////
/////////////// restoring timer resolution

View File

@ -52,29 +52,51 @@ elseif(APPLE)
ui/UIEditBox/Mac/CCUITextFieldFormatter.m
)
elseif(IOS)
set(_AX_UI_SPECIFIC_HEADER
ui/UIWebView/UIWebView.h
ui/UIVideoPlayer/UIVideoPlayer.h
ui/UIWebView/UIWebViewImpl-ios.h
ui/UIEditBox/UIEditBoxImpl-ios.h
ui/UIEditBox/iOS/CCUIEditBoxIOS.h
ui/UIEditBox/iOS/CCUIMultilineTextField.h
ui/UIEditBox/iOS/CCUITextInput.h
ui/UIEditBox/iOS/UITextView+CCUITextInput.h
ui/UIEditBox/iOS/UITextField+CCUITextInput.h
ui/UIEditBox/iOS/CCUISingleLineTextField.h
)
set(_AX_UI_SPECIFIC_SRC
ui/UIWebView/UIWebView.mm
ui/UIVideoPlayer/UIVideoPlayer-ios.mm
ui/UIWebView/UIWebViewImpl-ios.mm
ui/UIEditBox/UIEditBoxImpl-ios.mm
ui/UIEditBox/iOS/CCUIEditBoxIOS.mm
ui/UIEditBox/iOS/CCUIMultilineTextField.mm
ui/UIEditBox/iOS/CCUISingleLineTextField.mm
ui/UIEditBox/iOS/UITextField+CCUITextInput.mm
ui/UIEditBox/iOS/UITextView+CCUITextInput.mm
)
if (TVOS)
set(_AX_UI_SPECIFIC_HEADER
ui/UIVideoPlayer/UIVideoPlayer.h
ui/UIEditBox/UIEditBoxImpl-ios.h
ui/UIEditBox/iOS/CCUIEditBoxIOS.h
ui/UIEditBox/iOS/CCUIMultilineTextField.h
ui/UIEditBox/iOS/CCUITextInput.h
ui/UIEditBox/iOS/UITextView+CCUITextInput.h
ui/UIEditBox/iOS/UITextField+CCUITextInput.h
ui/UIEditBox/iOS/CCUISingleLineTextField.h
)
set(_AX_UI_SPECIFIC_SRC
ui/UIVideoPlayer/UIVideoPlayer-ios.mm
ui/UIEditBox/UIEditBoxImpl-ios.mm
ui/UIEditBox/iOS/CCUIEditBoxIOS.mm
ui/UIEditBox/iOS/CCUIMultilineTextField.mm
ui/UIEditBox/iOS/CCUISingleLineTextField.mm
ui/UIEditBox/iOS/UITextField+CCUITextInput.mm
ui/UIEditBox/iOS/UITextView+CCUITextInput.mm
)
else()
set(_AX_UI_SPECIFIC_HEADER
ui/UIWebView/UIWebView.h
ui/UIVideoPlayer/UIVideoPlayer.h
ui/UIWebView/UIWebViewImpl-ios.h
ui/UIEditBox/UIEditBoxImpl-ios.h
ui/UIEditBox/iOS/CCUIEditBoxIOS.h
ui/UIEditBox/iOS/CCUIMultilineTextField.h
ui/UIEditBox/iOS/CCUITextInput.h
ui/UIEditBox/iOS/UITextView+CCUITextInput.h
ui/UIEditBox/iOS/UITextField+CCUITextInput.h
ui/UIEditBox/iOS/CCUISingleLineTextField.h
)
set(_AX_UI_SPECIFIC_SRC
ui/UIWebView/UIWebView.mm
ui/UIVideoPlayer/UIVideoPlayer-ios.mm
ui/UIWebView/UIWebViewImpl-ios.mm
ui/UIEditBox/UIEditBoxImpl-ios.mm
ui/UIEditBox/iOS/CCUIEditBoxIOS.mm
ui/UIEditBox/iOS/CCUIMultilineTextField.mm
ui/UIEditBox/iOS/CCUISingleLineTextField.mm
ui/UIEditBox/iOS/UITextField+CCUITextInput.mm
ui/UIEditBox/iOS/UITextView+CCUITextInput.mm
)
endif()
endif()
elseif(LINUX)
set(_AX_UI_SPECIFIC_HEADER

View File

@ -907,9 +907,9 @@ void LayoutHelper::VisibleRect::lazyInit()
if (s_ScreenVisibleRect.size.width == 0.0f && s_ScreenVisibleRect.size.height == 0.0f)
{
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
auto glView = director->getOpenGLView();
if (glview->getResolutionPolicy() == ResolutionPolicy::NO_BORDER)
if (glView->getResolutionPolicy() == ResolutionPolicy::NO_BORDER)
{
s_ScreenVisibleRect.origin = director->getVisibleOrigin();
s_ScreenVisibleRect.size = director->getVisibleSize();

View File

@ -131,8 +131,8 @@
- (NSWindow*)window
{
auto glview = ax::Director::getInstance()->getOpenGLView();
return glview->getCocoaWindow();
auto glView = ax::Director::getInstance()->getOpenGLView();
return glView->getCocoaWindow();
}
- (void)openKeyboard

View File

@ -62,9 +62,9 @@ EditBoxImplIOS::~EditBoxImplIOS()
void EditBoxImplIOS::createNativeControl(const Rect& frame)
{
auto glview = ax::Director::getInstance()->getOpenGLView();
auto glView = ax::Director::getInstance()->getOpenGLView();
Rect rect(0, 0, frame.size.width * glview->getScaleX(), frame.size.height * glview->getScaleY());
Rect rect(0, 0, frame.size.width * glView->getScaleX(), frame.size.height * glView->getScaleY());
float factor = ax::Director::getInstance()->getContentScaleFactor();
@ -179,10 +179,10 @@ void EditBoxImplIOS::setNativeVisible(bool visible)
void EditBoxImplIOS::updateNativeFrame(const Rect& rect)
{
auto glview = ax::Director::getInstance()->getOpenGLView();
CCEAGLView* eaglview = (CCEAGLView*)glview->getEAGLView();
auto glView = ax::Director::getInstance()->getOpenGLView();
CCEAGLView* eaglView = (CCEAGLView*)glView->getEAGLView();
float factor = eaglview.contentScaleFactor;
float factor = eaglView.contentScaleFactor;
[_systemControl updateFrame:CGRectMake(rect.origin.x / factor, rect.origin.y / factor, rect.size.width / factor,
rect.size.height / factor)];
@ -208,14 +208,14 @@ void EditBoxImplIOS::nativeCloseKeyboard()
UIFont* EditBoxImplIOS::constructFont(const char* fontName, int fontSize)
{
AXASSERT(fontName != nullptr, "fontName can't be nullptr");
CCEAGLView* eaglview = static_cast<CCEAGLView*>(ax::Director::getInstance()->getOpenGLView()->getEAGLView());
float retinaFactor = eaglview.contentScaleFactor;
CCEAGLView* eaglView = static_cast<CCEAGLView*>(ax::Director::getInstance()->getOpenGLView()->getEAGLView());
float retinaFactor = eaglView.contentScaleFactor;
NSString* fntName = [NSString stringWithUTF8String:fontName];
fntName = [[fntName lastPathComponent] stringByDeletingPathExtension];
auto glview = ax::Director::getInstance()->getOpenGLView();
float scaleFactor = glview->getScaleX();
auto glView = ax::Director::getInstance()->getOpenGLView();
float scaleFactor = glView->getScaleX();
if (fontSize == -1)
{

View File

@ -57,9 +57,9 @@ EditBoxImplMac::~EditBoxImplMac()
void EditBoxImplMac::createNativeControl(const ax::Rect& frame)
{
auto glview = ax::Director::getInstance()->getOpenGLView();
auto glView = ax::Director::getInstance()->getOpenGLView();
Size size = frame.size;
NSRect rect = NSMakeRect(0, 0, size.width * glview->getScaleX(), size.height * glview->getScaleY());
NSRect rect = NSMakeRect(0, 0, size.width * glView->getScaleX(), size.height * glView->getScaleY());
float factor = ax::Director::getInstance()->getContentScaleFactor();
@ -75,8 +75,8 @@ NSFont* EditBoxImplMac::constructFont(const char* fontName, int fontSize)
NSString* fntName = [NSString stringWithUTF8String:fontName];
fntName = [[fntName lastPathComponent] stringByDeletingPathExtension];
float retinaFactor = _inRetinaMode ? 2.0f : 1.0f;
auto glview = ax::Director::getInstance()->getOpenGLView();
float scaleFactor = glview->getScaleX();
auto glView = ax::Director::getInstance()->getOpenGLView();
float scaleFactor = glView->getScaleX();
if (fontSize == -1)
{

View File

@ -320,9 +320,9 @@
- (void)doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance
{
auto view = ax::Director::getInstance()->getOpenGLView();
CCEAGLView* eaglview = (CCEAGLView*)view->getEAGLView();
CCEAGLView* eaglView = (CCEAGLView*)view->getEAGLView();
[eaglview doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];
[eaglView doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];
}
- (void)updateFrame:(CGRect)rect
@ -337,9 +337,9 @@
- (void)openKeyboard
{
auto view = ax::Director::getInstance()->getOpenGLView();
CCEAGLView* eaglview = (CCEAGLView*)view->getEAGLView();
CCEAGLView* eaglView = (CCEAGLView*)view->getEAGLView();
[eaglview addSubview:self.textInput];
[eaglView addSubview:self.textInput];
[self.textInput becomeFirstResponder];
}
@ -362,9 +362,9 @@
- (void)animationSelector
{
auto view = ax::Director::getInstance()->getOpenGLView();
CCEAGLView* eaglview = (CCEAGLView*)view->getEAGLView();
CCEAGLView* eaglView = (CCEAGLView*)view->getEAGLView();
[eaglview doAnimationWhenAnotherEditBeClicked];
[eaglView doAnimationWhenAnotherEditBeClicked];
}
#pragma mark - UITextView delegate methods
@ -376,9 +376,9 @@
_returnPressed = NO;
auto view = ax::Director::getInstance()->getOpenGLView();
CCEAGLView* eaglview = (CCEAGLView*)view->getEAGLView();
CCEAGLView* eaglView = (CCEAGLView*)view->getEAGLView();
if ([eaglview isKeyboardShown])
if ([eaglView isKeyboardShown])
{
[self performSelector:@selector(animationSelector) withObject:nil afterDelay:0.0f];
}
@ -469,9 +469,9 @@
_returnPressed = NO;
auto view = ax::Director::getInstance()->getOpenGLView();
CCEAGLView* eaglview = (CCEAGLView*)view->getEAGLView();
CCEAGLView* eaglView = (CCEAGLView*)view->getEAGLView();
if ([eaglview isKeyboardShown])
if ([eaglView isKeyboardShown])
{
[self performSelector:@selector(animationSelector) withObject:nil afterDelay:0.0f];
}

View File

@ -84,8 +84,8 @@ CGFloat const UI_PLACEHOLDER_TEXT_CHANGED_ANIMATION_DURATION = 0.25;
{
if (_placeHolderLabel == nil)
{
auto glview = ax::Director::getInstance()->getOpenGLView();
float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor();
auto glView = ax::Director::getInstance()->getOpenGLView();
float padding = AX_EDIT_BOX_PADDING * glView->getScaleX() / glView->getContentScaleFactor();
_placeHolderLabel =
[[UILabel alloc] initWithFrame:CGRectMake(padding, padding, self.bounds.size.width - padding * 2, 0)];
@ -106,9 +106,9 @@ CGFloat const UI_PLACEHOLDER_TEXT_CHANGED_ANIMATION_DURATION = 0.25;
- (CGRect)textRectForBounds:(CGRect)bounds
{
auto glview = ax::Director::getInstance()->getOpenGLView();
auto glView = ax::Director::getInstance()->getOpenGLView();
float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor();
float padding = AX_EDIT_BOX_PADDING * glView->getScaleX() / glView->getContentScaleFactor();
return CGRectInset(bounds, padding, padding);
}

View File

@ -76,9 +76,9 @@
- (CGRect)textRectForBounds:(CGRect)bounds
{
auto glview = ax::Director::getInstance()->getOpenGLView();
auto glView = ax::Director::getInstance()->getOpenGLView();
float padding = AX_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor();
float padding = AX_EDIT_BOX_PADDING * glView->getScaleX() / glView->getContentScaleFactor();
return CGRectInset(bounds, padding, padding);
}

View File

@ -320,9 +320,9 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor
void Layout::onBeforeVisitScissor()
{
auto glview = _director->getOpenGLView();
auto glView = _director->getOpenGLView();
// apply scissor test
_scissorOldState = glview->isScissorEnabled();
_scissorOldState = glView->isScissorEnabled();
if (false == _scissorOldState)
{
auto renderer = _director->getRenderer();
@ -331,10 +331,10 @@ void Layout::onBeforeVisitScissor()
// apply scissor box
Rect clippingRect = getClippingRect();
_clippingOldRect = glview->getScissorRect();
_clippingOldRect = glView->getScissorRect();
if (false == _clippingOldRect.equals(clippingRect))
{
glview->setScissorInPoints(clippingRect.origin.x, clippingRect.origin.y, clippingRect.size.width,
glView->setScissorInPoints(clippingRect.origin.x, clippingRect.origin.y, clippingRect.size.width,
clippingRect.size.height);
}
}
@ -346,8 +346,8 @@ void Layout::onAfterVisitScissor()
// revert scissor box
if (false == _clippingOldRect.equals(_clippingRect))
{
auto glview = _director->getOpenGLView();
glview->setScissorInPoints(_clippingOldRect.origin.x, _clippingOldRect.origin.y,
auto glView = _director->getOpenGLView();
glView->setScissorInPoints(_clippingOldRect.origin.x, _clippingOldRect.origin.y,
_clippingOldRect.size.width, _clippingOldRect.size.height);
}
}

View File

@ -40,9 +40,9 @@ static const float BOUNCE_BACK_DURATION = 1.0f;
static float convertDistanceFromPointToInch(const Vec2& dis)
{
auto glview = Director::getInstance()->getOpenGLView();
auto glView = Director::getInstance()->getOpenGLView();
int dpi = Device::getDPI();
float distance = Vec2(dis.x * glview->getScaleX() / dpi, dis.y * glview->getScaleY() / dpi).getLength();
float distance = Vec2(dis.x * glView->getScaleX() / dpi, dis.y * glView->getScaleY() / dpi).getLength();
return distance;
}

View File

@ -177,8 +177,8 @@ typedef NS_ENUM(NSInteger, PlayerbackState) {
[self showPlaybackControls:_showPlaybackControls];
auto view = ax::Director::getInstance()->getOpenGLView();
auto eaglview = (CCEAGLView*)view->getEAGLView();
[eaglview addSubview:self.playerController.view];
auto eaglView = (CCEAGLView*)view->getEAGLView();
[eaglView addSubview:self.playerController.view];
[self registerPlayerEventListener];
}

View File

@ -132,8 +132,8 @@
if (!self.wkWebView.superview)
{
auto view = ax::Director::getInstance()->getOpenGLView();
auto eaglview = (CCEAGLView*)view->getEAGLView();
[eaglview addSubview:self.wkWebView];
auto eaglView = (CCEAGLView*)view->getEAGLView();
[eaglView addSubview:self.wkWebView];
}
}

View File

@ -46,8 +46,8 @@ NS_AX_EXT_BEGIN
static float convertDistanceFromPointToInch(float pointDis)
{
auto glview = Director::getInstance()->getOpenGLView();
float factor = (glview->getScaleX() + glview->getScaleY()) / 2;
auto glView = Director::getInstance()->getOpenGLView();
float factor = (glView->getScaleX() + glView->getScaleY()) / 2;
return pointDis * factor / Device::getDPI();
}
@ -582,25 +582,25 @@ void ScrollView::onBeforeDraw()
// {
// _scissorRestored = false;
// Rect frame = getViewRect();
// auto glview = Director::getInstance()->getOpenGLView();
// auto glView = Director::getInstance()->getOpenGLView();
//
// if (glview->getVR() == nullptr) {
// if (glview->isScissorEnabled()) {
// if (glView->getVR() == nullptr) {
// if (glView->isScissorEnabled()) {
// _scissorRestored = true;
// _parentScissorRect = glview->getScissorRect();
// _parentScissorRect = glView->getScissorRect();
// //set the intersection of _parentScissorRect and frame as the new scissor rect
// if (frame.intersectsRect(_parentScissorRect)) {
// float x = MAX(frame.origin.x, _parentScissorRect.origin.x);
// float y = MAX(frame.origin.y, _parentScissorRect.origin.y);
// float xx = MIN(frame.origin.x + frame.size.width, _parentScissorRect.origin.x +
// _parentScissorRect.size.width); float yy = MIN(frame.origin.y + frame.size.height,
// _parentScissorRect.origin.y + _parentScissorRect.size.height); glview->setScissorInPoints(x,
// _parentScissorRect.origin.y + _parentScissorRect.size.height); glView->setScissorInPoints(x,
// y, xx - x, yy - y);
// }
// }
// else {
// glEnable(GL_SCISSOR_TEST);
// glview->setScissorInPoints(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
// glView->setScissorInPoints(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
// }
// }
// }
@ -623,10 +623,10 @@ void ScrollView::onAfterDraw()
// TODO:minggo
// if (_clippingToBounds)
// {
// auto glview = Director::getInstance()->getOpenGLView();
// if (glview->getVR() == nullptr) {
// auto glView = Director::getInstance()->getOpenGLView();
// if (glView->getVR() == nullptr) {
// if (_scissorRestored) {//restore the parent's scissor rect
// glview->setScissorInPoints(_parentScissorRect.origin.x, _parentScissorRect.origin.y,
// glView->setScissorInPoints(_parentScissorRect.origin.x, _parentScissorRect.origin.y,
// _parentScissorRect.size.width, _parentScissorRect.size.height);
// }
// else {

View File

@ -310,8 +310,8 @@ void FUIContainer::restoreAllProgramStates()
void FUIContainer::onBeforeVisitScissor()
{
auto glview = Director::getInstance()->getOpenGLView();
_rectClippingSupport->_scissorOldState = glview->isScissorEnabled();
auto glView = Director::getInstance()->getOpenGLView();
_rectClippingSupport->_scissorOldState = glView->isScissorEnabled();
Rect clippingRect = getClippingRect();
if (false == _rectClippingSupport->_scissorOldState)
{
@ -323,11 +323,11 @@ void FUIContainer::onBeforeVisitScissor()
}
else
{
_rectClippingSupport->_clippingOldRect = glview->getScissorRect();
_rectClippingSupport->_clippingOldRect = glView->getScissorRect();
clippingRect = ToolSet::intersection(clippingRect, _rectClippingSupport->_clippingOldRect);
}
glview->setScissorInPoints(clippingRect.origin.x,
glView->setScissorInPoints(clippingRect.origin.x,
clippingRect.origin.y,
clippingRect.size.width,
clippingRect.size.height);
@ -337,8 +337,8 @@ void FUIContainer::onAfterVisitScissor()
{
if (_rectClippingSupport->_scissorOldState)
{
auto glview = Director::getInstance()->getOpenGLView();
glview->setScissorInPoints(_rectClippingSupport->_clippingOldRect.origin.x,
auto glView = Director::getInstance()->getOpenGLView();
glView->setScissorInPoints(_rectClippingSupport->_clippingOldRect.origin.x,
_rectClippingSupport->_clippingOldRect.origin.y,
_rectClippingSupport->_clippingOldRect.size.width,
_rectClippingSupport->_clippingOldRect.size.height);

View File

@ -109,11 +109,21 @@ elseif(APPLE)
proj.ios_mac/ios/AppController.h
proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
proj.ios_mac/ios/LaunchScreen.storyboard
proj.ios_mac/ios/LaunchScreenBackground.png
proj.ios_mac/ios/Images.xcassets
)
if (TVOS)
set(APP_UI_RES
proj.ios_mac/ios/LaunchScreenBackground.png
proj.ios_mac/ios/targets/tvos/LaunchScreen.storyboard
proj.ios_mac/ios/targets/tvos/Images.xcassets
)
else()
set(APP_UI_RES
proj.ios_mac/ios/LaunchScreenBackground.png
proj.ios_mac/ios/targets/ios/LaunchScreen.storyboard
proj.ios_mac/ios/targets/ios/Images.xcassets
)
endif()
list(APPEND GAME_SOURCE
proj.ios_mac/ios/main.m
proj.ios_mac/ios/AppController.mm
@ -168,8 +178,11 @@ if(APPLE)
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
elseif(TVOS)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/targets/tvos/Info.plist")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "Brand Assets")
elseif(IOS)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist")
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/targets/ios/Info.plist")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
endif()

View File

@ -64,17 +64,17 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if (!glview)
auto glView = director->getOpenGLView();
if (!glView)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
glview = GLViewImpl::createWithRect(
glView = GLViewImpl::createWithRect(
"HelloCpp", axis::Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
#else
glview = GLViewImpl::create("HelloCpp");
glView = GLViewImpl::create("HelloCpp");
#endif
director->setOpenGLView(glview);
director->setOpenGLView(glView);
}
// turn on display FPS
@ -84,9 +84,9 @@ bool AppDelegate::applicationDidFinishLaunching()
director->setAnimationInterval(1.0f / 60);
// Set the design resolution
glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height,
glView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height,
ResolutionPolicy::NO_BORDER);
auto frameSize = glview->getFrameSize();
auto frameSize = glView->getFrameSize();
// if the frame's height is larger than the height of medium size.
if (frameSize.height > mediumResolutionSize.height)
{

View File

@ -39,7 +39,8 @@
"project_replace_ios_bundleid": {
"src_bundle_id": "org.axys1.hellocpp",
"files": [
"proj.ios_mac/ios/Info.plist"
"proj.ios_mac/ios/targets/ios/Info.plist",
"proj.ios_mac/ios/targets/tvos/Info.plist"
]
}
},
@ -51,12 +52,12 @@
"replace_string": "static cocos2d::Size \\1 = cocos2d::Size(\\3, \\2)"
},
{
"file_path": "proj.ios_mac/ios/Info.plist",
"file_path": "proj.ios_mac/ios/targets/ios/Info.plist",
"pattern": "UIInterfaceOrientationLandscapeRight",
"replace_string": "UIInterfaceOrientationPortrait"
},
{
"file_path": "proj.ios_mac/ios/Info.plist",
"file_path": "proj.ios_mac/ios/targets/ios/Info.plist",
"pattern": "UIInterfaceOrientationLandscapeLeft",
"replace_string": "UIInterfaceOrientationPortraitUpsideDown"
},

View File

@ -55,7 +55,9 @@ static AppDelegate s_sharedApplication;
// Use RootViewController to manage CCEAGLView
_viewController = [[RootViewController alloc] init];
#if !defined(AX_TARGET_OS_TVOS)
_viewController.wantsFullScreenLayout = YES;
#endif
// Set RootViewController to window
if ([[UIDevice currentDevice].systemVersion floatValue] < 6.0)
@ -71,7 +73,9 @@ static AppDelegate s_sharedApplication;
[window makeKeyAndVisible];
#if !defined(AX_TARGET_OS_TVOS)
[[UIApplication sharedApplication] setStatusBarHidden:true];
#endif
// Launching the app with the arguments -NSAllowsDefaultLineBreakStrategy NO to force back to the old behavior.
if ([[UIDevice currentDevice].systemVersion floatValue] >= 13.0f)
@ -80,8 +84,8 @@ static AppDelegate s_sharedApplication;
}
// IMPORTANT: Setting the GLView should be done after creating the RootViewController
axis::GLView* glview = axis::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view);
axis::Director::getInstance()->setOpenGLView(glview);
axis::GLView* glView = axis::GLViewImpl::createWithEAGLView((__bridge void*)_viewController.view);
axis::Director::getInstance()->setOpenGLView(glView);
// run the cocos2d-x game scene
app->run();

View File

@ -54,7 +54,9 @@ customization that is not appropriate for viewDidLoad.
numberOfSamples:axis::GLViewImpl::_multisamplingCount];
// Enable or disable multiple touches
#if !defined(AX_TARGET_OS_TVOS)
[eaglView setMultipleTouchEnabled:NO];
#endif
// Set EAGLView as view of RootViewController
self.view = eaglView;
@ -93,15 +95,15 @@ customization that is not appropriate for viewDidLoad.
{
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
auto glview = axis::Director::getInstance()->getOpenGLView();
auto glView = axis::Director::getInstance()->getOpenGLView();
if (glview)
if (glView)
{
CCEAGLView* eaglview = (__bridge CCEAGLView*)glview->getEAGLView();
CCEAGLView* eaglView = (__bridge CCEAGLView*)glView->getEAGLView();
if (eaglview)
if (eaglView)
{
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
CGSize s = CGSizeMake([eaglView getWidth], [eaglView getHeight]);
axis::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height);
}
}

View File

@ -1,157 +1,158 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-20@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-20@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-29.png",
"scale" : "1x"
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-29@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-29@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-40@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-40@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "Icon-57.png",
"scale" : "1x"
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "Icon-57@2x.png",
"scale" : "2x"
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "Icon-60@3x.png",
"scale" : "3x"
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-20.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-20@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-29.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-29@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-40.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-40@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "Icon-50.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "50x50"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "Icon-50@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "50x50"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "Icon-72.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "72x72"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "Icon-72@2x.png",
"scale" : "2x"
"idiom" : "ipad",
"scale" : "2x",
"size" : "72x72"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-83.5@2x.png",
"scale" : "2x"
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "Icon-83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "Icon-1024.png",
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "0.447",
"green" : "0.282",
"red" : "0.129"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,11 @@
{
"images" : [
{
"idiom" : "tv",
"size" : "1280x768",
"filename" : "icon-0.png"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "Store Assets Generator",
"version" : "0.4.0"
}
}

View File

@ -0,0 +1,17 @@
{
"info" : {
"author" : "Store Assets Generator",
"version" : "0.4.0"
},
"layers" : [
{
"filename" : "Front.imagestacklayer"
},
{
"filename" : "Middle.imagestacklayer"
},
{
"filename" : "Back.imagestacklayer"
}
]
}

View File

@ -0,0 +1,11 @@
{
"images" : [
{
"idiom" : "tv",
"size" : "1280x768",
"filename" : "icon-0.png"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : "0.4.0",
"author" : "Store Assets Generator"
}
}

View File

@ -0,0 +1,11 @@
{
"images" : [
{
"idiom" : "tv",
"size" : "1280x768",
"filename" : "icon-0.png"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "Store Assets Generator",
"version" : "0.4.0"
}
}

View File

@ -0,0 +1,18 @@
{
"images" : [
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "icon-400.png",
"scale" : "1x"
},
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "icon-800.png",
"scale" : "2x"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : "0.4.0",
"author" : "Store Assets Generator"
}
}

View File

@ -0,0 +1,17 @@
{
"info" : {
"version" : "0.4.0",
"author" : "Store Assets Generator"
},
"layers" : [
{
"filename" : "Front.imagestacklayer"
},
{
"filename" : "Middle.imagestacklayer"
},
{
"filename" : "Back.imagestacklayer"
}
]
}

View File

@ -0,0 +1,18 @@
{
"images" : [
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "icon-400.png",
"scale" : "1x"
},
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "icon-800.png",
"scale" : "2x"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : "0.4.0",
"author" : "Store Assets Generator"
}
}

View File

@ -0,0 +1,18 @@
{
"images" : [
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "icon-400.png",
"scale" : "1x"
},
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "icon-800.png",
"scale" : "2x"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : "0.4.0",
"author" : "Store Assets Generator"
}
}

View File

@ -0,0 +1,32 @@
{
"info" : {
"author" : "Store Assets Generator",
"version" : "0.4.0"
},
"assets" : [
{
"filename" : "App Icon - App Store.imagestack",
"role" : "primary-app-icon",
"idiom" : "tv",
"size" : "1280x768"
},
{
"idiom" : "tv",
"filename" : "App Icon.imagestack",
"size" : "400x240",
"role" : "primary-app-icon"
},
{
"size" : "2320x720",
"filename" : "Top Shelf Image Wide.imageset",
"idiom" : "tv",
"role" : "top-shelf-image-wide"
},
{
"role" : "top-shelf-image",
"size" : "1920x720",
"filename" : "Top Shelf Image.imageset",
"idiom" : "tv"
}
]
}

View File

@ -0,0 +1,18 @@
{
"images" : [
{
"size" : "2320x720",
"idiom" : "tv",
"filename" : "icon-2320.png",
"scale" : "1x"
},
{
"size" : "2320x720",
"idiom" : "tv",
"filename" : "icon-4640.png",
"scale" : "2x"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,18 @@
{
"images" : [
{
"size" : "1920x720",
"idiom" : "tv",
"filename" : "icon-1920.png",
"scale" : "1x"
},
{
"size" : "1920x720",
"idiom" : "tv",
"filename" : "icon-3840.png",
"scale" : "2x"
}
],
"author" : "Store Assets Generator",
"version" : "0.4.0"
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PROJECT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PROJECT_NAME}</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UIAppFonts</key>
<array/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019. All rights reserved.</string>
</dict>
</plist>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="20037" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="appleTV" appearance="light"/>
<dependencies>
<deployment identifier="tvOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="1yf-Ni-PHo"/>
<viewControllerLayoutGuide type="bottom" id="b0w-RK-sP3"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="LaunchScreenBackground" translatesAutoresizingMaskIntoConstraints="NO" id="WLf-yP-saP">
<rect key="frame" x="0.0" y="0.0" width="1920" height="1080"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="wu6-TO-1qx"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-32" y="-4"/>
</scene>
</scenes>
<resources>
<image name="LaunchScreenBackground" width="2208" height="1242"/>
</resources>
</document>

View File

@ -113,11 +113,21 @@ elseif(APPLE)
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.h
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreen.storyboard
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Images.xcassets
if (TVOS)
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/targets/tvos/LaunchScreen.storyboard
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/targets/tvos/Images.xcassets
)
else()
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/targets/ios/LaunchScreen.storyboard
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/targets/ios/Images.xcassets
)
endif()
list(APPEND GAME_SOURCE
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/main.m
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.mm
@ -178,8 +188,13 @@ if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES
LINK_FLAGS "-pagezero_size 10000 -image_base 100000000"
)
elseif(TVOS)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/targets/tvos/Info.plist")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "Brand Assets")
set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "")
set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer")
elseif(IOS)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Info.plist")
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/targets/ios/Info.plist")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "")
set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer")

Some files were not shown because too many files have changed in this diff Show More