Skip to content

Commit 00d4f7c

Browse files
authored
Merge branch 'axmolengine:dev' into dev
2 parents 1e913f1 + 857f669 commit 00d4f7c

File tree

115 files changed

+2263
-1413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2263
-1413
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ assignees: ''
1212
- developing environments
1313
- NDK version: r19c
1414
- Xcode version: 12.4
15-
- VS/msvctools version: Visual Studio 2019(16.11)/14.29.30133
15+
- Visual Studio:
16+
- VS version: 2019 (16.11), 2022 (17.4)
17+
- MSVC version: 1929, 1934
18+
- Windows SDK version: 10.0.22621.0
1619
- cmake version:
1720
Steps to Reproduce:
1821

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ THIS PROJECT IS IN DEVELOPMENT MODE. Any pull requests should merge to branch `d
88
- [ ] I have performed a self-review of my code.
99
- [ ] If it is a core feature, I have added thorough tests.
1010
- [ ] I have checked readme and add important infos to this PR (if it needed).
11-
- [ ] An improved cpp-test/lua-test is not needed (explain why not, thanks).
11+
- [ ] I have added/adapted some tests too.

.github/workflows/windows-ci.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- 'docs/**'
1212

1313
jobs:
14-
build:
14+
toolset-latest:
1515
if: ${{ !startsWith(github.event.commits[0].message, 'Merge pull request') }}
1616
# The CMake configure and build commands are platform agnostic and should work equally
1717
# well on Windows or Mac. You can convert this to a matrix build if you need
@@ -34,9 +34,40 @@ jobs:
3434
- name: Setup Python
3535
uses: actions/setup-python@v3
3636

37-
- uses: ilammy/msvc-dev-cmd@v1.11.0
37+
- uses: ilammy/msvc-dev-cmd@v1.12.0
3838
with:
3939
arch: ${{ env.BUILD_ARCH }}
4040

4141
- name: Build
4242
run: tools\win-ci\build.ps1 $env:BUILD_ARCH
43+
toolset-vs2019:
44+
if: ${{ !startsWith(github.event.commits[0].message, 'Merge pull request') }}
45+
# The CMake configure and build commands are platform agnostic and should work equally
46+
# well on Windows or Mac. You can convert this to a matrix build if you need
47+
# cross-platform coverage.
48+
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
49+
runs-on: windows-2019
50+
strategy:
51+
matrix:
52+
arch:
53+
- x86
54+
- x64
55+
env:
56+
BUILD_ARCH: ${{ matrix.arch }}
57+
# Test winsdk < 10.0.22000.0 (missing C11 standard stdalign.h), axmol will auto fallback to C99 for resolving compiling issue.
58+
WINSDK_VER: '10.0.19041.0'
59+
60+
steps:
61+
- uses: actions/checkout@v3
62+
with:
63+
submodules: 'recursive'
64+
65+
- name: Setup Python
66+
uses: actions/setup-python@v3
67+
68+
- uses: ilammy/[email protected]
69+
with:
70+
arch: ${{ env.BUILD_ARCH }}
71+
72+
- name: Build
73+
run: tools\win-ci\build.ps1 $env:BUILD_ARCH $env:WINSDK_VER

README.md

Lines changed: 87 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -21,59 +21,61 @@
2121

2222
**This is another more radical fork of *Cocos2d-x-4.0*, it has Full Support OpenAL for all platforms, single texture multi GPU texture handler, C++ 17/20 and more! (see 'Highlighted Features' for more info).**
2323

24-
### View code with vscode online:
24+
### View code with vscode online
25+
2526
- [![github1s](https://img.shields.io/badge/github1s-green.svg)](https://github1s.com/axmolengine/axmol)
2627
- [![vscode.dev](https://img.shields.io/badge/vscode.dev-green.svg)](https://vscode.dev/github/axmolengine/axmol)
2728

28-
2929
**[简体中文](README_CN.md)**
3030

3131
### Purpose Summary
32-
* C++ 17/20
33-
* Focuses on native game dev (easy to use, fast deployment, intuitive)
34-
* Bugfixes ASAP
32+
33+
- C++ 17/20
34+
- Focuses on native game dev (easy to use, fast deployment, intuitive)
35+
- Bugfixes ASAP
3536

3637
### Thirdparty
3738

38-
* All thirdparty prebuilt libs are built from https://github.com/axmolengine/buildware via github actions automatically.
39+
- All thirdparty prebuilt libs are built from <https://github.com/axmolengine/buildware> via github actions automatically.
3940

4041
### Highlighted Features
41-
* Add apple M1, android x64 support, contributed by @pietpukkel
42-
* Improve windows workflow, support linking with engine prebuilt libs, read [windows workflow guide](https://github.com/axmolengine/axmol/issues/564)
43-
* Windows video player support (based on microsoft media foundation)
44-
* Windows x64 build support
45-
* Reimplement HttpClient based on yasio for concorrent http requests processing.
46-
* ['Upstream-Version-License'](thirdparty/README.md) Third-party
47-
* Third-party license overview for easier publishing of your commercial apps based on axmol framework.
48-
* Some links to third party libs which support axmol too.
49-
* ['Upstream-Version-License'](extensions/README.md) Extensions
50-
* Extensions license overview for easier publishing of your commercial apps based on axmol framework.
51-
* Spine-3.8 support
52-
* ```FairyGUI``` support
53-
* DragonBones support
54-
* Live2D support
55-
* **ImGui integrated, easy to write game embedded tools, very easy to use, read [ImGui](extensions/ImGui/README.md) for more info**
56-
* Refactor AudioEngine, OpenAL for all platforms
57-
* [OpenAL Soft](https://github.com/kcat/openal-soft), pass -DAX_USE_ALSOFT=ON to cmake to force enabling it
58-
* [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.
59-
* Refactor UserDefault with [mio](https://github.com/mandreyel/mio)
60-
* Modularize all optional extensions, move from engine core folder to an extensions folder
61-
* Implement all .wav formats supported by ```OpenAL Soft```, such as MS-ADPCM, ADPCM, ...
62-
* Use a modern GL loader ```Glad```
63-
* Google [angle](https://github.com/google/angle) renderer backend support
64-
* C++ 17/20
65-
* IOS/TVOS SDK 9.0 as minimal deployment
66-
* Use fast pugixml
67-
* Use [curl](https://github.com/curl/curl) for transferring data with URL syntax
68-
* Use SAX parser for all plist files
69-
* ASTC 4x4/6x6/8x8 support (if hardware decoding is not supported, then software decoding is used)
70-
* ETC2 RGB/RGBA support (if hardware decoding is not supported, then software decoding is used)
71-
* Supported 2D physics engines (see also [APPENDIX.md](APPENDIX.md)):
72-
* Box2D
73-
* Box2D-optimized
74-
* Chipmunk2D
75-
* Supported 3D physics engines:
76-
* Bullet Physics SDK
42+
43+
- Add apple M1, android x64 support, contributed by @pietpukkel
44+
- Improve windows workflow, support linking with engine prebuilt libs, read [windows workflow guide](https://github.com/axmolengine/axmol/issues/564)
45+
- Windows video player support (based on microsoft media foundation)
46+
- Windows x64 build support
47+
- Reimplement HttpClient based on yasio for concorrent http requests processing.
48+
- ['Upstream-Version-License'](thirdparty/README.md) Third-party
49+
- Third-party license overview for easier publishing of your commercial apps based on axmol framework.
50+
- Some links to third party libs which support axmol too.
51+
- ['Upstream-Version-License'](extensions/README.md) Extensions
52+
- Extensions license overview for easier publishing of your commercial apps based on axmol framework.
53+
- Spine-3.8 support
54+
- ```FairyGUI``` support
55+
- DragonBones support
56+
- Live2D support
57+
- **ImGui integrated, easy to write game embedded tools, very easy to use, read [ImGui](extensions/ImGui/README.md) for more info**
58+
- Refactor AudioEngine, OpenAL for all platforms
59+
- [OpenAL Soft](https://github.com/kcat/openal-soft), pass -DAX_USE_ALSOFT=ON to cmake to force enabling it
60+
- [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.
61+
- Refactor UserDefault with [mio](https://github.com/mandreyel/mio)
62+
- Modularize all optional extensions, move from engine core folder to an extensions folder
63+
- Implement all .wav formats supported by ```OpenAL Soft```, such as MS-ADPCM, ADPCM, ...
64+
- Use a modern GL loader ```Glad```
65+
- Google [angle](https://github.com/google/angle) renderer backend support
66+
- C++ 17/20
67+
- IOS/TVOS SDK 9.0 as minimal deployment
68+
- Use fast pugixml
69+
- Use [curl](https://github.com/curl/curl) for transferring data with URL syntax
70+
- Use SAX parser for all plist files
71+
- ASTC 4x4/6x6/8x8 support (if hardware decoding is not supported, then software decoding is used)
72+
- ETC2 RGB/RGBA support (if hardware decoding is not supported, then software decoding is used)
73+
- Supported 2D physics engines (see also [APPENDIX.md](APPENDIX.md)):
74+
- Box2D
75+
- Box2D-optimized
76+
- Chipmunk2D
77+
- Supported 3D physics engines:
78+
- Bullet Physics SDK
7779

7880
[Read Full changes since cocos2d-x-4.0](CHANGELOG)
7981

@@ -82,13 +84,16 @@ Open [APPENDIX.md](APPENDIX.md) for additional information and see [Milestones](
8284
### Quick Start
8385

8486
#### Common Requirement [Python](https://www.python.org/downloads/)
85-
* Python-2.7.17+, Python-3.7+
87+
88+
- Python-2.7.17+, Python-3.7+
8689

8790
#### Prerequisites
91+
8892
1. Enter `axmol` root directory
8993
2. Run `python setup.py`, restart the console after it has finished for environment variables to take effect
9094

9195
#### Creating A New Project
96+
9297
Using a console window, the command to generate a new project is as follows:
9398

9499
```axmol new -p YOUR.UNIQUE.ID -d PROJECT_PATH -l [cpp|lua]```
@@ -99,14 +104,15 @@ Examples:
99104
- Lua: `axmol new -p org.axmol.hellolua -d D:\dev\projects\ -l lua --portrait HelloLua`
100105

101106
#### Windows (64/32 bit Visual Studio 2019/2022)
107+
102108
1. Install [CMake](https://cmake.org/) 3.22.1+
103109
2. Install Visual Studio 2019/2022 (it's recommended that you only use these versions)
104110
3. Create a new project as shown [here](#creating-a-new-project)
105111
4. In a console window, navigate into the root directory of the project you created in the previous step
106112
5. Generate the relevant Visual Studio project using the cmake command:
107113

108114
```cmake -S SOURCE_DIR -B BUILD_DIR -G VISUAL_STUDIO_VERSION_STRING -A [Win32|x64]```
109-
115+
110116
For example, say `SOURCE_DIR` is the current path `"."`, and `BUILD_DIR` (out-of-source build directory) is named `"build"`:
111117

112118
a) C++ 20:
@@ -118,19 +124,20 @@ Examples:
118124
```cmake -S . -B build -G "Visual Studio 17 2022" -A Win32```
119125
- for 64 bit Visual Studio 2022:
120126
```cmake -S . -B build -G "Visual Studio 17 2022" -A x64```
121-
127+
122128
b) C++17
123-
- add `-DCXX_STD=17` for C++17 on your command line like:
124-
cmake -S . -B build `-DCXX_STD=17` -G "Visual Studio 17 2022" -A x64
125-
129+
- add `-DCMAKE_CXX_STANDARD=17` for C++17 on your command line like:
130+
cmake -S . -B build `-DCMAKE_CXX_STANDARD=17` -G "Visual Studio 17 2022" -A x64
131+
126132
6. Use Visual Studio to open the newly created solution file. For example, `./build/ProjectName.sln`
127133

128-
##### Creating the Visual Studio solution for all axmol test projects:
134+
##### Creating the Visual Studio solution for all axmol test projects
135+
129136
1. Open a console window (Command Prompt, Window Terminal or Powershell)
130137
2. Navigate into the folder where axmol is installed. For example:
131-
138+
132139
```cd axmol```
133-
140+
134141
3. Run one of the following commands to create the Visual Studio solution for all axmol test projects in a folder named `build`:
135142

136143
a) C++ 20:
@@ -142,36 +149,40 @@ Examples:
142149
```cmake -S . -B build -G "Visual Studio 17 2022" -A Win32```
143150
- for 64 bit Visual Studio 2022:
144151
```cmake -S . -B build -G "Visual Studio 17 2022" -A x64```
145-
152+
146153
b) C++17
147-
- add `-DCXX_STD=17` for C++17 on your command line like:
148-
cmake -S . -B build `-DCXX_STD=17` -G "Visual Studio 17 2022" -A x64
154+
- add `-DCMAKE_CXX_STANDARD=17` for C++17 on your command line like:
155+
cmake -S . -B build `-DCMAKE_CXX_STANDARD=17` -G "Visual Studio 17 2022" -A x64
149156

150157
4. You may either open the solution (".\build\axmol.sln") in Visual Studio and build any of the test projects via the IDE, or alternatively, build a project on the command line as follows (e.g. cpp-tests):
151158
`msbuild .\build\axmol.sln -target:cpp_tests -maxCpuCount`
152-
159+
153160
#### Improve 'Visual Studio' workflow, support linking with engine prebuilt libs
161+
154162
See [windows workflow guide](https://github.com/axmolengine/axmol/issues/564)
155163

156164
#### Android
157165

158166
##### With Android Studio
167+
159168
1. Install Android Studio 2021.1.1+
160169
2. When starting Android Studio for the first time, it will guide you to install the SDK and other tools, so ensure that you do install them.
161170
3. Start Android and choose [Open an existing Android Studio Project] and select your project. For example, the existing cpp-test project located in ```axmol\tests\cpp-tests\proj.android```
162171
4. Start Android Studio and Open [Tools][SDKManager], then switch to ```SDK Tools```, check the ```Show Package Details```, choose the following tools and click the button ```Apply``` to install them:
163-
* Android SDK Platform 33
164-
* Android Gradle Plugin (AGP) 7.2.2
165-
* Android SDK Build-Tools 30.0.3 match with AGP, refer to: https://developer.android.com/studio/releases/gradle-plugin
166-
* Gradle 7.4.2
167-
* NDK r23c+
168-
* CMake 3.22.1+
172+
- Android SDK Platform 33
173+
- Android Gradle Plugin (AGP) 7.2.2
174+
- Android SDK Build-Tools 30.0.3 match with AGP, refer to: <https://developer.android.com/studio/releases/gradle-plugin>
175+
- Gradle 7.4.2
176+
- NDK r23c+
177+
- CMake 3.22.1+
169178
5. Wait for ```Gradle sync``` finish.
170-
6. Note: If you use non-sdk provided CMake edition, you will need to download ```ninja``` from https://github.com/ninja-build/ninja/releases, and copy ```ninja.exe``` to cmake's bin directory
179+
6. Note: If you use non-sdk provided CMake edition, you will need to download ```ninja``` from <https://github.com/ninja-build/ninja/releases>, and copy ```ninja.exe``` to cmake's bin directory
171180

172181
##### Without Android Studio
173-
1. Download command-tools from https://developer.android.com/studio#command-tools
182+
183+
1. Download command-tools from <https://developer.android.com/studio#command-tools>
174184
2. Install Android devtools (for example in windows)
185+
175186
```bat
176187
# unzip command-tools at D:\dev\adt\
177188
# Install android devtools
@@ -185,10 +196,11 @@ See [windows workflow guide](https://github.com/axmolengine/axmol/issues/564)
185196
```
186197

187198
#### iOS, tvOS and macOS
199+
188200
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```
189201
2. Create a new project as shown [here](#creating-a-new-project)
190202
3. In a console window, navigate into the root directory of the project you created in the previous step
191-
4. Execute the following command
203+
4. Execute the following command
192204
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
193205
5. Generate the relevant xcode project using one of the following commands:
194206
- for ios arm64:
@@ -212,19 +224,23 @@ See [windows workflow guide](https://github.com/axmolengine/axmol/issues/564)
212224
- **axmol only provides armv7, arm64, x86_64 prebuilt libraries for ios/tvos**
213225

214226
### Some interesting related projects based on axmol
215-
https://github.com/axmolengine/axmol/discussions/694
227+
228+
<https://github.com/axmolengine/axmol/discussions/694>
216229

217230
### Notes
218-
* ThreadLocalStorage (TLS)
219-
- ios x86 simulator ios>=10 and axmol no longer provide x86 libraries
220-
- ios x64 or devices (armv7, arm64) ios sdk>=9.0
221-
- the 'OpenAL Soft' maintained by kcat uses TLS
231+
232+
- ThreadLocalStorage (TLS)
233+
- ios x86 simulator ios>=10 and axmol no longer provide x86 libraries
234+
- ios x64 or devices (armv7, arm64) ios sdk>=9.0
235+
- the 'OpenAL Soft' maintained by kcat uses TLS
222236

223237
### Reference links
224-
* Official Cocos2d-x Repo: https://github.com/cocos2d/cocos2d-x
238+
239+
- Official Cocos2d-x Repo: <https://github.com/cocos2d/cocos2d-x>
225240

226241
### Contributing guide
227-
https://github.com/axmolengine/axmol/discussions/411
242+
243+
<https://github.com/axmolengine/axmol/discussions/411>
228244

229245
### The axmol Active Stats
230246

cmake/Modules/AXBuildHelpers.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include(CMakeParseArguments)
22

33
# copy resource `FILES` and `FOLDERS` to TARGET_FILE_DIR/Resources
44
function(ax_copy_target_res ax_target)
5+
ax_def_copy_resource_target(${ax_target})
56
set(oneValueArgs LINK_TO)
67
set(multiValueArgs FOLDERS)
78
cmake_parse_arguments(opt "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -345,10 +346,6 @@ function(setup_ax_app_config app_name)
345346
ax_config_app_xcode_property(${app_name})
346347
endif()
347348

348-
if(LINUX OR WINDOWS)
349-
ax_def_copy_resource_target(${app_name})
350-
endif()
351-
352349
if(BUILD_SHARED_LIBS)
353350
target_compile_definitions(${app_name} PRIVATE SPINEPLUGIN_API=DLLIMPORT) # spine dll
354351
endif()

cmake/Modules/AXBuildSet.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ endif()
1616

1717
find_program(PYTHON_COMMAND NAMES python3 python2 python)
1818
find_program(_AX_COMMAND NAME axmol
19-
PATHS ${_AX_ROOT_PATH}/tools/axmol-console/bin $ENV{_AX_CONSOLE_ROOT})
19+
PATHS ${_AX_ROOT_PATH}/tools/console/bin $ENV{AX_CONSOLE_ROOT})
2020

2121
message(STATUS "PROJECT_NAME:" ${PROJECT_NAME})
2222
message(STATUS "PROJECT_SOURCE_DIR:" ${PROJECT_SOURCE_DIR})

0 commit comments

Comments
 (0)