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

@ -5,7 +5,7 @@ on:
paths-ignore: paths-ignore:
- '**.md' - '**.md'
- 'docs/**' - 'docs/**'
env: env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release BUILD_TYPE: Release
@ -98,7 +98,7 @@ jobs:
run: | run: |
tools/unix-ci/before-install.sh tools/unix-ci/before-install.sh
tools/unix-ci/run-script.sh tools/unix-ci/run-script.sh
build-ios: build-ios:
name: build-ios name: build-ios
runs-on: macos-latest runs-on: macos-latest
@ -118,3 +118,23 @@ jobs:
run: | run: |
tools/unix-ci/before-install.sh tools/unix-ci/before-install.sh
tools/unix-ci/run-script.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

368
AUTHORS
View File

@ -40,7 +40,7 @@ Windows Platforms Developers (Collaborators from Microsoft):
Community Evangelism / Programmers Guide Author: Community Evangelism / Programmers Guide Author:
Jason Slack-Moehrle (slackmoehrle) Jason Slack-Moehrle (slackmoehrle)
Developers: Developers:
halx99(Guo Xiaodong) halx99(Guo Xiaodong)
Add ETC1 builtin alpha support. Add ETC1 builtin alpha support.
@ -48,43 +48,43 @@ Developers:
Add script with utf-8 bom support for luabindings. Add script with utf-8 bom support for luabindings.
Add captureNode for cocos2d::utils. Add captureNode for cocos2d::utils.
fix AudioEngine bug for iOS, UTF8 filePath. fix AudioEngine bug for iOS, UTF8 filePath.
Rolando Abarca Rolando Abarca
Javascript Binding and testjs Javascript Binding and testjs
Squallium Squallium
Added ccFPSImages entity as linked resource on linux eclipse project setting. Added ccFPSImages entity as linked resource on linux eclipse project setting.
Added CocosDenshion dependency to libextension project for eclipse project of linux. Added CocosDenshion dependency to libextension project for eclipse project of linux.
longlene longlene
Improve android project creation script Improve android project creation script
reneklacan reneklacan
Hardware keyboard support Hardware keyboard support
liuyq liuyq
CCTextureAtlas::updateQuad modify for the memcpy hot spot. CCTextureAtlas::updateQuad modify for the memcpy hot spot.
frranck frranck
adding norwegian language adding norwegian language
Added "a unsupport image format!" log when creating a sprite in CCImage.cpp. Added "a unsupport image format!" log when creating a sprite in CCImage.cpp.
varlucian varlucian
fix the bug that OnEnterTransitionDidFinish was called twice when a node is added in onEnter. fix the bug that OnEnterTransitionDidFinish was called twice when a node is added in onEnter.
carlomorgantinizynga carlomorgantinizynga
CCLabelTTF supports for shadow and stroke CCLabelTTF supports for shadow and stroke
Adding CCLabelTTF::createWithFontDefinition. Adding CCLabelTTF::createWithFontDefinition.
New label support. New label support.
James Gregory (j4m3z0r, Zynga) James Gregory (j4m3z0r, Zynga)
Maintainer of Emscripten port. Maintainer of Emscripten port.
Initial Emscripten port. Initial Emscripten port.
Use browser font rendering instead of FreeType. Use browser font rendering instead of FreeType.
Add destructor to CCGLBufferedNode. Add destructor to CCGLBufferedNode.
Asynchronous Image loading for Emscripten Asynchronous Image loading for Emscripten
DarraghCoy DarraghCoy
Fixed a potential crash SimpleAudioEngineOpenSL::playEffect Fixed a potential crash SimpleAudioEngineOpenSL::playEffect
Fixed some bugs with Set class Fixed some bugs with Set class
@ -100,7 +100,7 @@ Developers:
Fixed potential crashes in EventDispatch while using SceneGraphPriroity listeners and added helper function to check it Fixed potential crashes in EventDispatch while using SceneGraphPriroity listeners and added helper function to check it
Fixed a protential crash in EventDispatch while unregistering listener right after it was registered Fixed a protential crash in EventDispatch while unregistering listener right after it was registered
Adding an extra verification in Node's destructor Adding an extra verification in Node's destructor
Added RefPtr<T> smart pointer support Added RefPtr<T> smart pointer support
silverscania silverscania
Pass correct parameter to glPixelStorei when creating a texture Pass correct parameter to glPixelStorei when creating a texture
@ -132,7 +132,7 @@ Developers:
Implemented pitch, pan and gain. Implemented pitch, pan and gain.
Using SDL backend instead of glfw for Linux. Using SDL backend instead of glfw for Linux.
savdalion savdalion
Added example for russian language in TestCpp Added example for russian language in TestCpp
Added const modifier for classes CCArray, CCObject Added const modifier for classes CCArray, CCObject
Deprecated method fixes Deprecated method fixes
@ -571,15 +571,15 @@ Developers:
Xander84 Xander84
Fixing a bug in CCBValue::getByteValue. Fixing a bug in CCBValue::getByteValue.
smshuja smshuja
Fixing a bug that pointQueryFirst returns invalid Shape when a shape is not found in JSB. Fixing a bug that pointQueryFirst returns invalid Shape when a shape is not found in JSB.
Fixing a bug that New PivotJoint can't access 4 parameters like in html5 version. Fixing a bug that New PivotJoint can't access 4 parameters like in html5 version.
Fixing a bug that Pivotjoint constructor and pointQueryFirst in Space class will return false instead of invalid shape object. Fixing a bug that Pivotjoint constructor and pointQueryFirst in Space class will return false instead of invalid shape object.
Carsten Sandtner (casarock) Carsten Sandtner (casarock)
Adding XMLHttpRequest support for JSB. Adding XMLHttpRequest support for JSB.
Lee, Jae-Hong (pyrasis) Lee, Jae-Hong (pyrasis)
Maintainer of tizen port. Maintainer of tizen port.
localStorageGetItem crashes when column text is NULL. localStorageGetItem crashes when column text is NULL.
@ -587,10 +587,10 @@ Developers:
lumendes lumendes
Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386. Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386.
sunxiaoyu sunxiaoyu
Refactoring CCEditBox to add UITextField only when keyboard was opened, remove it when keyboard was closed. Refactoring CCEditBox to add UITextField only when keyboard was opened, remove it when keyboard was closed.
edwardzhou (Edward Zhou) edwardzhou (Edward Zhou)
Correcting the type detecting order for Lua CCBProxy::getNodeTypeName. Correcting the type detecting order for Lua CCBProxy::getNodeTypeName.
Casting variables to their own type, and print warning info if no corresponding lua callback function instead of crash. Casting variables to their own type, and print warning info if no corresponding lua callback function instead of crash.
@ -601,77 +601,77 @@ Developers:
musikov musikov
Fixing a bug that missing precision when getting strokeColor and fontFillColor Fixing a bug that missing precision when getting strokeColor and fontFillColor
added Turkish and Ukrainian language support added Turkish and Ukrainian language support
hawkwood (Justin Hawkwood) hawkwood (Justin Hawkwood)
Fixing a bug that EditBox doesn't show any text if it's initialized with text. Fixing a bug that EditBox doesn't show any text if it's initialized with text.
Fixed a memory leak in new Audio. Fixed a memory leak in new Audio.
wtyqm (zhang peng) wtyqm (zhang peng)
Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes. Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes.
smilingpoplar (YangLe) smilingpoplar (YangLe)
Fixing a bug that CCScale9Sprite doesn't support rotated spriteframe in atlas. Fixing a bug that CCScale9Sprite doesn't support rotated spriteframe in atlas.
xxuejie xxuejie
Add namespace prefix to selector macros Add namespace prefix to selector macros
hannon235 (Chris) hannon235 (Chris)
Fixing a bug that the submenu of ExtensionTest in TestCpp can't scroll. Fixing a bug that the submenu of ExtensionTest in TestCpp can't scroll.
Implements a socket.io client extension and adds a test case. Implements a socket.io client extension and adds a test case.
Implements 'SIODelegate::fireEventToScript' method to integrate JSB event handling with the original native code. Implements 'SIODelegate::fireEventToScript' method to integrate JSB event handling with the original native code.
Update socket.io network extension to correctly detect and manage connection to socket.io server versions 0.9.x-1.x Update socket.io network extension to correctly detect and manage connection to socket.io server versions 0.9.x-1.x
pktangyue pktangyue
Fixing a bug that CCScale9Sprite::setInsetLeft/XXX can't work for rotated sprite frame. Fixing a bug that CCScale9Sprite::setInsetLeft/XXX can't work for rotated sprite frame.
Fixing a bug that Color and Opacity of Scale9Sprite will not be changed when it's added to NodeRGBA and run with FadeIn/Out actions. Fixing a bug that Color and Opacity of Scale9Sprite will not be changed when it's added to NodeRGBA and run with FadeIn/Out actions.
Adding *.xccheckout to gitignore. Adding *.xccheckout to gitignore.
jllust jllust
Fixing a bug that CCLabelBMFont crashes in glDrawElements of CCTextureAtlas::drawNumberOfQuads sometimes. Fixing a bug that CCLabelBMFont crashes in glDrawElements of CCTextureAtlas::drawNumberOfQuads sometimes.
Sam Gross (colesbury) Sam Gross (colesbury)
Ignoring formatting specifiers in JavaScript log messages. Ignoring formatting specifiers in JavaScript log messages.
Make bindings-generator supports to bind std::function argument. Make bindings-generator supports to bind std::function argument.
James Munro (jdmunro) James Munro (jdmunro)
Added JSB support for ccpDistanceSQ. Added JSB support for ccpDistanceSQ.
Rafael (rafaelx) Rafael (rafaelx)
A warning fix of AL_INVALID_NAME and AL_INVALID_OPERATION in SimpleAudioEngineOpenAL.cpp. A warning fix of AL_INVALID_NAME and AL_INVALID_OPERATION in SimpleAudioEngineOpenAL.cpp.
metalbass metalbass
Fixing an issue that sigslot::_connection_base# (from 0 to 8) don't have virtual destructors. Fixing an issue that sigslot::_connection_base# (from 0 to 8) don't have virtual destructors.
thp thp
Port Cocos2D-X to Qt 5 Port Cocos2D-X to Qt 5
Nako Sung (nakosung) Nako Sung (nakosung)
Fixing a bug that wrong logic when pass an empty std::vector to WebSocket::init. Fixing a bug that wrong logic when pass an empty std::vector to WebSocket::init.
Exposing cc.RemoveSelf to JS. Exposing cc.RemoveSelf to JS.
exposed AssetsManager to javascript and added multiple-assetsManager support exposed AssetsManager to javascript and added multiple-assetsManager support
dotsquid dotsquid
Fixed the crash caused by improper deletion of VBOs and VAO in ParticleSystemQuad. Fixed the crash caused by improper deletion of VBOs and VAO in ParticleSystemQuad.
maciekczwa maciekczwa
Fixing a bug that stroke color with channel color values other than 255 doesn't take effect on android. Fixing a bug that stroke color with channel color values other than 255 doesn't take effect on android.
zcgit zcgit
a potential bug fix in Layer::init. a potential bug fix in Layer::init.
gkosciolek gkosciolek
Fixing a bug that observers with the same target and name but different sender are the same observer in NotificationCenter. Fixing a bug that observers with the same target and name but different sender are the same observer in NotificationCenter.
xbruce xbruce
Fixing a bug that crash appears when extending cc.ScrollView in JS. Fixing a bug that crash appears when extending cc.ScrollView in JS.
Fixing a bug that cc.registerTargettedDelegate doesn't support pure js object as its target. Fixing a bug that cc.registerTargettedDelegate doesn't support pure js object as its target.
elwinarens (Elwin Arens) elwinarens (Elwin Arens)
Minor spelling changes in description of CCScene.h Minor spelling changes in description of CCScene.h
signmotion (Andrey Syrokomsky) signmotion (Andrey Syrokomsky)
Fixed some compiling-warnings (MSVC2012). Fixed some compiling-warnings (MSVC2012).
michaelcontento michaelcontento
[Android] use onWindowFocusChanged(bool) instead of onResume()/onPause() [Android] use onWindowFocusChanged(bool) instead of onResume()/onPause()
Prevent nullptr access in AssetsManager Prevent nullptr access in AssetsManager
@ -680,7 +680,7 @@ Developers:
Android: add xlargeScreens="true" to supports-screens Android: add xlargeScreens="true" to supports-screens
Trigger onKeyReleased only after the key has been released. Trigger onKeyReleased only after the key has been released.
Makes Colors are now comparable and explicit convertible Makes Colors are now comparable and explicit convertible
bmanGH bmanGH
Used gl caching functions in TexturePVR::createGLTexture() Used gl caching functions in TexturePVR::createGLTexture()
Configuration of VAO in runtime Configuration of VAO in runtime
@ -688,15 +688,15 @@ Developers:
Fixed a bug that object which isn't in Vector would also be released when invoking Vector::eraseObject. Fixed a bug that object which isn't in Vector would also be released when invoking Vector::eraseObject.
Fixed a bug that Timer::cancel always call Director::getInstance()->getScheduler() even in another Scheduler. Fixed a bug that Timer::cancel always call Director::getInstance()->getScheduler() even in another Scheduler.
Fix crash if label's type is STRING_TEXTURE and label->sortAllChildren is called Fix crash if label's type is STRING_TEXTURE and label->sortAllChildren is called
metadao metadao
make create_project.py more pythonic and fix some typoes make create_project.py more pythonic and fix some typoes
timothyqiu timothyqiu
Project creator: use absolute path for json config files Project creator: use absolute path for json config files
Documentation fixes Documentation fixes
A better way to locate project creator A better way to locate project creator
rablwupei rablwupei
Fixed a memory leak in ScriptingCore::runScript() Fixed a memory leak in ScriptingCore::runScript()
Fixed a memory leak in Spine. Fixed a memory leak in Spine.
@ -704,26 +704,26 @@ Developers:
Fixed a bug that sys.localStorage.getItem() does not support non-ascii string. Fixed a bug that sys.localStorage.getItem() does not support non-ascii string.
Fixed a memory leak in XMLHttpRequest. Fixed a memory leak in XMLHttpRequest.
Fixed a bug that wrong convention to jsval in cccolor4f_to_jsval and cccolor3b_to_jsval. Fixed a bug that wrong convention to jsval in cccolor4f_to_jsval and cccolor3b_to_jsval.
Keita Obo (ktaobo) Keita Obo (ktaobo)
Avoid unnecessary object duplication for Scale9Sprite. Avoid unnecessary object duplication for Scale9Sprite.
jimmystar jimmystar
Fixed a bug that cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device. Fixed a bug that cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device.
XiaoLongHan (kpkhxlgy0) XiaoLongHan (kpkhxlgy0)
Fixed a bug that outside of keyboard can't be responded to close keyboard when using EditBox. Fixed a bug that outside of keyboard can't be responded to close keyboard when using EditBox.
lettas lettas
A fix for multi-platform template. A fix for multi-platform template.
HoGarfield (garfield_ho) HoGarfield (garfield_ho)
Fixed a bug that CCBReader can't play sequence automatically in JSB. Fixed a bug that CCBReader can't play sequence automatically in JSB.
Could not set next animation in CCBAnimationCompleted callback. Could not set next animation in CCBAnimationCompleted callback.
Fixed missing to add JSAutoCompartment when invoking JS functions from C++. Fixed missing to add JSAutoCompartment when invoking JS functions from C++.
CCBReader: To set anchor point to 0,0 when created by loader. CCBReader: To set anchor point to 0,0 when created by loader.
Potential crash when websocket connection closes. Potential crash when websocket connection closes.
lite3 lite3
Fixed a bug that Node's anchor point was changed after being added to ScrollView. Fixed a bug that Node's anchor point was changed after being added to ScrollView.
Added HttpClient::sendImmediate() Added HttpClient::sendImmediate()
@ -731,105 +731,105 @@ Developers:
Replace dynamic_cast to std::is_base_of in object_to_luaval Replace dynamic_cast to std::is_base_of in object_to_luaval
Added support normalize path on android Added support normalize path on android
FileUtils: Remove old path while adding existing search path FileUtils: Remove old path while adding existing search path
superrad superrad
Clear NoSuchMethodError Exception when JniHelper fails to find methodID Clear NoSuchMethodError Exception when JniHelper fails to find methodID
Nite Luo (darkdukey) Nite Luo (darkdukey)
Added Mouse Support For Desktop Platforms. Added Mouse Support For Desktop Platforms.
ledyba ledyba
Fixed a bug that EventListeners can't be removed sometimes. Fixed a bug that EventListeners can't be removed sometimes.
Fixed a bug that the data size has to be specified when parsing XML using TinyXML. Fixed a bug that the data size has to be specified when parsing XML using TinyXML.
Closed X display after getting DPI on Linux. Closed X display after getting DPI on Linux.
Luis Parravicini (luisparravicini) Luis Parravicini (luisparravicini)
Fixed typos in create_project.py. Fixed typos in create_project.py.
xhcnb xhcnb
Device::setAccelerometerEnabled needs to be invoked before adding ACC listener. Device::setAccelerometerEnabled needs to be invoked before adding ACC listener.
Fixed a bug that it will get wrong custom properties when use different count custom properties in CocosBuilder. Fixed a bug that it will get wrong custom properties when use different count custom properties in CocosBuilder.
Correct TotalTime of ActionObject Correct TotalTime of ActionObject
bopohaa bopohaa
Fixed a bug that Webp test crashes. Fixed a bug that Webp test crashes.
lajos lajos
FontTest isn't rendered correctly with custom TTF font on Mac platform. FontTest isn't rendered correctly with custom TTF font on Mac platform.
hulefei hulefei
Added gui namespace before SEL_TouchEvent. Added gui namespace before SEL_TouchEvent.
zhiqiangxu zhiqiangxu
Fixed a logic error in ControlUtils::RectUnion. Fixed a logic error in ControlUtils::RectUnion.
Fixed an issue that there is an useless conversion in ScrollView::onTouchBegan. Fixed an issue that there is an useless conversion in ScrollView::onTouchBegan.
Deleted several lines of useless code in ScrollView::deaccelerateScrolling. Deleted several lines of useless code in ScrollView::deaccelerateScrolling.
Fixed that ScrollView should implement ActionTweenDelegate. Fixed that ScrollView should implement ActionTweenDelegate.
Fixed LabelBMFont::getBoundingBox() position error Fixed LabelBMFont::getBoundingBox() position error
yinkaile (2youyouo2) yinkaile (2youyouo2)
Maintainer of Armature Bone Animation. Maintainer of Armature Bone Animation.
dmurtagh dmurtagh
Fixed a bug that UserDefault::getDoubleForKey() doesn't pass default value to Java. Fixed a bug that UserDefault::getDoubleForKey() doesn't pass default value to Java.
Fixed a compile error when CC_SPRITE_DEBUG_DRAW is on Fixed a compile error when CC_SPRITE_DEBUG_DRAW is on
seobyeongky seobyeongky
Updates spine runtime. Updates spine runtime.
Fixed a potential bug in Data's copy constructor. Fixed a potential bug in Data's copy constructor.
Fixed the bug that MotionStreak can not work with MoveTo and MoveBy Fixed the bug that MotionStreak can not work with MoveTo and MoveBy
Fixed a bug that HttpAsynConnection can not get error content if response code less than 200 or response code greater or equal than 300 Fixed a bug that HttpAsynConnection can not get error content if response code less than 200 or response code greater or equal than 300
luocker luocker
Fix a bug that string itself is also modified in `String::componentsSeparatedByString`. Fix a bug that string itself is also modified in `String::componentsSeparatedByString`.
omersaeed omersaeed
Fix a bug that game will crash if connection breaks during download using AssetManager. Fix a bug that game will crash if connection breaks during download using AssetManager.
SBKarr SBKarr
AngelCode binary file format support for LabelBMFont. AngelCode binary file format support for LabelBMFont.
zarelaky zarelaky
OpenAL context isn't destroyed correctly on mac and ios. OpenAL context isn't destroyed correctly on mac and ios.
kicktheken (Kenneth Chan) kicktheken (Kenneth Chan)
Fixed a bug that the setBlendFunc method of some classes wasn't exposed to LUA. Fixed a bug that the setBlendFunc method of some classes wasn't exposed to LUA.
Fix lua project template crash on iOS5.1 device Fix lua project template crash on iOS5.1 device
Fix layout constant syntax error in lua-binding Fix layout constant syntax error in lua-binding
zilongshanren zilongshanren
Fixed a bug that missing to check self assignment of Vector<T>, Map<K,V>, Value and String. Fixed a bug that missing to check self assignment of Vector<T>, Map<K,V>, Value and String.
Fixed a bug that move assignment operator doesn't clear previous content bug. Fixed a bug that move assignment operator doesn't clear previous content bug.
Fixed the compile error of Map's getRandomObject. Fixed the compile error of Map's getRandomObject.
daltomi daltomi
Fixed a typo in Director class. Fixed a typo in Director class.
Removed an unnecessary boolean flag in CCFontAtlasCache.cpp. Removed an unnecessary boolean flag in CCFontAtlasCache.cpp.
Used 'cbegin/cend', 'const std::string' where it's reasonable. Used 'cbegin/cend', 'const std::string' where it's reasonable.
v1ctor v1ctor
ControlSlider supports to set selected thumb sprite. ControlSlider supports to set selected thumb sprite.
ControlButton supports to set scale ratio of touchdown state ControlButton supports to set scale ratio of touchdown state
akof1314 akof1314
TestCpp works by using CMake and mingw on Windows. TestCpp works by using CMake and mingw on Windows.
Pisces000221 Pisces000221
Corrected a few mistakes in the README file of project-creator. Corrected a few mistakes in the README file of project-creator.
Corrected a mistake in README. Corrected a mistake in README.
Fixed a bug that a string which only contains CJK characters can't make a line-break when it's needed. Fixed a bug that a string which only contains CJK characters can't make a line-break when it's needed.
Fixed a bug that if the UISlider is faded, the slide ball won't fade together Fixed a bug that if the UISlider is faded, the slide ball won't fade together
hbbalfred hbbalfred
Fixed a bug that crash if file doesn't exist when using FileUtils::getStringFromFile. Fixed a bug that crash if file doesn't exist when using FileUtils::getStringFromFile.
Fixed a bug that cc.BuilderReader.load( path, null, parentSize ); was not allowed. Fixed a bug that cc.BuilderReader.load( path, null, parentSize ); was not allowed.
liang8305 liang8305
Use multiple processes according the number of cores to build android project Use multiple processes according the number of cores to build android project
pandamicro pandamicro
Exposed SAXParser to JS, it is used for parsing XML in JS. Exposed SAXParser to JS, it is used for parsing XML in JS.
hanjukim hanjukim
Fixed a bug that color and opacity settings were not applied when invoking Label::alignText. Fixed a bug that color and opacity settings were not applied when invoking Label::alignText.
Fixed the bug that FileUtils:getStringFromFile() may return a unterminated string Fixed the bug that FileUtils:getStringFromFile() may return a unterminated string
@ -838,38 +838,38 @@ Developers:
bagobor bagobor
Fixed a memory leak in AssetsManager::uncompress. Fixed a memory leak in AssetsManager::uncompress.
Code format fix and small optimizations in cocostudio/CCActionNode.cpp. Code format fix and small optimizations in cocostudio/CCActionNode.cpp.
ucchen ucchen
Exposed the missing data structures of Spine to JS. Exposed the missing data structures of Spine to JS.
justmao945 justmao945
Corrected the definition of CMake variables. Corrected the definition of CMake variables.
maksqwe maksqwe
Fixed string size check in BitmapDC::utf8ToUtf16 on win32 and assert condition in TriggerMng. Fixed string size check in BitmapDC::utf8ToUtf16 on win32 and assert condition in TriggerMng.
wefiends wefiends
s3tc compressed textures with no mipmaps fail to be loaded. s3tc compressed textures with no mipmaps fail to be loaded.
Added createWithFullscreen overloaded method that sets video mode Added createWithFullscreen overloaded method that sets video mode
floatinghotpot floatinghotpot
Fixed a bug that no callback is invoked when websocket connection fails Fixed a bug that no callback is invoked when websocket connection fails
Linghui Linghui
Updated README of template: fix wrong platform java path. Updated README of template: fix wrong platform java path.
seemk seemk
Fixed crash if invoking Director::end() on WINDOWS. Fixed crash if invoking Director::end() on WINDOWS.
odedsh odedsh
Fixed a bug that loading custom fonts from ttf file fails on windows. Fixed a bug that loading custom fonts from ttf file fails on windows.
Wilhansen Wilhansen
Fixed a bug that spine::Skeleton would not be updated after re-adding to scene. Fixed a bug that spine::Skeleton would not be updated after re-adding to scene.
huangml huangml
Fixed a bug that Node::removeAllChildrenWithCleanup() does not remove PhysicsBody. Fixed a bug that Node::removeAllChildrenWithCleanup() does not remove PhysicsBody.
newnon newnon
Adds getCurrentLanguageCode() which returns iso 639-1 language code. Adds getCurrentLanguageCode() which returns iso 639-1 language code.
Adds support for get response when Activity's onActivityResult is triggered. Adds support for get response when Activity's onActivityResult is triggered.
@ -893,31 +893,31 @@ Developers:
youknowone youknowone
Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView Adds iOS-like elastic bounceback support for cocos2d::extension::ScrollView
aeonmine aeonmine
Fixed ActionObject memory leak in ActionManagerEx::initWithDictionary Fixed ActionObject memory leak in ActionManagerEx::initWithDictionary
Fixed memory leak in cocos studiov2.0 reader Fixed memory leak in cocos studiov2.0 reader
LoungeKatt LoungeKatt
Corrected a mistake of building android project in README.md Corrected a mistake of building android project in README.md
flashjay flashjay
Remove deprecated code in lua tests & template Remove deprecated code in lua tests & template
luaLoadChunksFromZip should just remove .lua or .luac extension luaLoadChunksFromZip should just remove .lua or .luac extension
zukkun zukkun
Fixed incorrect function invocation in PhysicsBody::setAngularVelocityLimit Fixed incorrect function invocation in PhysicsBody::setAngularVelocityLimit
dbaack dbaack
Fixed a bug that removing and re-adding an event listener will trigger assert Fixed a bug that removing and re-adding an event listener will trigger assert
zakmandhro zakmandhro
A typo fix in RELEASE_NOTES.md A typo fix in RELEASE_NOTES.md
mgcL mgcL
A potential memory leak fix in value's default constructor A potential memory leak fix in value's default constructor
Added ScriptHandlerMgr::destroyInstance to avoid memory leak Added ScriptHandlerMgr::destroyInstance to avoid memory leak
Mazyod Mazyod
Fixed a bug that HTTPClient reports 2xx status codes as errors Fixed a bug that HTTPClient reports 2xx status codes as errors
Added missing Text Font and Placeholder feature of EditBox for Mac platform Added missing Text Font and Placeholder feature of EditBox for Mac platform
@ -926,7 +926,7 @@ Developers:
Fix a bug that can not get/set text in password mode on Mac OS X Fix a bug that can not get/set text in password mode on Mac OS X
Make sure TableView parents are visible before handling touch Make sure TableView parents are visible before handling touch
Fixed memory leak in HttpRequest Fixed memory leak in HttpRequest
iSevenDays iSevenDays
Fixed a bug that the result of 'malloc' is incompatible with type 'unsigned char *' in Image::saveImageToPNG Fixed a bug that the result of 'malloc' is incompatible with type 'unsigned char *' in Image::saveImageToPNG
Fixed a potential memory leak in CCEditBoxImplIOS.mm Fixed a potential memory leak in CCEditBoxImplIOS.mm
@ -935,75 +935,75 @@ Developers:
Fixed loosing precision when using 'recv' in 'Console' Fixed loosing precision when using 'recv' in 'Console'
Fixed link error with Xcode 6 when building with 32-bit architecture Fixed link error with Xcode 6 when building with 32-bit architecture
Fixed CMake for Mac OS X Fixed CMake for Mac OS X
ololomax ololomax
Fixed a potential crash in SceneReader::createNodeWithSceneFile Fixed a potential crash in SceneReader::createNodeWithSceneFile
gaoxiaosong gaoxiaosong
Fixed a warning in cpCollision.c Fixed a warning in cpCollision.c
sachingarg05 sachingarg05
Re-added orientation change callback in java activity Re-added orientation change callback in java activity
GLProgram should not abort() if shader compilation fails, returning false is better. GLProgram should not abort() if shader compilation fails, returning false is better.
dplusic dplusic
Fixed that cc.pGetAngle may return wrong value Fixed that cc.pGetAngle may return wrong value
zifter zifter
Fixed a bug that the effect of particle loaded from CocosBuilder is incorrectly Fixed a bug that the effect of particle loaded from CocosBuilder is incorrectly
Fix twice calling onExit Fix twice calling onExit
Fixed bug with cascade opacity and color for control button Fixed bug with cascade opacity and color for control button
Fix Progress Action. Not working with charging from 100 to 0. Fix Progress Action. Not working with charging from 100 to 0.
twhittock twhittock
Fixed a bug that Application::run returns wrong value on Mac platform Fixed a bug that Application::run returns wrong value on Mac platform
asmodehn asmodehn
Added SDK / NDK detection based on PATH in Setup.py Added SDK / NDK detection based on PATH in Setup.py
myourys myourys
Make cpp template support Eclipse c++ project Make cpp template support Eclipse c++ project
NatWeiss NatWeiss
Fix compilation error using arch i386 Fix compilation error using arch i386
Fixed debug-config crash if a FrameBuffer has no RenderTargetDepthStencil. Fixed debug-config crash if a FrameBuffer has no RenderTargetDepthStencil.
favorcode favorcode
Correct some doxygen comment Correct some doxygen comment
asuuma asuuma
Fix Repeat will run one more over in rare situations. Fix Repeat will run one more over in rare situations.
uqtimes uqtimes
Fix NSNotificationCenter and NSTimer leaks Fix NSNotificationCenter and NSTimer leaks
ntotani ntotani
fix building error in lua-binding in release mode fix building error in lua-binding in release mode
Fixed WebView lua-bind method name. Fixed WebView lua-bind method name.
kezhuw kezhuw
AutoReleasePool manager improvement AutoReleasePool manager improvement
Fixed a bug that condition variable sleep on unrelated mutex in HttpClient Fixed a bug that condition variable sleep on unrelated mutex in HttpClient
zhouxiaoxiaoxujian zhouxiaoxiaoxujian
Added TextField::getStringLength() Added TextField::getStringLength()
Add shadow, outline, glow filter support for UIText Add shadow, outline, glow filter support for UIText
Fix UITextField IME can't auto detach Fix UITextField IME can't auto detach
Add getChildByName method for get a node that can be cast to Type T Add getChildByName method for get a node that can be cast to Type T
Improvement ImageViewReader don't necessary loadTexture when imageFilePath is empty Improvement ImageViewReader don't necessary loadTexture when imageFilePath is empty
QiuleiWang QiuleiWang
Fix the bug that calculated height of multi-line string was incorrect on iOS Fix the bug that calculated height of multi-line string was incorrect on iOS
Rumist Rumist
Fix the bug that the result of Director->convertToUI() is error. Fix the bug that the result of Director->convertToUI() is error.
kyokomi kyokomi
Fix the bug that UIButton doesn't support TTF font Fix the bug that UIButton doesn't support TTF font
Fix a bug of TextReader Fix a bug of TextReader
Fix a bug that UITextField doesn't support TTF font Fix a bug that UITextField doesn't support TTF font
Setted contentSize in CSLoader Setted contentSize in CSLoader
gin0606 gin0606
Add a new line at the end of a file Add a new line at the end of a file
Fix a bug that crash happened when try to remove videoView(STATE_PLAYBACK_COMPLETED) in android Fix a bug that crash happened when try to remove videoView(STATE_PLAYBACK_COMPLETED) in android
@ -1011,127 +1011,127 @@ Developers:
Fix iOS VideoPlayer memory leak Fix iOS VideoPlayer memory leak
Added c++11 random library support Added c++11 random library support
Added WebView widget which supports iOS and Android Added WebView widget which supports iOS and Android
billtt billtt
Fixed a bug that Node::setScale(float) may not work properly Fixed a bug that Node::setScale(float) may not work properly
network: Fixed a problem where WebSocket messages may pile up network: Fixed a problem where WebSocket messages may pile up
Teivaz Teivaz
Custom uniform search optimization Custom uniform search optimization
Fixed compiling error on WP8. Fixed compiling error on WP8.
Added method for custom precompiled shader program loading on WP8 Added method for custom precompiled shader program loading on WP8
Enable screen orientation change handling on WP8 Enable screen orientation change handling on WP8
Enabled GLProgramState restoring on render recreated on WP8 Enabled GLProgramState restoring on render recreated on WP8
chareice chareice
Make `setup.py` work on zsh Make `setup.py` work on zsh
taug taug
Could add seach path and resolution order path in front. Could add seach path and resolution order path in front.
CaiCQ CaiCQ
Fix a but that LabelTTF may lost chinese characters on linux Fix a but that LabelTTF may lost chinese characters on linux
chenguangqi chenguangqi
Fixed a compiling error on Android Fixed a compiling error on Android
Fixed an error when importing project using Eclipse on Android Fixed an error when importing project using Eclipse on Android
uorbe001 uorbe001
Allow setting bundle to use in file utils on iOS and Mac OS X Allow setting bundle to use in file utils on iOS and Mac OS X
yongkangchen 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 Fixed a bug that Label::setTextColor does not have any effect on Mac OS X
wagulu wagulu
Fixed a bug that particle effect is wrong when scaled Fixed a bug that particle effect is wrong when scaled
reckhou reckhou
Optimize FPS control on Android Optimize FPS control on Android
dzl-ian dzl-ian
Added getter and setter for TextColor for UIText Added getter and setter for TextColor for UIText
zii zii
Added utils::gettime() Added utils::gettime()
takaken1994 takaken1994
Added function for setting min/max scale for ScrollView Added function for setting min/max scale for ScrollView
studio: Removed "using namespace cocos2d" from CCFrame.h studio: Removed "using namespace cocos2d" from CCFrame.h
maltium maltium
Added 3D rotation support to RotateTo action Added 3D rotation support to RotateTo action
Hamken100per Hamken100per
Added a function getAssetManager() on CCFileUtilsAndroid Added a function getAssetManager() on CCFileUtilsAndroid
rny rny
Fixed LabelTTF::getBoundingBox() position error Fixed LabelTTF::getBoundingBox() position error
SpriteFrameCache load from plist file content data SpriteFrameCache load from plist file content data
AppleJDay AppleJDay
Add Feature:EventMouse should support getDelta, getDeltaX, getDeltaY functions Add Feature:EventMouse should support getDelta, getDeltaX, getDeltaY functions
GavinThornton GavinThornton
Fixed a bug that when a sprite added into SpriteBatchNod it will turn black if setting opacity Fixed a bug that when a sprite added into SpriteBatchNod it will turn black if setting opacity
DavidPartouche DavidPartouche
Fixed the bug that video player not showing on iOS if it's not in FullScreen mode Fixed the bug that video player not showing on iOS if it's not in FullScreen mode
zaWasp zaWasp
Added support for applicationDidEnterBackground / applicationWillEnterForeground on win32 Added support for applicationDidEnterBackground / applicationWillEnterForeground on win32
xiangxw xiangxw
Fixed the bug that Console::sendPrompt() will send extra `\0` Fixed the bug that Console::sendPrompt() will send extra `\0`
kaishiqi kaishiqi
Fixed a but that cursor postion is wrong on desktop. Fixed a but that cursor postion is wrong on desktop.
jagd jagd
Added setSubsteps() and getSubsteps() in PhysicsWorld Added setSubsteps() and getSubsteps() in PhysicsWorld
denpen denpen
Fixed a bug that scroll view hidden picks up the touch events. Fixed a bug that scroll view hidden picks up the touch events.
joewan joewan
Fixed memory leak when use menu_selector Fixed memory leak when use menu_selector
zhongfq zhongfq
Optimize decompress jpg data Optimize decompress jpg data
Fixed memory leak of TextureCache::reloadTexture() Fixed memory leak of TextureCache::reloadTexture()
wohaaitinciu wohaaitinciu
WebView support on windows. WebView support on windows.
Fix a fatal bug in EditBox implement for platform win32. Fix a fatal bug in EditBox implement for platform win32.
guykogus guykogus
Implemented Application::openUrl for WP8 and WinRT Implemented Application::openUrl for WP8 and WinRT
tttreal tttreal
Fixed Label::getStringNumLines() Fixed Label::getStringNumLines()
hongliang-goudou hongliang-goudou
Fixed the bug that UI animation playing crash if GUI JSON file is loaded again Fixed the bug that UI animation playing crash if GUI JSON file is loaded again
yestein yestein
Add Cocostudio Armature getOffsetPoints API for Lua Add Cocostudio Armature getOffsetPoints API for Lua
coldfog coldfog
Fix bug that ActionManagerEx::initWithBinary can only load one UI animation Fix bug that ActionManagerEx::initWithBinary can only load one UI animation
timur-losev timur-losev
Fix a bug that GLProgramCache::addGLProgram() can not replace existing program Fix a bug that GLProgramCache::addGLProgram() can not replace existing program
TimothyZhang TimothyZhang
Fixed a potential memory leak in GLProgram::setGLProgram() Fixed a potential memory leak in GLProgram::setGLProgram()
Add jsb.fileUtils.writeDataToFile(). Add jsb.fileUtils.writeDataToFile().
ahlwong ahlwong
Fix Label Kerning on Single Characters Fix Label Kerning on Single Characters
Svenito Svenito
Add greater than operator to Vec2 Add greater than operator to Vec2
liamcindy liamcindy
Update ui button size changed logic. Update ui button size changed logic.
Added support for Cocos Studio Light3D. Added support for Cocos Studio Light3D.
@ -1139,39 +1139,39 @@ Developers:
Update for text effect clone. Update for text effect clone.
Update controlButton size calculate with new Scale9Sprite logic. Update controlButton size calculate with new Scale9Sprite logic.
Update pageview to support adjust child size. Update pageview to support adjust child size.
vovkasm vovkasm
Fix warnings for Xcode6.1 Fix warnings for Xcode6.1
nilium nilium
Unignore libs dir in plugin and fix Travis script to descend into included directories Unignore libs dir in plugin and fix Travis script to descend into included directories
shrimpz shrimpz
Fix two typos in luaval_to_quaternion Fix two typos in luaval_to_quaternion
Fix label crashed on android Fix label crashed on android
ton1517 ton1517
Fix the issue that JumpTo can not be applied more than once Fix the issue that JumpTo can not be applied more than once
takaokato takaokato
Fix wrong result in Node:getParenttoNodeTransform() if node is transformed Fix wrong result in Node:getParenttoNodeTransform() if node is transformed
AknEp AknEp
Fix FileUtils::fullPathForFilename return empty string if file not found Fix FileUtils::fullPathForFilename return empty string if file not found
kompjoefriek kompjoefriek
Fix compiling warnings Fix compiling warnings
Device: Added vibrate support to enable vibration for a duration. Device: Added vibrate support to enable vibration for a duration.
tmr111116 tmr111116
fix random int overflow fix random int overflow
flamefox flamefox
fix the bug that Sprite3D::getAttachNode() should failed when there is no bone with name fix the bug that Sprite3D::getAttachNode() should failed when there is no bone with name
ryule ryule
Fixed HttpClient-ios request to work when the data is started by 0x00 Fixed HttpClient-ios request to work when the data is started by 0x00
loadrunner loadrunner
Added romanian languange support Added romanian languange support
Added sensor property for PhysicsShape Added sensor property for PhysicsShape
@ -1179,24 +1179,24 @@ Developers:
Changed label font size type to float. Changed label font size type to float.
Removed scale factor for label shadow. Removed scale factor for label shadow.
Fixed a TMXLayer bug: When using float values (for example the actual position of the character) to get the current tile, the wrong tile is sometimes/usually returned. Fixed a TMXLayer bug: When using float values (for example the actual position of the character) to get the current tile, the wrong tile is sometimes/usually returned.
Almax27 Almax27
RenderQueue command buffer optimize. RenderQueue command buffer optimize.
Removed ScrollView::_innerContainer pointer copy. Removed ScrollView::_innerContainer pointer copy.
IgorMats IgorMats
Added MotionStreak::getStroke/setStroke Added MotionStreak::getStroke/setStroke
matsuokah matsuokah
Fixed the bug that JNI illegal start byte error causes crashing error on Android 5.0 Fixed the bug that JNI illegal start byte error causes crashing error on Android 5.0
babcca babcca
Fixed crashing when playing streamed MP4 file on iOS Fixed crashing when playing streamed MP4 file on iOS
milos1290 milos1290
Added Lerp for Vec3 Added Lerp for Vec3
Added ActionFloat Added ActionFloat
perminovVS perminovVS
Optimize Vec3 and Vec2 Optimize Vec3 and Vec2
Added `UserDefault::setDelegate()` Added `UserDefault::setDelegate()`
@ -1210,13 +1210,13 @@ Developers:
Corrected the keyboard codes for Desktop and WinRT. Corrected the keyboard codes for Desktop and WinRT.
Added some support for mouse on WinRT. Added some support for mouse on WinRT.
Correct the convertion between unicode and utf8 on WinRT. Correct the convertion between unicode and utf8 on WinRT.
qiutaoleo qiutaoleo
Added a feature to check case characters for filename on windows Added a feature to check case characters for filename on windows
HueyPark HueyPark
Fixed memory leak in HttpClient on iOS Fixed memory leak in HttpClient on iOS
Dimon4eg Dimon4eg
Fixed crash on AssetsManager Fixed crash on AssetsManager
Fixed memory leak of WebView on iOS Fixed memory leak of WebView on iOS
@ -1226,7 +1226,7 @@ Developers:
Fixed a crash bug in LoadingBar. Fixed a crash bug in LoadingBar.
Fixed a crash bug in destructor of FontFreeType. Fixed a crash bug in destructor of FontFreeType.
UI: Set focus to Widget when touched. UI: Set focus to Widget when touched.
tankorsmash tankorsmash
Fixed the bug that ProgressTimer::setSprite() doesn't take effect Fixed the bug that ProgressTimer::setSprite() doesn't take effect
@ -1290,7 +1290,7 @@ Developers:
GuoLunHao GuoLunHao
Add quiet option for Cocos Toolkit. Add quiet option for Cocos Toolkit.
Retired Core Developers: Retired Core Developers:
WenSheng Yang WenSheng Yang
@ -1314,16 +1314,16 @@ Retired Core Developers:
geron-cn geron-cn
Removed redundant interface in CCSkeletonNode. Removed redundant interface in CCSkeletonNode.
Fixed a bug that a same frame index is inserted after animation speed is scaled. Fixed a bug that a same frame index is inserted after animation speed is scaled.
Fixed crash when recall a cached timeline after scene exited. Fixed crash when recall a cached timeline after scene exited.
Added ActionTimeline::setAnimationEndCallBack and ActionTimeline::addFrameEndCallFunc. Added ActionTimeline::setAnimationEndCallBack and ActionTimeline::addFrameEndCallFunc.
igorzel igorzel
Fixed a crash bug caused by integer overflow in Device::getTextureDataForText on iOS. Fixed a crash bug caused by integer overflow in Device::getTextureDataForText on iOS.
KAIO2 KAIO2
Fixed typos and syntax errors. Fixed typos and syntax errors.
kammy kammy
Moved initialization of image to an appropriate location, because it always called twice in SpriteFrameCache::addSpriteFramesWithFile() Moved initialization of image to an appropriate location, because it always called twice in SpriteFrameCache::addSpriteFramesWithFile()
@ -1332,7 +1332,7 @@ Retired Core Developers:
linguofeng linguofeng
Added UPDATE_FAILED and ERROR_DECOMPRESS in Lua. Added UPDATE_FAILED and ERROR_DECOMPRESS in Lua.
lsybblll lsybblll
Fixed a bug in CCPhysics3DComponent.cpp that oldBool is set with a wrong value. Fixed a bug in CCPhysics3DComponent.cpp that oldBool is set with a wrong value.
@ -1378,7 +1378,7 @@ Retired Core Developers:
thuydx55 thuydx55
Fixed a bug of loading pluginx lib when compile Android with --compile-script flag. Fixed a bug of loading pluginx lib when compile Android with --compile-script flag.
Cocos2d-x can not grow so fast without the active community. Cocos2d-x can not grow so fast without the active community.
Thanks to all developers who report & trace bugs, discuss the engine usage in forum & QQ groups! Thanks to all developers who report & trace bugs, discuss the engine usage in forum & QQ groups!

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) [![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) [![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) [![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) [![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) [![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. * Extensions having own license as part of there package.
* Refactor AudioEngine, OpenAL for all platforms * 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 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) * Refactor UserDefault with [mio](https://github.com/mandreyel/mio)
* Modularize all optional extensions, move from engine core folder to an extensions folder * 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, ... * Implement all .wav formats supported by ```OpenAL Soft```, such as MS-ADPCM, ADPCM, ...
* Use a modern GL loader ```Glad``` * Use a modern GL loader ```Glad```
* Google [angle](https://github.com/google/angle) renderer backend support * Google [angle](https://github.com/google/angle) renderer backend support
* C++ 17 standard * C++ 17 standard
* IOS SDK 9.0 as minimal deployment * IOS/TVOS SDK 9.0 as minimal deployment
* Use fast pugixml * Use fast pugixml
* Use [curl](https://github.com/curl/curl) for transferring data with URL syntax * Use [curl](https://github.com/curl/curl) for transferring data with URL syntax
* Use SAX parser for all plist files * 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 .\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``` 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 2. Execute the following command
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer``` ```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
3. Generate xcode project 3. Generate xcode project
- for ios arm64: - 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: - 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) - 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) - 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. 4. After cmake finishes generating, you can open the xcode project at ```build``` folder and run cpp-tests or other test targets.
5. Notes 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** - **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** - **axys only provides armv7, arm64, x86_64 prebuilt libraries for ios/tvos**
### New Project ### New Project
- Cpp: `axys new -p org.axys1.hellocpp -d D:\dev\projects\ -l cpp --portrait HelloCpp` - Cpp: `axys new -p org.axys1.hellocpp -d D:\dev\projects\ -l cpp --portrait HelloCpp`

View File

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

View File

@ -38,6 +38,11 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS")
set(APPLE TRUE) set(APPLE TRUE)
set(IOS TRUE) set(IOS TRUE)
set(PLATFORM_FOLDER ios) set(PLATFORM_FOLDER ios)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "tvOS")
set(APPLE TRUE)
set(IOS TRUE)
set(TVOS TRUE)
set(PLATFORM_FOLDER tvos)
else() else()
message(FATAL_ERROR "Unsupported platform, CMake will exit") message(FATAL_ERROR "Unsupported platform, CMake will exit")
return() return()
@ -58,7 +63,7 @@ define_property(TARGET
PROPERTY AX_LUA_DEPEND PROPERTY AX_LUA_DEPEND
BRIEF_DOCS "axis lua depend libs" BRIEF_DOCS "axis lua depend libs"
FULL_DOCS "use to save depend libs of axis lua project" FULL_DOCS "use to save depend libs of axis lua project"
) )
# config c standard # config c standard
if (NOT WINDOWS) if (NOT WINDOWS)
@ -110,21 +115,29 @@ endif()
# Set macro definitions for special platforms # Set macro definitions for special platforms
function(use_ax_compile_define target) function(use_ax_compile_define target)
target_compile_definitions(${target} PUBLIC $<$<CONFIG:Debug>:_AX_DEBUG=1>) target_compile_definitions(${target} PUBLIC $<$<CONFIG:Debug>:_AX_DEBUG=1>)
# !important axis not use double precision # !important axis not use double precision
# target_compile_definitions(${target} PUBLIC CP_USE_CGTYPES=0) # target_compile_definitions(${target} PUBLIC CP_USE_CGTYPES=0)
# target_compile_definitions(${target} PUBLIC CP_USE_DOUBLES=0) # target_compile_definitions(${target} PUBLIC CP_USE_DOUBLES=0)
if(APPLE) if(APPLE)
target_compile_definitions(${target} PUBLIC __APPLE__) target_compile_definitions(${target} PUBLIC __APPLE__)
target_compile_definitions(${target} PUBLIC USE_FILE32API) target_compile_definitions(${target} PUBLIC USE_FILE32API)
if(AX_USE_COMPAT_GL) if(AX_USE_COMPAT_GL)
target_compile_definitions(${target} target_compile_definitions(${target}
PUBLIC AX_USE_COMPAT_GL=1 PUBLIC AX_USE_COMPAT_GL=1
PUBLIC GL_SILENCE_DEPRECATION=1 PUBLIC GL_SILENCE_DEPRECATION=1
) )
endif() 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) elseif(LINUX)
target_compile_definitions(${target} PUBLIC LINUX) target_compile_definitions(${target} PUBLIC LINUX)
target_compile_definitions(${target} PUBLIC _GNU_SOURCE) target_compile_definitions(${target} PUBLIC _GNU_SOURCE)
@ -135,7 +148,7 @@ function(use_ax_compile_define target)
if(AX_USE_COMPAT_GL) if(AX_USE_COMPAT_GL)
target_compile_definitions(${target} PUBLIC AX_USE_COMPAT_GL=1) target_compile_definitions(${target} PUBLIC AX_USE_COMPAT_GL=1)
endif() endif()
target_compile_definitions(${target} target_compile_definitions(${target}
PUBLIC WIN32 PUBLIC WIN32
PUBLIC _WIN32 PUBLIC _WIN32
PUBLIC _WINDOWS PUBLIC _WINDOWS
@ -146,7 +159,7 @@ function(use_ax_compile_define target)
# PUBLIC GLAD_GLAPI_EXPORT # PUBLIC GLAD_GLAPI_EXPORT
) )
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
target_compile_definitions(${target} target_compile_definitions(${target}
PRIVATE _USRDLL PRIVATE _USRDLL
PRIVATE _USEGUIDLL # ui PRIVATE _USEGUIDLL # ui
) )

View File

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

View File

@ -50,7 +50,7 @@ open mac-build/axys.xcodeproj
```sh ```sh
cd axys cd axys
mkdir ios-build 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 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(); auto director = Director::getInstance();
Vec2 points = director->getWinSize(); Vec2 points = director->getWinSize();
Vec2 pixels = director->getWinSizeInPixels(); Vec2 pixels = director->getWinSizeInPixels();
auto glview = director->getOpenGLView(); auto glView = director->getOpenGLView();
Vec2 design = glview->getDesignResolutionSize(); Vec2 design = glView->getDesignResolutionSize();
ResolutionPolicy res = glview->getResolutionPolicy(); ResolutionPolicy res = glView->getResolutionPolicy();
Rect visibleRect = glview->getVisibleRect(); Rect visibleRect = glView->getVisibleRect();
Console::Utility::mydprintf(fd, Console::Utility::mydprintf(fd,
"Window size:\n" "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) JNIEXPORT void JNICALL Java_org_axys1_lib_AxysRenderer_nativeInit(JNIEnv*, jclass, jint w, jint h)
{ {
auto director = ax::Director::getInstance(); auto director = ax::Director::getInstance();
auto glview = director->getOpenGLView(); auto glView = director->getOpenGLView();
if (!glview) if (!glView)
{ {
glview = ax::GLViewImpl::create("Android app"); glView = ax::GLViewImpl::create("Android app");
glview->setFrameSize(w, h); glView->setFrameSize(w, h);
director->setOpenGLView(glview); director->setOpenGLView(glView);
ax::Application::getInstance()->run(); ax::Application::getInstance()->run();
} }

View File

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

View File

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

View File

@ -37,10 +37,10 @@ void* GLViewImpl::_pixelFormat = kEAGLColorFormatRGB565;
int GLViewImpl::_depthFormat = GL_DEPTH_COMPONENT16; int GLViewImpl::_depthFormat = GL_DEPTH_COMPONENT16;
int GLViewImpl::_multisamplingCount = 0; int GLViewImpl::_multisamplingCount = 0;
GLViewImpl* GLViewImpl::createWithEAGLView(void* eaglview) GLViewImpl* GLViewImpl::createWithEAGLView(void* eaglView)
{ {
auto ret = new GLViewImpl; auto ret = new GLViewImpl;
if (ret->initWithEAGLView(eaglview)) if (ret->initWithEAGLView(eaglView))
{ {
ret->autorelease(); ret->autorelease();
return ret; return ret;
@ -122,18 +122,18 @@ GLViewImpl::GLViewImpl() {}
GLViewImpl::~GLViewImpl() GLViewImpl::~GLViewImpl()
{ {
// CCEAGLView *glview = (CCEAGLView*) _eaglview; // CCEAGLView *glView = (CCEAGLView*) _eaglView;
//[glview release]; //[glView release];
} }
bool GLViewImpl::initWithEAGLView(void* eaglview) bool GLViewImpl::initWithEAGLView(void* eaglView)
{ {
_eaglview = eaglview; _eaglView = eaglView;
CCEAGLView* glview = (CCEAGLView*)_eaglview; CCEAGLView* glView = (CCEAGLView*)_eaglView;
_screenSize.width = _designResolutionSize.width = [glview getWidth]; _screenSize.width = _designResolutionSize.width = [glView getWidth];
_screenSize.height = _designResolutionSize.height = [glview getHeight]; _screenSize.height = _designResolutionSize.height = [glView getHeight];
// _scaleX = _scaleY = [glview contentScaleFactor]; // _scaleX = _scaleY = [glView contentScaleFactor];
return true; 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); CGRect r = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
convertAttrs(); convertAttrs();
CCEAGLView* eaglview = [CCEAGLView viewWithFrame:r CCEAGLView* eaglView = [CCEAGLView viewWithFrame:r
pixelFormat:(NSString*)_pixelFormat pixelFormat:(NSString*)_pixelFormat
depthFormat:_depthFormat depthFormat:_depthFormat
preserveBackbuffer:NO preserveBackbuffer:NO
@ -152,14 +152,14 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const Rect& rect, float
// Not available on tvOS // Not available on tvOS
#if !defined(AX_TARGET_OS_TVOS) #if !defined(AX_TARGET_OS_TVOS)
[eaglview setMultipleTouchEnabled:YES]; [eaglView setMultipleTouchEnabled:YES];
#endif #endif
_screenSize.width = _designResolutionSize.width = [eaglview getWidth]; _screenSize.width = _designResolutionSize.width = [eaglView getWidth];
_screenSize.height = _designResolutionSize.height = [eaglview getHeight]; _screenSize.height = _designResolutionSize.height = [eaglView getHeight];
// _scaleX = _scaleY = [eaglview contentScaleFactor]; // _scaleX = _scaleY = [eaglView contentScaleFactor];
_eaglview = eaglview; _eaglView = eaglView;
return true; return true;
} }
@ -178,7 +178,7 @@ bool GLViewImpl::initWithFullScreen(std::string_view viewName)
bool GLViewImpl::isOpenGLReady() bool GLViewImpl::isOpenGLReady()
{ {
return _eaglview != nullptr; return _eaglView != nullptr;
} }
bool GLViewImpl::setContentScaleFactor(float contentScaleFactor) bool GLViewImpl::setContentScaleFactor(float contentScaleFactor)
@ -186,17 +186,17 @@ bool GLViewImpl::setContentScaleFactor(float contentScaleFactor)
AX_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode AX_ASSERT(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode
_scaleX = _scaleY = contentScaleFactor; _scaleX = _scaleY = contentScaleFactor;
CCEAGLView* eaglview = (CCEAGLView*)_eaglview; CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
[eaglview setNeedsLayout]; [eaglView setNeedsLayout];
return true; return true;
} }
float GLViewImpl::getContentScaleFactor() const 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"); // AXASSERT(scaleFactor == _scaleX == _scaleY, "Logic error in GLView::getContentScaleFactor");
@ -208,36 +208,36 @@ void GLViewImpl::end()
[CCDirectorCaller destroy]; [CCDirectorCaller destroy];
// destroy EAGLView // destroy EAGLView
CCEAGLView* eaglview = (CCEAGLView*)_eaglview; CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
[eaglview removeFromSuperview]; [eaglView removeFromSuperview];
//[eaglview release]; //[eaglView release];
release(); release();
} }
void GLViewImpl::swapBuffers() void GLViewImpl::swapBuffers()
{ {
CCEAGLView* eaglview = (CCEAGLView*)_eaglview; CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
[eaglview swapBuffers]; [eaglView swapBuffers];
} }
void GLViewImpl::setIMEKeyboardState(bool open) void GLViewImpl::setIMEKeyboardState(bool open)
{ {
CCEAGLView* eaglview = (CCEAGLView*)_eaglview; CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
if (open) if (open)
{ {
[eaglview showKeyboard]; [eaglView showKeyboard];
} }
else else
{ {
[eaglview hideKeyboard]; [eaglView hideKeyboard];
} }
} }
Rect GLViewImpl::getSafeAreaRect() const Rect GLViewImpl::getSafeAreaRect() const
{ {
CCEAGLView* eaglview = (CCEAGLView*)_eaglview; CCEAGLView* eaglView = (CCEAGLView*)_eaglView;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
float version = [[UIDevice currentDevice].systemVersion floatValue]; float version = [[UIDevice currentDevice].systemVersion floatValue];
@ -245,14 +245,14 @@ Rect GLViewImpl::getSafeAreaRect() const
{ {
# pragma clang diagnostic push # pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpartial-availability" # pragma clang diagnostic ignored "-Wpartial-availability"
UIEdgeInsets safeAreaInsets = eaglview.safeAreaInsets; UIEdgeInsets safeAreaInsets = eaglView.safeAreaInsets;
# pragma clang diagnostic pop # pragma clang diagnostic pop
// Multiply contentScaleFactor since safeAreaInsets return points. // Multiply contentScaleFactor since safeAreaInsets return points.
safeAreaInsets.left *= eaglview.contentScaleFactor; safeAreaInsets.left *= eaglView.contentScaleFactor;
safeAreaInsets.right *= eaglview.contentScaleFactor; safeAreaInsets.right *= eaglView.contentScaleFactor;
safeAreaInsets.top *= eaglview.contentScaleFactor; safeAreaInsets.top *= eaglView.contentScaleFactor;
safeAreaInsets.bottom *= eaglview.contentScaleFactor; safeAreaInsets.bottom *= eaglView.contentScaleFactor;
// Get leftBottom and rightTop point in UI coordinates // Get leftBottom and rightTop point in UI coordinates
Vec2 leftBottom = Vec2(safeAreaInsets.left, _screenSize.height - safeAreaInsets.bottom); 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{}; std::chrono::steady_clock::time_point lastTime{};
auto director = Director::getInstance(); auto director = Director::getInstance();
auto glview = director->getOpenGLView(); auto glView = director->getOpenGLView();
// Retain glview to avoid glview being released in the while loop // Retain glView to avoid glView being released in the while loop
glview->retain(); glView->retain();
while (!glview->windowShouldClose()) while (!glView->windowShouldClose())
{ {
lastTime = std::chrono::steady_clock::now(); lastTime = std::chrono::steady_clock::now();
director->mainLoop(); director->mainLoop();
glview->pollEvents(); glView->pollEvents();
auto interval = std::chrono::steady_clock::now() - lastTime; auto interval = std::chrono::steady_clock::now() - lastTime;
if (interval < _animationInterval) if (interval < _animationInterval)
@ -89,13 +89,13 @@ int Application::run()
* when we want to close the window, we should call Director::end(); * when we want to close the window, we should call Director::end();
* then call Director::mainLoop to do release of internal resources * then call Director::mainLoop to do release of internal resources
*/ */
if (glview->isOpenGLReady()) if (glView->isOpenGLReady())
{ {
director->end(); director->end();
director->mainLoop(); director->mainLoop();
director = nullptr; director = nullptr;
} }
glview->release(); glView->release();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@ if(WINDOWS)
ui/UIEditBox/UIEditBoxImpl-win32.h ui/UIEditBox/UIEditBoxImpl-win32.h
ui/UIWebView/UIWebViewImpl-win32.h ui/UIWebView/UIWebViewImpl-win32.h
ui/UIWebView/UIWebView.h ui/UIWebView/UIWebView.h
) )
set(_AX_UI_SPECIFIC_SRC set(_AX_UI_SPECIFIC_SRC
ui/UIEditBox/UIEditBoxImpl-win32.cpp ui/UIEditBox/UIEditBoxImpl-win32.cpp
@ -19,7 +19,7 @@ if(WINDOWS)
ui/UIEditBox/UIEditBoxImpl-win32.cpp ui/UIEditBox/UIEditBoxImpl-win32.cpp
) )
endif() endif()
if (AX_ENABLE_MFMEDIA) if (AX_ENABLE_MFMEDIA)
set(_AX_UI_SPECIFIC_HEADER ${_AX_UI_SPECIFIC_HEADER} set(_AX_UI_SPECIFIC_HEADER ${_AX_UI_SPECIFIC_HEADER}
ui/UIVideoPlayer/MFUtils.h ui/UIVideoPlayer/MFUtils.h
@ -52,29 +52,51 @@ elseif(APPLE)
ui/UIEditBox/Mac/CCUITextFieldFormatter.m ui/UIEditBox/Mac/CCUITextFieldFormatter.m
) )
elseif(IOS) elseif(IOS)
set(_AX_UI_SPECIFIC_HEADER if (TVOS)
ui/UIWebView/UIWebView.h set(_AX_UI_SPECIFIC_HEADER
ui/UIVideoPlayer/UIVideoPlayer.h ui/UIVideoPlayer/UIVideoPlayer.h
ui/UIWebView/UIWebViewImpl-ios.h ui/UIEditBox/UIEditBoxImpl-ios.h
ui/UIEditBox/UIEditBoxImpl-ios.h ui/UIEditBox/iOS/CCUIEditBoxIOS.h
ui/UIEditBox/iOS/CCUIEditBoxIOS.h ui/UIEditBox/iOS/CCUIMultilineTextField.h
ui/UIEditBox/iOS/CCUIMultilineTextField.h ui/UIEditBox/iOS/CCUITextInput.h
ui/UIEditBox/iOS/CCUITextInput.h ui/UIEditBox/iOS/UITextView+CCUITextInput.h
ui/UIEditBox/iOS/UITextView+CCUITextInput.h ui/UIEditBox/iOS/UITextField+CCUITextInput.h
ui/UIEditBox/iOS/UITextField+CCUITextInput.h ui/UIEditBox/iOS/CCUISingleLineTextField.h
ui/UIEditBox/iOS/CCUISingleLineTextField.h )
) set(_AX_UI_SPECIFIC_SRC
set(_AX_UI_SPECIFIC_SRC ui/UIVideoPlayer/UIVideoPlayer-ios.mm
ui/UIWebView/UIWebView.mm ui/UIEditBox/UIEditBoxImpl-ios.mm
ui/UIVideoPlayer/UIVideoPlayer-ios.mm ui/UIEditBox/iOS/CCUIEditBoxIOS.mm
ui/UIWebView/UIWebViewImpl-ios.mm ui/UIEditBox/iOS/CCUIMultilineTextField.mm
ui/UIEditBox/UIEditBoxImpl-ios.mm ui/UIEditBox/iOS/CCUISingleLineTextField.mm
ui/UIEditBox/iOS/CCUIEditBoxIOS.mm ui/UIEditBox/iOS/UITextField+CCUITextInput.mm
ui/UIEditBox/iOS/CCUIMultilineTextField.mm ui/UIEditBox/iOS/UITextView+CCUITextInput.mm
ui/UIEditBox/iOS/CCUISingleLineTextField.mm )
ui/UIEditBox/iOS/UITextField+CCUITextInput.mm else()
ui/UIEditBox/iOS/UITextView+CCUITextInput.mm 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() endif()
elseif(LINUX) elseif(LINUX)
set(_AX_UI_SPECIFIC_HEADER 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) if (s_ScreenVisibleRect.size.width == 0.0f && s_ScreenVisibleRect.size.height == 0.0f)
{ {
auto director = Director::getInstance(); 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.origin = director->getVisibleOrigin();
s_ScreenVisibleRect.size = director->getVisibleSize(); s_ScreenVisibleRect.size = director->getVisibleSize();

View File

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

View File

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

View File

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

View File

@ -320,9 +320,9 @@
- (void)doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance - (void)doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance
{ {
auto view = ax::Director::getInstance()->getOpenGLView(); 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 - (void)updateFrame:(CGRect)rect
@ -337,9 +337,9 @@
- (void)openKeyboard - (void)openKeyboard
{ {
auto view = ax::Director::getInstance()->getOpenGLView(); 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]; [self.textInput becomeFirstResponder];
} }
@ -362,9 +362,9 @@
- (void)animationSelector - (void)animationSelector
{ {
auto view = ax::Director::getInstance()->getOpenGLView(); 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 #pragma mark - UITextView delegate methods
@ -376,9 +376,9 @@
_returnPressed = NO; _returnPressed = NO;
auto view = ax::Director::getInstance()->getOpenGLView(); 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]; [self performSelector:@selector(animationSelector) withObject:nil afterDelay:0.0f];
} }
@ -469,9 +469,9 @@
_returnPressed = NO; _returnPressed = NO;
auto view = ax::Director::getInstance()->getOpenGLView(); 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]; [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) if (_placeHolderLabel == nil)
{ {
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();
_placeHolderLabel = _placeHolderLabel =
[[UILabel alloc] initWithFrame:CGRectMake(padding, padding, self.bounds.size.width - padding * 2, 0)]; [[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 - (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); return CGRectInset(bounds, padding, padding);
} }

View File

@ -76,9 +76,9 @@
- (CGRect)textRectForBounds:(CGRect)bounds - (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); return CGRectInset(bounds, padding, padding);
} }

View File

@ -320,9 +320,9 @@ void Layout::stencilClippingVisit(Renderer* renderer, const Mat4& parentTransfor
void Layout::onBeforeVisitScissor() void Layout::onBeforeVisitScissor()
{ {
auto glview = _director->getOpenGLView(); auto glView = _director->getOpenGLView();
// apply scissor test // apply scissor test
_scissorOldState = glview->isScissorEnabled(); _scissorOldState = glView->isScissorEnabled();
if (false == _scissorOldState) if (false == _scissorOldState)
{ {
auto renderer = _director->getRenderer(); auto renderer = _director->getRenderer();
@ -331,10 +331,10 @@ void Layout::onBeforeVisitScissor()
// apply scissor box // apply scissor box
Rect clippingRect = getClippingRect(); Rect clippingRect = getClippingRect();
_clippingOldRect = glview->getScissorRect(); _clippingOldRect = glView->getScissorRect();
if (false == _clippingOldRect.equals(clippingRect)) 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); clippingRect.size.height);
} }
} }
@ -346,8 +346,8 @@ void Layout::onAfterVisitScissor()
// revert scissor box // revert scissor box
if (false == _clippingOldRect.equals(_clippingRect)) if (false == _clippingOldRect.equals(_clippingRect))
{ {
auto glview = _director->getOpenGLView(); auto glView = _director->getOpenGLView();
glview->setScissorInPoints(_clippingOldRect.origin.x, _clippingOldRect.origin.y, glView->setScissorInPoints(_clippingOldRect.origin.x, _clippingOldRect.origin.y,
_clippingOldRect.size.width, _clippingOldRect.size.height); _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) static float convertDistanceFromPointToInch(const Vec2& dis)
{ {
auto glview = Director::getInstance()->getOpenGLView(); auto glView = Director::getInstance()->getOpenGLView();
int dpi = Device::getDPI(); 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; return distance;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloCpp into root project
if(XCODE) if(XCODE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif() endif()
# config quick starter batch script run.bat for windows # config quick starter batch script run.bat for windows
if(WIN32) if(WIN32)
file(RELATIVE_PATH CMAKE_BUILD_RELATIVE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}") file(RELATIVE_PATH CMAKE_BUILD_RELATIVE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
@ -74,7 +74,7 @@ if(APPLE OR WINDOWS)
ax_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER}) ax_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
endif() endif()
# add cross-platforms source files and header files # add cross-platforms source files and header files
list(APPEND GAME_SOURCE list(APPEND GAME_SOURCE
Classes/AppDelegate.cpp Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp Classes/HelloWorldScene.cpp
@ -109,11 +109,21 @@ elseif(APPLE)
proj.ios_mac/ios/AppController.h proj.ios_mac/ios/AppController.h
proj.ios_mac/ios/RootViewController.h proj.ios_mac/ios/RootViewController.h
) )
set(APP_UI_RES
proj.ios_mac/ios/LaunchScreen.storyboard if (TVOS)
proj.ios_mac/ios/LaunchScreenBackground.png set(APP_UI_RES
proj.ios_mac/ios/Images.xcassets 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 list(APPEND GAME_SOURCE
proj.ios_mac/ios/main.m proj.ios_mac/ios/main.m
proj.ios_mac/ios/AppController.mm proj.ios_mac/ios/AppController.mm
@ -168,8 +178,11 @@ if(APPLE)
if(MACOSX) if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist") 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) 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") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
endif() endif()
@ -203,4 +216,4 @@ if (_AX_USE_PREBUILT) # support windows only
include(${_AX_ROOT_PATH}/cmake/Modules/AXLinkHelpers.cmake) include(${_AX_ROOT_PATH}/cmake/Modules/AXLinkHelpers.cmake)
ax_link_cxx_prebuilt(${APP_NAME} ${_AX_ROOT_PATH} ${AX_PREBUILT_DIR}) ax_link_cxx_prebuilt(${APP_NAME} ${_AX_ROOT_PATH} ${AX_PREBUILT_DIR})
endif() endif()

View File

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

View File

@ -39,7 +39,8 @@
"project_replace_ios_bundleid": { "project_replace_ios_bundleid": {
"src_bundle_id": "org.axys1.hellocpp", "src_bundle_id": "org.axys1.hellocpp",
"files": [ "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)" "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", "pattern": "UIInterfaceOrientationLandscapeRight",
"replace_string": "UIInterfaceOrientationPortrait" "replace_string": "UIInterfaceOrientationPortrait"
}, },
{ {
"file_path": "proj.ios_mac/ios/Info.plist", "file_path": "proj.ios_mac/ios/targets/ios/Info.plist",
"pattern": "UIInterfaceOrientationLandscapeLeft", "pattern": "UIInterfaceOrientationLandscapeLeft",
"replace_string": "UIInterfaceOrientationPortraitUpsideDown" "replace_string": "UIInterfaceOrientationPortraitUpsideDown"
}, },

View File

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

View File

@ -54,7 +54,9 @@ customization that is not appropriate for viewDidLoad.
numberOfSamples:axis::GLViewImpl::_multisamplingCount]; numberOfSamples:axis::GLViewImpl::_multisamplingCount];
// Enable or disable multiple touches // Enable or disable multiple touches
#if !defined(AX_TARGET_OS_TVOS)
[eaglView setMultipleTouchEnabled:NO]; [eaglView setMultipleTouchEnabled:NO];
#endif
// Set EAGLView as view of RootViewController // Set EAGLView as view of RootViewController
self.view = eaglView; self.view = eaglView;
@ -93,15 +95,15 @@ customization that is not appropriate for viewDidLoad.
{ {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; [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); axis::Application::getInstance()->applicationScreenSizeChanged((int)s.width, (int)s.height);
} }
} }

View File

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

@ -35,7 +35,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloLua into root project
if(XCODE) if(XCODE)
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE) set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY TRUE)
endif() endif()
# config quick starter batch script run.bat for windows # config quick starter batch script run.bat for windows
if(WIN32) if(WIN32)
file(RELATIVE_PATH CMAKE_BUILD_RELATIVE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}") file(RELATIVE_PATH CMAKE_BUILD_RELATIVE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
@ -56,7 +56,7 @@ if(NOT DEFINED BUILD_ENGINE_DONE) # to test HelloLua into root project
include(AXBuildSet) include(AXBuildSet)
set(AX_ENABLE_EXT_LUA ON) set(AX_ENABLE_EXT_LUA ON)
set(_AX_USE_PREBUILT FALSE) set(_AX_USE_PREBUILT FALSE)
if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${_AX_ROOT_PATH}/${AX_PREBUILT_DIR}) if (WIN32 AND DEFINED AX_PREBUILT_DIR AND IS_DIRECTORY ${_AX_ROOT_PATH}/${AX_PREBUILT_DIR})
set(_AX_USE_PREBUILT TRUE) set(_AX_USE_PREBUILT TRUE)
@ -113,11 +113,21 @@ elseif(APPLE)
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.h ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.h
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/RootViewController.h ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/RootViewController.h
) )
set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreen.storyboard if (TVOS)
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/LaunchScreenBackground.png set(APP_UI_RES
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Images.xcassets ${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 list(APPEND GAME_SOURCE
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/main.m ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/main.m
${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.mm ${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/AppController.mm
@ -149,7 +159,7 @@ if(NOT ANDROID)
add_executable(${APP_NAME} ${APP_SRC}) add_executable(${APP_NAME} ${APP_SRC})
else() else()
add_library(${APP_NAME} SHARED ${APP_SRC}) add_library(${APP_NAME} SHARED ${APP_SRC})
# whole archive for jni # whole archive for jni
add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform) add_subdirectory(${_AX_ROOT_PATH}/core/platform/android ${ENGINE_BINARY_PATH}/core/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive) target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
@ -178,8 +188,13 @@ if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES set_target_properties(${APP_NAME} PROPERTIES
LINK_FLAGS "-pagezero_size 10000 -image_base 100000000" 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) 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} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "") set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "")
set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer") 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