Merge branch '3.8' into 3.9-beta

This commit is contained in:
badlogic 2019-12-12 14:41:18 +01:00
commit ebe44b0e13
355 changed files with 25235 additions and 7164 deletions

View File

@ -99,6 +99,33 @@ cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-cocos2dx/examp
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-cocos2dx/example/Resources/common/" cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-cocos2dx/example/Resources/common/" cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-cocos2dx/example/Resources/common/"
rm "$ROOT/spine-cocos2dx/example-v4/Resources/common/"*
cp -f ../coin/export/coin-pro.skel "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../coin/export/coin.atlas "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../coin/export/coin.png "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../goblins/export/goblins-pro.json "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../goblins/export/goblins.atlas "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../goblins/export/goblins.png "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../tank/export/tank-pro.skel "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../tank/export/tank.atlas "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../tank/export/tank.png "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-cocos2dx/example-v4/Resources/common/"
echo "spine-corona" echo "spine-corona"
rm "$ROOT/spine-corona/data/"* rm "$ROOT/spine-corona/data/"*
cp -f ../coin/export/coin-pro.json "$ROOT/spine-corona/data" cp -f ../coin/export/coin-pro.json "$ROOT/spine-corona/data"

View File

@ -1,17 +1,61 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 3.6)
project(spine-cocos2dx-example)
set(EXAMPLE_DIR "${CMAKE_CURRENT_LIST_DIR}/example") set(EXAMPLE_DIR "${CMAKE_CURRENT_LIST_DIR}/example")
option(USE_COCOS2DX_V4 "Use cocos2d-x version 4.0+" OFF)
if(USE_COCOS2DX_V4)
set(COCOS_FOLDER_NAME "cocos2d-x-4.0")
set(COCOS_DOWNLOAD_URL "https://download.cocos.com/Cocos2D-X/${COCOS_FOLDER_NAME}.zip")
set(COCOS_SHORT_VERSION "v4")
set(EXAMPLE_DIR "${CMAKE_CURRENT_LIST_DIR}/example-v4")
else()
set(COCOS_FOLDER_NAME "cocos2d-x-3.17.2")
set(COCOS_DOWNLOAD_URL "http://download.cocos.com/Cocos2D-X/${COCOS_FOLDER_NAME}.zip")
set(COCOS_SHORT_VERSION "v3")
endif()
if((NOT ${COCOS_CURRENT_VERSION} STREQUAL ${COCOS_SHORT_VERSION}) AND (NOT ${COCOS_CURRENT_VERSION} STREQUAL ""))
message(STATUS "Target Cocos2d-x version ${COCOS_SHORT_VERSION}, current ${COCOS_CURRENT_VERSION}")
message(STATUS "remove current folder ${EXAMPLE_DIR}/cocos2d")
file(REMOVE_RECURSE ${EXAMPLE_DIR}/cocos2d ${EXAMPLE_DIR}/cocos2dx.zip)
endif()
if (NOT EXISTS ${EXAMPLE_DIR}/cocos2d) if (NOT EXISTS ${EXAMPLE_DIR}/cocos2d)
message("Downloading cocos2dx, this may take some time!")
file(DOWNLOAD "https://digitalocean.cocos2d-x.org/Cocos2D-X/cocos2d-x-3.17.2.zip" "${EXAMPLE_DIR}/cocos2dx.zip") if(NOT EXISTS ${EXAMPLE_DIR}/cocos2dx.zip)
message(STATUS "Downloading cocos2dx ${COCOS_SHORT_VERSION}, this may take some time!")
# download cocos2d-x package
file(DOWNLOAD ${COCOS_DOWNLOAD_URL} "${EXAMPLE_DIR}/cocos2dx.zip" SHOW_PROGRESS)
else()
message(STATUS "${EXAMPLE_DIR}/cocos2dx.zip found!")
endif()
# untar
message(STATUS "untar ${EXAMPLE_DIR}/cocos2dx.zip ...")
execute_process( execute_process(
COMMAND ${CMAKE_COMMAND} -E tar x ${EXAMPLE_DIR}/cocos2dx.zip COMMAND ${CMAKE_COMMAND} -E tar x ${EXAMPLE_DIR}/cocos2dx.zip
WORKING_DIRECTORY ${EXAMPLE_DIR} WORKING_DIRECTORY ${EXAMPLE_DIR}
) )
# rename folder
execute_process( execute_process(
COMMAND ${CMAKE_COMMAND} -E rename COMMAND ${CMAKE_COMMAND} -E rename
"${EXAMPLE_DIR}/cocos2d-x-3.17.2" "${EXAMPLE_DIR}/cocos2d" "${EXAMPLE_DIR}/${COCOS_FOLDER_NAME}" "${EXAMPLE_DIR}/cocos2d"
) )
set(COCOS_CURRENT_VERSION ${COCOS_SHORT_VERSION} CACHE STRING "update current version" FORCE)
# remove spine source code in cocos2d-x's source tree
execute_process( execute_process(
COMMAND ${CMAKE_COMMAND} -E remove_directory "${EXAMPLE_DIR}/cocos2d/cocos/editor-support/spine" COMMAND ${CMAKE_COMMAND} -E remove_directory "${EXAMPLE_DIR}/cocos2d/cocos/editor-support/spine"
COMMAND ${CMAKE_COMMAND} -E make_directory "${EXAMPLE_DIR}/cocos2d/cocos/editor-support/spine"
) )
else()
message(STATUS "${EXAMPLE_DIR}/cocos2d is already exists, current version ${COCOS_SHORT_VERSION}.")
endif()
if(USE_COCOS2DX_V4)
add_subdirectory("${EXAMPLE_DIR}")
endif() endif()

View File

@ -1,4 +1,4 @@
# spine-cocos2dx v3.x # spine-cocos2dx v3.x & v4.x
The spine-cocos2dx runtime provides functionality to load, manipulate and render [Spine](http://esotericsoftware.com) skeletal animation data using [cocos2d-x](http://www.cocos2d-x.org/). spine-cocos2dx is based on [spine-cpp](../spine-cpp). The spine-cocos2dx runtime provides functionality to load, manipulate and render [Spine](http://esotericsoftware.com) skeletal animation data using [cocos2d-x](http://www.cocos2d-x.org/). spine-cocos2dx is based on [spine-cpp](../spine-cpp).
@ -22,17 +22,27 @@ spine-cocos2dx supports all Spine features.
The setup for cocos2d-x differs from most other Spine Runtimes because the cocos2d-x distribution includes a copy of the Spine Runtime files. This is not ideal because these files may be old and fail to work with the latest Spine editor. Also it means if cocos2d-x is updated, you may get newer Spine Runtime files which can break your application if you are not using the latest Spine editor. For these reasons, we have requested cocos2d-x to cease distributing the Spine Runtime files, but they continue to do so. The following instructions allow you to use the official Spine cocos2d-x runtime with your cocos2d-x project. The setup for cocos2d-x differs from most other Spine Runtimes because the cocos2d-x distribution includes a copy of the Spine Runtime files. This is not ideal because these files may be old and fail to work with the latest Spine editor. Also it means if cocos2d-x is updated, you may get newer Spine Runtime files which can break your application if you are not using the latest Spine editor. For these reasons, we have requested cocos2d-x to cease distributing the Spine Runtime files, but they continue to do so. The following instructions allow you to use the official Spine cocos2d-x runtime with your cocos2d-x project.
1. Create a new cocos2d-x project. See [the cocos2d-x documentation](http://www.cocos2d-x.org/docs/static-pages/installation.html) ### Cocos2d-x v3.x
1. Create a new cocos2d-x project. See [the cocos2d-x documentation](https://docs.cocos2d-x.org/cocos2d-x/v3/en/installation/)
2. Delete the folder `cocos2d/cocos/editor-support/spine`. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x. 2. Delete the folder `cocos2d/cocos/editor-support/spine`. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x.
3. Open your project in your IDE of choice, then open the cocos2d_libs sub project and delete the `editor-support/spine` group. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x from your build. 3. Open your project in your IDE of choice, then open the cocos2d_libs sub project and delete the `editor-support/spine` group. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x from your build.
3. Download the Spine Runtimes source using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above. 3. Download the Spine Runtimes source using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above.
4. Add the sources from `spine-cpp/spine-cpp/src/spine` and `spine-cocos2dx/src/spine` to your project 4. Add the sources from `spine-cpp/spine-cpp/src/spine` and `spine-cocos2dx/src/spine` to your project
4. Add the folders `spine-cpp/spine-cpp/include` and `spine-cocos2dx/src` to your header search path. Note that includes are specified as `#inclue <spine/file.h>`, so the `spine` directory cannot be omitted when copying the source files. 4. Add the folders `spine-cpp/spine-cpp/include` and `spine-cocos2dx/src` to your header search path. Note that includes are specified as `#inclue <spine/file.h>`, so the `spine` directory cannot be omitted when copying the source files.
### Cocos2d-x v4.x
TBD
1. Create a new Cocos2D-x project. See [the cocos2d-x documentation](https://docs.cocos2d-x.org/cocos2d-x/v4/en/installation/)
2. Delete the folder `cocos2d/cocos/editor-support/spine` in your project. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x.
3. TBD Integration in `CMakeLists.txt`
## Example ## Example
The Spine cocos2d-x example works on Windows, Mac OS X, iOS and Android. The Spine cocos2d-x example works on Windows, Mac OS X, iOS and Android.
### Windows ### Cocos2d-x v3.x
#### Windows
1. Install [Visual Studio 2019 Community](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx) 1. Install [Visual Studio 2019 Community](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx)
2. Install CMake via the [Windows installer package](https://cmake.org/download/). 2. Install CMake via the [Windows installer package](https://cmake.org/download/).
3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above. 3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above.
@ -47,7 +57,7 @@ The Spine cocos2d-x example works on Windows, Mac OS X, iOS and Android.
9. Right click the `spine-cocos2d-x` project in the solution explorer and select `Set as Startup Project` from the context menu 9. Right click the `spine-cocos2d-x` project in the solution explorer and select `Set as Startup Project` from the context menu
10. Click `Local Windows Debugger` to run the example 10. Click `Local Windows Debugger` to run the example
### macOS/iOS #### macOS/iOS
1. Install [Xcode](https://developer.apple.com/xcode/) 1. Install [Xcode](https://developer.apple.com/xcode/)
2. Install [Homebrew](http://brew.sh/) 2. Install [Homebrew](http://brew.sh/)
3. Open a terminal and install CMake via `brew install cmake` 3. Open a terminal and install CMake via `brew install cmake`
@ -58,7 +68,7 @@ The Spine cocos2d-x example works on Windows, Mac OS X, iOS and Android.
7. Expand the `cocos2d_libs.xcodeproj` sub project, delete the group `editor-support/spine`. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x. 7. Expand the `cocos2d_libs.xcodeproj` sub project, delete the group `editor-support/spine`. This will remove the outdated Spine cocos2d-x runtime shipped by cocos2d-x.
8. Click the `Run` button or type `CMD+R` to run the example 8. Click the `Run` button or type `CMD+R` to run the example
### Android #### Android (on macOS)
1. Install the prerequisits for [cocos2d-x Android development](http://www.cocos2d-x.org/docs/installation/Android-terminal/) 1. Install the prerequisits for [cocos2d-x Android development](http://www.cocos2d-x.org/docs/installation/Android-terminal/)
2. Install [Homebrew](http://brew.sh/) 2. Install [Homebrew](http://brew.sh/)
3. Open a terminal and install CMake via `brew install cmake` 3. Open a terminal and install CMake via `brew install cmake`
@ -71,13 +81,53 @@ The Spine cocos2d-x example works on Windows, Mac OS X, iOS and Android.
9. In the same directory, execute `cocos run -p android -m debug` to deploy to the device 9. In the same directory, execute `cocos run -p android -m debug` to deploy to the device
10. For debugging, run `ndk-debug` in the `proj.android/jni` folder. This will attach to the running app via GDB. 10. For debugging, run `ndk-debug` in the `proj.android/jni` folder. This will attach to the running app via GDB.
### Cocos2d-x v4.x
#### Windows
1. Install [Visual Studio 2019 Community](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx)
2. Install CMake via the [Windows installer package](https://cmake.org/download/).
3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above.
4. Run CMake GUI from the start menu
5. Click `Browse Source` and select the directory `spine-runtimes`
6. Click `Browse Build` and select the `spine-runtimes/spine-cocos2dx/build` directory. You can create the `build` folder directly in the file dialog via `New Folder`.
7. Click `Configure`. Check `SPINE_COCOS2D_X`
8. Click `Configure` again. This will download the cocos2d-x dependency and wire it up with the example source code in `spine-runtimes/spine-cocos2dx/example`. The download is 400mb, so get yourself a cup of tea.
7. Open the file `spine-cocos2dx\example\cocos2d\cocos\2d\cocos2dx.props` and remove the `libSpine.lib` entry from the `<AdditionalDependencies>` tag.
8. Open the `spine-runtimes/spine-cocos2dx/example/proj.win32/spine-cocos2d-x.sln` file in Visual Studio 2019. Visual Studio may ask you to install the Windows XP/7 SDK, which you should install.
9. Expand `References` of the libcocos2d sub project, and remove the entry for `libSpine`, which should be marked with an error.
9. Right click the `spine-cocos2d-x` project in the solution explorer and select `Set as Startup Project` from the context menu
10. Click `Local Windows Debugger` to run the example
#### macOS
1. Install [Xcode](https://developer.apple.com/xcode/)
2. Install [Homebrew](http://brew.sh/)
3. Open a terminal and install CMake via `brew install cmake`
3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above.
4. Open a terminal, and `cd` into the `spine-runtimes/spine-cocos2dx` folder
5. Type `mkdir build-v4 && cd build-v4 && cmake -GXcode -DUSE_COCOS2DX_V4=on ..`. This will download the cocos2d-x dependency and wire it up with the example source code in `spine-runtimes/spine-cocos2dx/example`. The download is 400mb, so get yourself a cup of tea.
6. Open the Xcode project in `spine-runtimes/spine-cocos2dx/build-v4`
7. Make sure you select `spine-cocos2dx-example > My Mac` as the target and click the `Run` button or type `CMD+R` to run the example.
#### iOS
1. Install [Xcode](https://developer.apple.com/xcode/)
2. Install [Homebrew](http://brew.sh/)
3. Open a terminal and install CMake via `brew install cmake`
3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above.
4. Open a terminal, and `cd` into the `spine-runtimes/spine-cocos2dx` folder
5. Type `mkdir build-v4 && cd build-v4 && cmake -GXcode -DUSE_COCOS2DX_V4=on -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos ..`. This will download the cocos2d-x dependency and wire it up with the example source code in `spine-runtimes/spine-cocos2dx/example`. The download is 400mb, so get yourself a cup of tea.
6. Open the Xcode project in `spine-runtimes/spine-cocos2dx/build-v4`
7. Make sure you select `spine-cocos2dx-example > Device` as the target, where `Device` is either a simulator or a physically connected device. Click the `Run` button or type `CMD+R` to run the example.
#### Android (on macOS)
1. Install the prerequisits for [cocos2d-x Android development](http://www.cocos2d-x.org/docs/installation/Android-terminal/)
2. Install [Homebrew](http://brew.sh/)
3. Open a terminal and install CMake via `brew install cmake`
3. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip via the download button above.
4. Open a terminal, and `cd` into the `spine-runtimes/spine-cocos2dx` folder
5. Type `mkdir build-v4 && cd build-v4 && cmake -DUSE_COCOS2DX_V4=on ..`. This will download the cocos2d-x dependency and wire it up with the example source code in `spine-runtimes/spine-cocos2dx/example`. The download is 400mb, so get yourself a cup of tea.
6. Execute `cocos run -s . -p android`, this will build, deploy and run the APK on a connected device.
## Notes ## Notes
* Images are premultiplied by cocos2d-x, so the Spine atlas images should *not* use premultiplied alpha. * Images are premultiplied by cocos2d-x, so the Spine atlas images should *not* use premultiplied alpha.
* Two color tinting needs to be enabled on a per-skeleton basis. Call `SkeletonRenderer::setTwoColorTine(true)` or `SkeletonAnimation::setTwoColorTint(true)` after you created the skeleton instance. Note that two color tinting requires a custom shader and vertex format. Skeletons rendered with two color tinting can therefore not be batched with single color tinted skeletons or other 2D cocos2d-x elements like sprites. However, two-color tinted skeletons will be batched if possible when rendered after one another. Attaching a child to a two color tinted skeleton will also break the batch. * Two color tinting needs to be enabled on a per-skeleton basis. Call `SkeletonRenderer::setTwoColorTine(true)` or `SkeletonAnimation::setTwoColorTint(true)` after you created the skeleton instance. Note that two color tinting requires a custom shader and vertex format. Skeletons rendered with two color tinting can therefore not be batched with single color tinted skeletons or other 2D cocos2d-x elements like sprites. However, two-color tinted skeletons will be batched if possible when rendered after one another. Attaching a child to a two color tinted skeleton will also break the batch.
## Examples
- [Raptor](example/Classes/RaptorExample.cpp)
- [Spineboy](example/Classes/SpineboyExample.cpp)
- [Golbins](example/Classes/GoblinsExample.cpp)

View File

@ -0,0 +1,4 @@
{
"engine_version": "cocos2d-x-4.0",
"project_type": "cpp"
}

View File

@ -0,0 +1,169 @@
#/****************************************************************************
# Copyright (c) 2013-2014 cocos2d-x.org
# Copyright (c) 2015-2017 Chukong Technologies Inc.
#
# http://www.cocos2d-x.org
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ****************************************************************************/
cmake_minimum_required(VERSION 3.6)
set(APP_NAME spine-cocos2dx-example)
project(${APP_NAME})
if(XCODE)
if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET)
SET (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 8.0)
endif()
endif()
if(NOT DEFINED BUILD_ENGINE_DONE) # to test spine-cocos2dx-example into root project
set(COCOS2DX_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cocos2d)
set(CMAKE_MODULE_PATH ${COCOS2DX_ROOT_PATH}/cmake/Modules/)
include(CocosBuildSet)
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos ${ENGINE_BINARY_PATH}/cocos/core)
endif()
# Add spine-cpp library
file(GLOB SPINE_CPP_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/../../spine-cpp/spine-cpp/include/**/*.h")
file(GLOB SPINE_CPP_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/../../spine-cpp/spine-cpp/src/**/*.cpp")
add_library(spine-cpp STATIC ${SPINE_CPP_SOURCE} ${SPINE_CPP_HEADER})
target_include_directories(spine-cpp PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../spine-cpp/spine-cpp/include/")
# Add spine-cocos2dx library
file(GLOB_RECURSE SPINE_COCOS2DX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/../src/**/*.h")
file(GLOB_RECURSE SPINE_COCOS2DX_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/../src/**/*.cpp")
add_library(spine-cocos2dx STATIC ${SPINE_COCOS2DX_SOURCE} ${SPINE_COCOS2DX_HEADER})
target_include_directories(spine-cocos2dx PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../spine-cpp/spine-cpp/include/")
target_include_directories(spine-cocos2dx PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../src/")
target_link_libraries(spine-cocos2dx PRIVATE cocos2d)
# record sources, headers, resources...
set(GAME_RES_FOLDER
"${CMAKE_CURRENT_SOURCE_DIR}/../example/Resources"
)
if(APPLE OR WINDOWS)
cocos_mark_multi_resources(common_res_files RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
endif()
# add cross-platforms source files and header files
file(GLOB_RECURSE GAME_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/../example/Classes/*.cpp")
file(GLOB_RECURSE GAME_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/../example/Classes/*.h")
set(GAME_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/../example/Classes")
if(ANDROID)
# change APP_NAME to the share library name for Android, it's value depend on AndroidManifest.xml
set(APP_NAME MyGame)
list(APPEND GAME_SOURCE
proj.android/app/jni/hellocpp/main.cpp
)
elseif(LINUX)
list(APPEND GAME_SOURCE
proj.linux/main.cpp
)
elseif(WINDOWS)
list(APPEND GAME_HEADER
proj.win32/main.h
proj.win32/resource.h
)
list(APPEND GAME_SOURCE
proj.win32/main.cpp
proj.win32/game.rc
${common_res_files}
)
elseif(APPLE)
if(IOS)
list(APPEND GAME_HEADER
proj.ios_mac/ios/AppController.h
proj.ios_mac/ios/RootViewController.h
)
set(APP_UI_RES
proj.ios_mac/ios/LaunchScreen.storyboard
proj.ios_mac/ios/LaunchScreenBackground.png
proj.ios_mac/ios/Images.xcassets
)
list(APPEND GAME_SOURCE
proj.ios_mac/ios/main.m
proj.ios_mac/ios/AppController.mm
proj.ios_mac/ios/RootViewController.mm
proj.ios_mac/ios/Prefix.pch
${APP_UI_RES}
)
elseif(MACOSX)
set(APP_UI_RES
proj.ios_mac/mac/Icon.icns
proj.ios_mac/mac/Info.plist
)
list(APPEND GAME_SOURCE
proj.ios_mac/mac/main.cpp
proj.ios_mac/mac/Prefix.pch
${APP_UI_RES}
)
endif()
list(APPEND GAME_SOURCE ${common_res_files})
endif()
# mark app complie info and libs info
set(all_code_files
${GAME_HEADER}
${GAME_SOURCE}
)
if(NOT ANDROID)
add_executable(${APP_NAME} ${all_code_files})
target_link_libraries(${APP_NAME} spine-cpp spine-cocos2dx)
else()
add_library(${APP_NAME} SHARED ${all_code_files})
add_subdirectory(${COCOS2DX_ROOT_PATH}/cocos/platform/android ${ENGINE_BINARY_PATH}/cocos/platform)
target_link_libraries(${APP_NAME} -Wl,--whole-archive cpp_android_spec -Wl,--no-whole-archive)
target_link_libraries(${APP_NAME} spine-cocos2dx)
target_link_libraries(${APP_NAME} spine-cpp)
endif()
target_link_libraries(${APP_NAME} cocos2d)
target_include_directories(${APP_NAME}
PRIVATE ${GAME_INCLUDE}
PRIVATE ${COCOS2DX_ROOT_PATH}/cocos/audio/include/
)
# mark app resources
setup_cocos_app_config(${APP_NAME})
if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist")
elseif(IOS)
set_xcode_property(${APP_NAME} INFOPLIST_FILE "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon")
endif()
# For code-signing, set the DEVELOPMENT_TEAM:
#set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "GRLXXXX2K9")
elseif(WINDOWS)
cocos_copy_target_dll(${APP_NAME})
endif()
if(LINUX OR WINDOWS)
cocos_get_resource_path(APP_RES_DIR ${APP_NAME})
cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()

View File

@ -0,0 +1,55 @@
coin.png
size: 1024,1024
format: RGBA8888
filter: Linear,Linear
repeat: none
coin-front-logo
rotate: false
xy: 2, 609
size: 305, 302
orig: 305, 302
offset: 0, 0
index: -1
coin-front-shine-logo
rotate: false
xy: 309, 629
size: 282, 282
orig: 282, 282
offset: 0, 0
index: -1
coin-front-shine-spineboy
rotate: false
xy: 2, 21
size: 282, 282
orig: 282, 282
offset: 0, 0
index: -1
coin-front-spineboy
rotate: false
xy: 2, 305
size: 305, 302
orig: 305, 302
offset: 0, 0
index: -1
coin-side-round
rotate: false
xy: 309, 345
size: 144, 282
orig: 144, 282
offset: 0, 0
index: -1
coin-side-straight
rotate: true
xy: 2, 2
size: 17, 282
orig: 17, 282
offset: 0, 0
index: -1
shine
rotate: false
xy: 593, 666
size: 72, 245
orig: 72, 245
offset: 0, 0
index: -1

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,293 @@
goblins.png
size: 1024,128
format: RGBA8888
filter: Linear,Linear
repeat: none
dagger
rotate: true
xy: 372, 100
size: 26, 108
orig: 26, 108
offset: 0, 0
index: -1
goblin/eyes-closed
rotate: false
xy: 2, 7
size: 34, 12
orig: 34, 12
offset: 0, 0
index: -1
goblin/head
rotate: false
xy: 107, 36
size: 103, 66
orig: 103, 66
offset: 0, 0
index: -1
goblin/left-arm
rotate: false
xy: 901, 56
size: 37, 35
orig: 37, 35
offset: 0, 0
index: -1
goblin/left-foot
rotate: false
xy: 929, 95
size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
goblin/left-hand
rotate: false
xy: 452, 2
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
goblin/left-lower-leg
rotate: true
xy: 713, 93
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
goblin/left-shoulder
rotate: false
xy: 610, 44
size: 29, 44
orig: 29, 44
offset: 0, 0
index: -1
goblin/left-upper-leg
rotate: true
xy: 638, 93
size: 33, 73
orig: 33, 73
offset: 0, 0
index: -1
goblin/neck
rotate: false
xy: 490, 2
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
goblin/pelvis
rotate: false
xy: 482, 45
size: 62, 43
orig: 62, 43
offset: 0, 0
index: -1
goblin/right-arm
rotate: true
xy: 690, 2
size: 23, 50
orig: 23, 50
offset: 0, 0
index: -1
goblin/right-foot
rotate: false
xy: 771, 58
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
goblin/right-hand
rotate: false
xy: 940, 56
size: 36, 37
orig: 36, 37
offset: 0, 0
index: -1
goblin/right-lower-leg
rotate: true
xy: 482, 90
size: 36, 76
orig: 36, 76
offset: 0, 0
index: -1
goblin/right-shoulder
rotate: true
xy: 602, 3
size: 39, 45
orig: 39, 45
offset: 0, 0
index: -1
goblin/right-upper-leg
rotate: true
xy: 641, 57
size: 34, 63
orig: 34, 63
offset: 0, 0
index: -1
goblin/torso
rotate: true
xy: 212, 34
size: 68, 96
orig: 68, 96
offset: 0, 0
index: -1
goblin/undie-straps
rotate: false
xy: 380, 5
size: 55, 19
orig: 55, 19
offset: 0, 0
index: -1
goblin/undies
rotate: false
xy: 174, 5
size: 36, 29
orig: 36, 29
offset: 0, 0
index: -1
goblingirl/eyes-closed
rotate: false
xy: 269, 11
size: 37, 21
orig: 37, 21
offset: 0, 0
index: -1
goblingirl/head
rotate: false
xy: 2, 21
size: 103, 81
orig: 103, 81
offset: 0, 0
index: -1
goblingirl/left-arm
rotate: true
xy: 978, 56
size: 37, 35
orig: 37, 35
offset: 0, 0
index: -1
goblingirl/left-foot
rotate: false
xy: 107, 3
size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
goblingirl/left-hand
rotate: false
xy: 565, 2
size: 35, 40
orig: 35, 40
offset: 0, 0
index: -1
goblingirl/left-lower-leg
rotate: true
xy: 785, 93
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
goblingirl/left-shoulder
rotate: true
xy: 690, 27
size: 28, 46
orig: 28, 46
offset: 0, 0
index: -1
goblingirl/left-upper-leg
rotate: true
xy: 857, 93
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
goblingirl/neck
rotate: false
xy: 528, 2
size: 35, 41
orig: 35, 41
offset: 0, 0
index: -1
goblingirl/pelvis
rotate: false
xy: 546, 45
size: 62, 43
orig: 62, 43
offset: 0, 0
index: -1
goblingirl/right-arm
rotate: false
xy: 452, 48
size: 28, 50
orig: 28, 50
offset: 0, 0
index: -1
goblingirl/right-foot
rotate: false
xy: 836, 58
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
goblingirl/right-hand
rotate: true
xy: 771, 20
size: 36, 37
orig: 36, 37
offset: 0, 0
index: -1
goblingirl/right-lower-leg
rotate: true
xy: 560, 90
size: 36, 76
orig: 36, 76
offset: 0, 0
index: -1
goblingirl/right-shoulder
rotate: false
xy: 649, 10
size: 39, 45
orig: 39, 45
offset: 0, 0
index: -1
goblingirl/right-upper-leg
rotate: true
xy: 706, 57
size: 34, 63
orig: 34, 63
offset: 0, 0
index: -1
goblingirl/torso
rotate: false
xy: 310, 2
size: 68, 96
orig: 68, 96
offset: 0, 0
index: -1
goblingirl/undie-straps
rotate: false
xy: 212, 13
size: 55, 19
orig: 55, 19
offset: 0, 0
index: -1
goblingirl/undies
rotate: false
xy: 810, 27
size: 36, 29
orig: 36, 29
offset: 0, 0
index: -1
shield
rotate: false
xy: 380, 26
size: 70, 72
orig: 70, 72
offset: 0, 0
index: -1
spear
rotate: true
xy: 2, 104
size: 22, 368
orig: 22, 368
offset: 0, 0
index: -1

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,272 @@
raptor.png
size: 1024,512
format: RGBA8888
filter: Linear,Linear
repeat: none
back-arm
rotate: false
xy: 895, 295
size: 46, 25
orig: 46, 25
offset: 0, 0
index: -1
back-bracer
rotate: true
xy: 992, 216
size: 39, 28
orig: 39, 28
offset: 0, 0
index: -1
back-hand
rotate: false
xy: 594, 58
size: 36, 34
orig: 36, 34
offset: 0, 0
index: -1
back-knee
rotate: true
xy: 729, 86
size: 49, 67
orig: 49, 67
offset: 0, 0
index: -1
back-thigh
rotate: false
xy: 379, 2
size: 39, 24
orig: 39, 24
offset: 0, 0
index: -1
eyes-open
rotate: true
xy: 902, 194
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front-arm
rotate: false
xy: 945, 306
size: 48, 26
orig: 48, 26
offset: 0, 0
index: -1
front-bracer
rotate: false
xy: 949, 197
size: 41, 29
orig: 41, 29
offset: 0, 0
index: -1
front-hand
rotate: false
xy: 949, 266
size: 41, 38
orig: 41, 38
offset: 0, 0
index: -1
front-open-hand
rotate: false
xy: 875, 148
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front-thigh
rotate: true
xy: 793, 171
size: 57, 29
orig: 57, 29
offset: 0, 0
index: -1
gun
rotate: true
xy: 379, 28
size: 107, 103
orig: 107, 103
offset: 0, 0
index: -1
gun-nohand
rotate: false
xy: 487, 87
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 807, 361
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
lower-leg
rotate: false
xy: 827, 195
size: 73, 98
orig: 73, 98
offset: 0, 0
index: -1
mouth-grind
rotate: true
xy: 920, 145
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-smile
rotate: true
xy: 992, 257
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
neck
rotate: false
xy: 359, 114
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
raptor-back-arm
rotate: false
xy: 653, 142
size: 82, 86
orig: 82, 86
offset: 0, 0
index: -1
raptor-body
rotate: false
xy: 2, 277
size: 632, 233
orig: 632, 233
offset: 0, 0
index: -1
raptor-front-arm
rotate: true
xy: 484, 4
size: 81, 102
orig: 81, 102
offset: 0, 0
index: -1
raptor-front-leg
rotate: false
xy: 2, 18
size: 191, 257
orig: 191, 257
offset: 0, 0
index: -1
raptor-hindleg-back
rotate: false
xy: 636, 295
size: 169, 215
orig: 169, 215
offset: 0, 0
index: -1
raptor-horn
rotate: false
xy: 195, 22
size: 182, 80
orig: 182, 80
offset: 0, 0
index: -1
raptor-horn-back
rotate: true
xy: 945, 334
size: 176, 77
orig: 176, 77
offset: 0, 0
index: -1
raptor-jaw
rotate: false
xy: 359, 137
size: 126, 138
orig: 126, 138
offset: 0, 0
index: -1
raptor-jaw-tooth
rotate: true
xy: 895, 322
size: 37, 48
orig: 37, 48
offset: 0, 0
index: -1
raptor-mouth-inside
rotate: true
xy: 949, 228
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
raptor-saddle-strap-back
rotate: true
xy: 653, 86
size: 54, 74
orig: 54, 74
offset: 0, 0
index: -1
raptor-saddle-strap-front
rotate: false
xy: 594, 94
size: 57, 95
orig: 57, 95
offset: 0, 0
index: -1
raptor-saddle-w-shadow
rotate: false
xy: 195, 104
size: 162, 171
orig: 162, 171
offset: 0, 0
index: -1
raptor-tail-shadow
rotate: false
xy: 636, 230
size: 189, 63
orig: 189, 63
offset: 0, 0
index: -1
raptor-tongue
rotate: false
xy: 807, 295
size: 86, 64
orig: 86, 64
offset: 0, 0
index: -1
stirrup-back
rotate: true
xy: 952, 151
size: 44, 35
orig: 44, 35
offset: 0, 0
index: -1
stirrup-front
rotate: false
xy: 902, 243
size: 45, 50
orig: 45, 50
offset: 0, 0
index: -1
stirrup-strap
rotate: false
xy: 824, 147
size: 49, 46
orig: 49, 46
offset: 0, 0
index: -1
torso
rotate: false
xy: 737, 137
size: 54, 91
orig: 54, 91
offset: 0, 0
index: -1
visor
rotate: false
xy: 487, 191
size: 131, 84
orig: 131, 84
offset: 0, 0
index: -1

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,286 @@
spineboy.png
size: 1024,256
format: RGBA8888
filter: Linear,Linear
repeat: none
crosshair
rotate: false
xy: 352, 7
size: 45, 45
orig: 45, 45
offset: 0, 0
index: -1
eye-indifferent
rotate: false
xy: 862, 105
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
eye-surprised
rotate: false
xy: 505, 79
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front-bracer
rotate: false
xy: 826, 66
size: 29, 40
orig: 29, 40
offset: 0, 0
index: -1
front-fist-closed
rotate: false
xy: 786, 65
size: 38, 41
orig: 38, 41
offset: 0, 0
index: -1
front-fist-open
rotate: true
xy: 710, 51
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front-foot
rotate: false
xy: 210, 6
size: 63, 35
orig: 63, 35
offset: 0, 0
index: -1
front-shin
rotate: true
xy: 665, 128
size: 41, 92
orig: 41, 92
offset: 0, 0
index: -1
front-thigh
rotate: true
xy: 2, 2
size: 23, 56
orig: 23, 56
offset: 0, 0
index: -1
front-upper-arm
rotate: false
xy: 250, 205
size: 23, 49
orig: 23, 49
offset: 0, 0
index: -1
goggles
rotate: false
xy: 665, 171
size: 131, 83
orig: 131, 83
offset: 0, 0
index: -1
gun
rotate: false
xy: 798, 152
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 2, 27
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
hoverboard-board
rotate: false
xy: 2, 178
size: 246, 76
orig: 246, 76
offset: 0, 0
index: -1
hoverboard-thruster
rotate: true
xy: 722, 96
size: 30, 32
orig: 30, 32
offset: 0, 0
index: -1
hoverglow-small
rotate: false
xy: 275, 81
size: 137, 38
orig: 137, 38
offset: 0, 0
index: -1
mouth-grind
rotate: false
xy: 614, 97
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-oooo
rotate: false
xy: 612, 65
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-smile
rotate: false
xy: 661, 64
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
muzzle-glow
rotate: false
xy: 382, 54
size: 25, 25
orig: 25, 25
offset: 0, 0
index: -1
muzzle-ring
rotate: true
xy: 275, 54
size: 25, 105
orig: 25, 105
offset: 0, 0
index: -1
muzzle01
rotate: true
xy: 911, 95
size: 67, 40
orig: 67, 40
offset: 0, 0
index: -1
muzzle02
rotate: false
xy: 792, 108
size: 68, 42
orig: 68, 42
offset: 0, 0
index: -1
muzzle03
rotate: true
xy: 956, 171
size: 83, 53
orig: 83, 53
offset: 0, 0
index: -1
muzzle04
rotate: false
xy: 275, 7
size: 75, 45
orig: 75, 45
offset: 0, 0
index: -1
muzzle05
rotate: false
xy: 140, 3
size: 68, 38
orig: 68, 38
offset: 0, 0
index: -1
neck
rotate: false
xy: 250, 182
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
portal-bg
rotate: false
xy: 140, 43
size: 133, 133
orig: 133, 133
offset: 0, 0
index: -1
portal-flare1
rotate: false
xy: 554, 65
size: 56, 30
orig: 56, 30
offset: 0, 0
index: -1
portal-flare2
rotate: true
xy: 759, 112
size: 57, 31
orig: 57, 31
offset: 0, 0
index: -1
portal-flare3
rotate: false
xy: 554, 97
size: 58, 30
orig: 58, 30
offset: 0, 0
index: -1
portal-shade
rotate: false
xy: 275, 121
size: 133, 133
orig: 133, 133
offset: 0, 0
index: -1
portal-streaks1
rotate: false
xy: 410, 126
size: 126, 128
orig: 126, 128
offset: 0, 0
index: -1
portal-streaks2
rotate: false
xy: 538, 129
size: 125, 125
orig: 125, 125
offset: 0, 0
index: -1
rear-bracer
rotate: false
xy: 857, 67
size: 28, 36
orig: 28, 36
offset: 0, 0
index: -1
rear-foot
rotate: false
xy: 663, 96
size: 57, 30
orig: 57, 30
offset: 0, 0
index: -1
rear-shin
rotate: true
xy: 414, 86
size: 38, 89
orig: 38, 89
offset: 0, 0
index: -1
rear-thigh
rotate: false
xy: 756, 63
size: 28, 47
orig: 28, 47
offset: 0, 0
index: -1
rear-upper-arm
rotate: true
xy: 60, 5
size: 20, 44
orig: 20, 44
offset: 0, 0
index: -1
torso
rotate: false
xy: 905, 164
size: 49, 90
orig: 49, 90
offset: 0, 0
index: -1

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

View File

@ -0,0 +1,174 @@
tank.png
size: 1024,1024
format: RGBA8888
filter: Linear,Linear
repeat: none
antenna
rotate: true
xy: 650, 857
size: 11, 152
orig: 11, 152
offset: 0, 0
index: -1
cannon
rotate: true
xy: 434, 376
size: 466, 29
orig: 466, 29
offset: 0, 0
index: -1
cannon-connector
rotate: true
xy: 349, 241
size: 56, 68
orig: 56, 68
offset: 0, 0
index: -1
ground
rotate: true
xy: 255, 330
size: 512, 177
orig: 512, 177
offset: 0, 0
index: -1
guntower
rotate: false
xy: 650, 870
size: 365, 145
orig: 365, 145
offset: 0, 0
index: -1
machinegun
rotate: false
xy: 255, 299
size: 166, 29
orig: 166, 29
offset: 0, 0
index: -1
machinegun-mount
rotate: true
xy: 2, 2
size: 36, 48
orig: 36, 48
offset: 0, 0
index: -1
rock
rotate: true
xy: 465, 552
size: 290, 64
orig: 290, 64
offset: 0, 0
index: -1
smoke-glow
rotate: false
xy: 531, 563
size: 50, 50
orig: 50, 50
offset: 0, 0
index: -1
smoke-puff01-bg
rotate: true
xy: 465, 458
size: 92, 62
orig: 92, 62
offset: 0, 0
index: -1
smoke-puff01-fg
rotate: false
xy: 115, 138
size: 88, 59
orig: 88, 59
offset: 0, 0
index: -1
smoke-puff02-fg
rotate: false
xy: 255, 235
size: 92, 62
orig: 92, 62
offset: 0, 0
index: -1
smoke-puff03-fg
rotate: false
xy: 531, 685
size: 92, 62
orig: 92, 62
offset: 0, 0
index: -1
smoke-puff04-fg
rotate: true
xy: 465, 378
size: 78, 48
orig: 78, 48
offset: 0, 0
index: -1
tank-bottom
rotate: true
xy: 115, 199
size: 643, 138
orig: 643, 138
offset: 0, 0
index: -1
tank-bottom-shadow
rotate: false
xy: 2, 844
size: 646, 171
orig: 646, 171
offset: 0, 0
index: -1
tank-top
rotate: true
xy: 2, 138
size: 704, 111
orig: 704, 111
offset: 0, 0
index: -1
tread
rotate: true
xy: 626, 794
size: 48, 15
orig: 48, 15
offset: 0, 0
index: -1
tread-inside
rotate: false
xy: 434, 360
size: 13, 14
orig: 13, 14
offset: 0, 0
index: -1
wheel-big
rotate: false
xy: 2, 40
size: 96, 96
orig: 96, 96
offset: 0, 0
index: -1
wheel-big-overlay
rotate: false
xy: 531, 749
size: 93, 93
orig: 93, 93
offset: 0, 0
index: -1
wheel-mid
rotate: false
xy: 100, 68
size: 68, 68
orig: 68, 68
offset: 0, 0
index: -1
wheel-mid-overlay
rotate: false
xy: 531, 615
size: 68, 68
orig: 68, 68
offset: 0, 0
index: -1
wheel-small
rotate: false
xy: 205, 161
size: 36, 36
orig: 36, 36
offset: 0, 0
index: -1

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 KiB

View File

@ -0,0 +1,8 @@
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
/.externalNativeBuild

View File

@ -0,0 +1,2 @@
/build
/.externalNativeBuild

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.esotericsoftware.spine"
android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:glEsVersion="0x00020000" />
<application
android:label="@string/app_name"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher">
<!-- Tell Cocos2dxActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="MyGame" />
<activity
android:name="org.cocos2dx.cpp.AppActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:taskAffinity="" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,97 @@
import org.gradle.internal.os.OperatingSystem
apply plugin: 'com.android.application'
android {
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
defaultConfig {
applicationId "com.esotericsoftware.spine"
minSdkVersion PROP_MIN_SDK_VERSION
targetSdkVersion PROP_TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
externalNativeBuild {
cmake {
targets 'MyGame'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
ndk {
abiFilters = []
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
}
}
sourceSets.main {
java.srcDir "src"
res.srcDir "res"
manifest.srcFile "AndroidManifest.xml"
assets.srcDir "../../Resources"
}
externalNativeBuild {
cmake {
path "../../CMakeLists.txt"
}
}
signingConfigs {
release {
if (project.hasProperty("RELEASE_STORE_FILE")) {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
release {
debuggable false
jniDebuggable false
renderscriptDebuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (project.hasProperty("RELEASE_STORE_FILE")) {
signingConfig signingConfigs.release
}
}
debug {
debuggable true
jniDebuggable true
renderscriptDebuggable true
}
}
}
android.applicationVariants.all { variant ->
def project_root_folder = "${projectDir}/../.."
def dest_assets_folder = "${projectDir}/assets"
// delete previous files first
delete dest_assets_folder
def targetName = variant.name.capitalize()
def copyTaskName = "copy${targetName}ResourcesToAssets"
tasks.register(copyTaskName) {
copy {
from "${buildDir}/../../../Resources"
into "${buildDir}/intermediates/assets/${variant.dirName}"
exclude "**/*.gz"
}
}
tasks.getByName("pre${targetName}Build").dependsOn copyTaskName
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':libcocos2dx')
}

View File

@ -0,0 +1,42 @@
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include <memory>
#include <android/log.h>
#include <jni.h>
#include "AppDelegate.h"
#define LOG_TAG "main"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
namespace {
std::unique_ptr<AppDelegate> appDelegate;
}
void cocos_android_app_init(JNIEnv* env) {
LOGD("cocos_android_app_init");
appDelegate.reset(new AppDelegate());
}

View File

@ -0,0 +1,37 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in E:\developSoftware\Android\SDK/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Proguard Cocos2d-x for release
-keep public class org.cocos2dx.** { *; }
-dontwarn org.cocos2dx.**
-keep public class com.chukong.** { *; }
-dontwarn com.chukong.**
-keep public class com.huawei.android.** { *; }
-dontwarn com.huawei.android.**
# Proguard Apache HTTP for release
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
# Proguard Android Webivew for release. uncomment if you are using a webview in cocos2d-x
#-keep public class android.net.http.SslError
#-keep public class android.webkit.WebViewClient
#-dontwarn android.webkit.WebView
#-dontwarn android.net.http.SslError
#-dontwarn android.webkit.WebViewClient

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,3 @@
<resources>
<string name="app_name">spine-cocos2dx-example</string>
</resources>

View File

@ -0,0 +1,58 @@
/****************************************************************************
Copyright (c) 2015-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
package org.cocos2dx.cpp;
import android.os.Bundle;
import org.cocos2dx.lib.Cocos2dxActivity;
import android.os.Build;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
public class AppActivity extends Cocos2dxActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.setEnableVirtualButton(false);
super.onCreate(savedInstanceState);
// Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508
if (!isTaskRoot()) {
// Android launched another instance of the root activity into an existing task
// so just quietly finish and go away, dropping the user back into the activity
// at the top of the stack (ie: the last state of this task)
// Don't need to finish it again since it's finished in super.onCreate .
return;
}
// Make sure we're running on Pie or higher to change cutout mode
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
// Enable rendering into the cutout area
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
getWindow().setAttributes(lp);
}
// DO OTHER INITIALIZATION BELOW
}
}

View File

@ -0,0 +1,26 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

View File

@ -0,0 +1,42 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# Android SDK version that will be used as the compile project
PROP_COMPILE_SDK_VERSION=28
# Android SDK version that will be used as the earliest version of android this application can run on
PROP_MIN_SDK_VERSION=16
# Android SDK version that will be used as the latest version of android this application has been tested on
PROP_TARGET_SDK_VERSION=28
# List of CPU Archtexture to build that application with
# Available architextures (armeabi-v7a | arm64-v8a | x86)
# To build for multiple architexture, use the `:` between them
# Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86
PROP_APP_ABI=armeabi-v7a
# uncomment it and fill in sign information for release mode
#RELEASE_STORE_FILE=file path of keystore
#RELEASE_STORE_PASSWORD=password of keystore
#RELEASE_KEY_ALIAS=alias of key
#RELEASE_KEY_PASSWORD=password of key
android.injected.testOnly=false

View File

@ -0,0 +1,6 @@
#Tue Mar 14 17:40:59 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

164
spine-cocos2dx/example-v4/proj.android/gradlew vendored Executable file
View File

@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

View File

@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,4 @@
include ':libcocos2dx'
project(':libcocos2dx').projectDir = new File(settingsDir, '../cocos2d/cocos/platform/android/libcocos2dx')
include ':spine-cocos2dx-example'
project(':spine-cocos2dx-example').projectDir = new File(settingsDir, 'app')

View File

@ -0,0 +1,38 @@
/****************************************************************************
Copyright (c) 2010-2013 cocos2d-x.org
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#import <UIKit/UIKit.h>
@class RootViewController;
@interface AppController : NSObject <UIApplicationDelegate> {
}
@property(nonatomic, readonly) RootViewController* viewController;
@end

View File

@ -0,0 +1,153 @@
/****************************************************************************
Copyright (c) 2010-2013 cocos2d-x.org
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#import "AppController.h"
#import "cocos2d.h"
#import "AppDelegate.h"
#import "RootViewController.h"
@implementation AppController
@synthesize window;
#pragma mark -
#pragma mark Application lifecycle
// cocos2d application instance
static AppDelegate s_sharedApplication;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
cocos2d::Application *app = cocos2d::Application::getInstance();
// Initialize the GLView attributes
app->initGLContextAttrs();
cocos2d::GLViewImpl::convertAttrs();
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
// Use RootViewController to manage CCEAGLView
_viewController = [[RootViewController alloc]init];
_viewController.wantsFullScreenLayout = YES;
// Set RootViewController to window
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
// warning: addSubView doesn't work on iOS6
[window addSubview: _viewController.view];
}
else
{
// use this method on ios6
[window setRootViewController:_viewController];
}
[window makeKeyAndVisible];
[[UIApplication sharedApplication] setStatusBarHidden:true];
//Launching the app with the arguments -NSAllowsDefaultLineBreakStrategy NO to force back to the old behavior.
if ( [[UIDevice currentDevice].systemVersion floatValue] >= 13.0f)
{
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSAllowsDefaultLineBreakStrategy"];
}
// IMPORTANT: Setting the GLView should be done after creating the RootViewController
cocos2d::GLView *glview = cocos2d::GLViewImpl::createWithEAGLView((__bridge void *)_viewController.view);
cocos2d::Director::getInstance()->setOpenGLView(glview);
//run the cocos2d-x game scene
app->run();
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
/* cocos2d::Director::getInstance()->pause(); */
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
// We don't need to call this method any more. It will interrupt user defined game pause&resume logic
/* cocos2d::Director::getInstance()->resume(); */
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
*/
cocos2d::Application::getInstance()->applicationDidEnterBackground();
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
/*
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
*/
cocos2d::Application::getInstance()->applicationWillEnterForeground();
}
- (void)applicationWillTerminate:(UIApplication *)application {
/*
Called when the application is about to terminate.
See also applicationDidEnterBackground:.
*/
}
#pragma mark -
#pragma mark Memory management
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
/*
Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
*/
}
#if __has_feature(objc_arc)
#else
- (void)dealloc {
[window release];
[_viewController release];
[super dealloc];
}
#endif
@end

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

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

View File

@ -0,0 +1,45 @@
<?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>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>Icon-57.png</string>
<key>CFBundleIdentifier</key>
<string>org.cocos2dx.${PRODUCT_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_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>LSRequiresIPhoneOS</key>
<true/>
<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,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina5_9" orientation="landscape">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment version="1792" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="fm7-M6-edp"/>
<viewControllerLayoutGuide type="bottom" id="uRH-d6-mvd"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="812" height="375"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFill" insetsLayoutMarginsFromSafeArea="NO" image="LaunchScreenBackground.png" translatesAutoresizingMaskIntoConstraints="NO" id="YCC-wj-Gww" userLabel="Background">
<rect key="frame" x="0.0" y="0.0" width="812" height="375"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="YCC-wj-Gww" secondAttribute="bottom" id="Naz-ae-jWI"/>
<constraint firstAttribute="trailing" secondItem="YCC-wj-Gww" secondAttribute="trailing" id="myj-85-hk9"/>
<constraint firstItem="YCC-wj-Gww" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="qOq-Cg-doS"/>
<constraint firstItem="YCC-wj-Gww" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="xL7-Fo-4bl"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="50.399999999999999" y="373.15270935960592"/>
</scene>
</scenes>
<resources>
<image name="LaunchScreenBackground.png" width="2208" height="1242"/>
</resources>
</document>

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

View File

@ -0,0 +1,12 @@
//
// Prefix header for all source files of the 'iphone' target in the 'iphone' project
//
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
#ifdef __cplusplus
#include "cocos2d.h"
#endif

View File

@ -0,0 +1,35 @@
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#import <UIKit/UIKit.h>
@interface RootViewController : UIViewController {
}
- (BOOL) prefersStatusBarHidden;
@end

View File

@ -0,0 +1,122 @@
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#import "RootViewController.h"
#import "cocos2d.h"
#import "platform/ios/CCEAGLView-ios.h"
@implementation RootViewController
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
// Custom initialization
}
return self;
}
*/
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
// Initialize the CCEAGLView
CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [UIScreen mainScreen].bounds
pixelFormat: (__bridge NSString *)cocos2d::GLViewImpl::_pixelFormat
depthFormat: cocos2d::GLViewImpl::_depthFormat
preserveBackbuffer: NO
sharegroup: nil
multiSampling: cocos2d::GLViewImpl::_multisamplingCount > 0 ? YES : NO
numberOfSamples: cocos2d::GLViewImpl::_multisamplingCount ];
// Enable or disable multiple touches
[eaglView setMultipleTouchEnabled:NO];
// Set EAGLView as view of RootViewController
self.view = eaglView;
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
#ifdef __IPHONE_6_0
- (NSUInteger) supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
#endif
- (BOOL) shouldAutorotate {
return YES;
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
auto glview = cocos2d::Director::getInstance()->getOpenGLView();
if (glview)
{
CCEAGLView *eaglview = (__bridge CCEAGLView *)glview->getEAGLView();
if (eaglview)
{
CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]);
cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);
}
}
}
//fix not hide status on ios7
- (BOOL)prefersStatusBarHidden {
return YES;
}
// Controls the application's preferred home indicator auto-hiding when this view controller is shown.
- (BOOL)prefersHomeIndicatorAutoHidden {
return YES;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
@end

View File

@ -0,0 +1,15 @@
<?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>compileBitcode</key>
<false/>
<key>method</key>
<string>development</string>
<key>provisioningProfiles</key>
<dict>
<key>Bundle Identifier</key>
<string>Provision Prifile Name</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, @"AppController");
}
}

Binary file not shown.

View File

@ -0,0 +1,36 @@
<?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>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>Icon</string>
<key>CFBundleIdentifier</key>
<string>com.esotericsoftware.spine</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2013. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -0,0 +1,11 @@
//
// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
#ifdef __cplusplus
#include "cocos2d.h"
#endif

View File

@ -0,0 +1,35 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "AppDelegate.h"
#include "cocos2d.h"
USING_NS_CC;
int main(int argc, char *argv[])
{
AppDelegate app;
return Application::getInstance()->run();
}

View File

@ -0,0 +1,39 @@
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "../Classes/AppDelegate.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string>
USING_NS_CC;
int main(int argc, char **argv)
{
// create the application instance
AppDelegate app;
return Application::getInstance()->run();
}

View File

@ -0,0 +1,8 @@
{
"copy_resources": [
{
"from": "../Resources",
"to": ""
}
]
}

View File

@ -0,0 +1,86 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
GLFW_ICON ICON "res\\game.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "game Module\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "game\0"
VALUE "LegalCopyright", "Copyright \0"
VALUE "OriginalFilename", "game.exe\0"
VALUE "ProductName", "game Module\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04B0
END
END
/////////////////////////////////////////////////////////////////////////////
#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

View File

@ -0,0 +1,42 @@
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "main.h"
#include "AppDelegate.h"
#include "cocos2d.h"
USING_NS_CC;
int WINAPI _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// create the application instance
AppDelegate app;
return Application::getInstance()->run();
}

View File

@ -0,0 +1,37 @@
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __MAIN_H__
#define __MAIN_H__
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
#include <tchar.h>
// C RunTime Header Files
#include "platform/CCStdC.h"
#endif // __MAIN_H__

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,44 @@
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by game.RC
//
#define IDS_PROJNAME 100
#define IDR_TESTJS 100
#define ID_FILE_NEW_WINDOW 32771
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 32775
#endif
#endif

View File

@ -1,4 +1,6 @@
bin/ bin/
build/
build-linux/
proj.android/bin/ proj.android/bin/
proj.android/assets/ proj.android/assets/
proj.android/libs/ proj.android/libs/

View File

@ -22,9 +22,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
# ****************************************************************************/ # ****************************************************************************/
cmake_policy(SET CMP0017 NEW) #cmake_policy(SET CMP0017 NEW)
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.8)
set(APP_NAME MyGame) set(APP_NAME MyGame)
project (${APP_NAME}) project (${APP_NAME})
@ -32,6 +32,8 @@ project (${APP_NAME})
set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d) set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${COCOS2D_ROOT}/cmake/Modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${COCOS2D_ROOT}/cmake/Modules/")
include(CocosConfigDefine)
include(CocosBuildHelpers) include(CocosBuildHelpers)
# libcocos2d # libcocos2d
@ -39,53 +41,76 @@ set(BUILD_CPP_EMPTY_TEST OFF CACHE BOOL "turn off build cpp-empty-test")
set(BUILD_CPP_TESTS OFF CACHE BOOL "turn off build cpp-tests") set(BUILD_CPP_TESTS OFF CACHE BOOL "turn off build cpp-tests")
set(BUILD_LUA_LIBS OFF CACHE BOOL "turn off build lua related targets") set(BUILD_LUA_LIBS OFF CACHE BOOL "turn off build lua related targets")
set(BUILD_JS_LIBS OFF CACHE BOOL "turn off build js related targets") set(BUILD_JS_LIBS OFF CACHE BOOL "turn off build js related targets")
set(BUILD_EDITOR_SPINE ON CACHE BOOL "enable spine")
include_directories(
${CMAKE_CURRENT_LIST_DIR}/../../spine-cpp/spine-cpp/include
${CMAKE_CURRENT_LIST_DIR}/../src
)
add_subdirectory(${COCOS2D_ROOT}) add_subdirectory(${COCOS2D_ROOT})
# Some macro definitions get_target_property(COCOS2D_X_VERSION cocos2d VERSION)
if(WINDOWS) set(COCOS2DX_ROOT_PATH ${COCOS2D_ROOT})
if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS (-D_USRDLL -D_EXPORT_DLL_ -D_USEGUIDLL -D_USREXDLL -D_USRSTUDIODLL)
else()
ADD_DEFINITIONS (-DCC_STATIC)
endif()
ADD_DEFINITIONS (-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32 -D_WIN32) # Some macro definitions
set(PLATFORM_FOLDER win32) # if(WINDOWS)
elseif(MACOSX OR APPLE) # if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS (-DCC_TARGET_OS_MAC) # ADD_DEFINITIONS (-D_USRDLL -D_EXPORT_DLL_ -D_USEGUIDLL -D_USREXDLL -D_USRSTUDIODLL)
ADD_DEFINITIONS (-DUSE_FILE32API) # else()
set(PLATFORM_FOLDER mac) # ADD_DEFINITIONS (-DCC_STATIC)
elseif(LINUX) # endif()
ADD_DEFINITIONS(-DLINUX)
set(PLATFORM_FOLDER linux) # ADD_DEFINITIONS (-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32 -D_WIN32)
elseif(ANDROID) # set(PLATFORM_FOLDER win32)
ADD_DEFINITIONS (-DUSE_FILE32API) # elseif(MACOSX OR APPLE)
set(PLATFORM_FOLDER android) # ADD_DEFINITIONS (-DCC_TARGET_OS_MAC)
else() # ADD_DEFINITIONS (-DUSE_FILE32API)
message( FATAL_ERROR "Unsupported platform, CMake will exit" ) # set(PLATFORM_FOLDER mac)
endif() # elseif(LINUX)
# ADD_DEFINITIONS(-DLINUX)
# set(PLATFORM_FOLDER linux)
# elseif(ANDROID)
# ADD_DEFINITIONS (-DUSE_FILE32API)
# set(PLATFORM_FOLDER android)
# else()
# message( FATAL_ERROR "Unsupported platform, CMake will exit" )
# endif()
# Compiler options # Compiler options
if(MSVC) # if(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS # ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710 # -wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710
-wd4514 -wd4056 -wd4996 -wd4099) # -wd4514 -wd4056 -wd4996 -wd4099)
else() # else()
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1") # set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) # set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations -Wno-reorder") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations -Wno-reorder")
if(CLANG) # if(CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif() # endif()
endif(MSVC) # endif(MSVC)
set(PLATFORM_SPECIFIC_SRC) set(PLATFORM_SPECIFIC_SRC)
set(PLATFORM_SPECIFIC_HEADERS) set(PLATFORM_SPECIFIC_HEADERS)
set(cc_common_res)
set(GAME_RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/Resources)
if(APPLE OR VS)
cocos_mark_multi_resources(cc_common_res RES_TO "Resources" FOLDERS ${GAME_RES_FOLDER})
endif()
if(MACOSX OR APPLE) if(MACOSX OR APPLE)
set(APP_UI_RES
proj.ios_mac/mac/Icon.icns
proj.ios_mac/mac/Info.plist
)
set(PLATFORM_SPECIFIC_SRC set(PLATFORM_SPECIFIC_SRC
proj.ios_mac/mac/main.cpp proj.ios_mac/mac/main.cpp
) )
@ -107,30 +132,19 @@ elseif(ANDROID)
) )
endif() endif()
include_directories(
/usr/local/include/GLFW file(GLOB GAME_CLASSES_SOURCES "Classes/*.cpp")
/usr/include/GLFW file(GLOB GAME_CLASSES_HEADERS "Classes/*.h")
${COCOS2D_ROOT}/cocos
${COCOS2D_ROOT}/cocos/platform
${COCOS2D_ROOT}/cocos/audio/include/
Classes
)
if ( WIN32 )
include_directories(
${COCOS2D_ROOT}/external/glfw3/include/win32
${COCOS2D_ROOT}/external/win32-specific/gles/include/OGLES
)
endif( WIN32 )
set(GAME_SRC set(GAME_SRC
Classes/AppDelegate.cpp ${GAME_CLASSES_SOURCES}
Classes/HelloWorldScene.cpp
${PLATFORM_SPECIFIC_SRC} ${PLATFORM_SPECIFIC_SRC}
${cc_common_res}
) )
set(GAME_HEADERS set(GAME_HEADERS
Classes/AppDelegate.h ${GAME_CLASSES_HEADERS}
Classes/HelloWorldScene.h
${PLATFORM_SPECIFIC_HEADERS} ${PLATFORM_SPECIFIC_HEADERS}
) )
@ -143,27 +157,42 @@ else()
add_executable(${APP_NAME} ${GAME_SRC} ${GAME_HEADERS}) add_executable(${APP_NAME} ${GAME_SRC} ${GAME_HEADERS})
endif() endif()
target_include_directories(${APP_NAME} PRIVATE Classes)
target_link_libraries(${APP_NAME} cocos2d) target_link_libraries(${APP_NAME} cocos2d)
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin") setup_cocos_app_config(${APP_NAME})
set_target_properties(${APP_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
if ( WIN32 )
#also copying dlls to binary directory for the executable to run
pre_build(${APP_NAME}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/gles/prebuilt/glew32.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE}
COMMAND ${CMAKE_COMMAND} -E copy ${COCOS2D_ROOT}/external/win32-specific/zlib/prebuilt/zlib1.dll ${APP_BIN_DIR}/${CMAKE_BUILD_TYPE}
)
elseif( ANDROID )
if(COMMAND cocos_get_resource_path)
cocos_get_resource_path(APP_RES_DIR ${APP_NAME})
else() else()
pre_build(${APP_NAME} set(APP_RES_DIR "$<TARGET_FILE_DIR:${APP_NAME}>/Resources")
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources endif()
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
) if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${API_UI_RES}")
if(MACOSX)
set_target_properties(${APP_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/mac/Info.plist"
)
elseif(IOS)
cocos_pak_xcode(${APP_NAME} INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.ios_mac/ios/Info.plist")
set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon-${APP_NAME}")
set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer")
set_xcode_property(${APP_NAME} DEVELOPMENT_TEAM "")
set_xcode_property(${APP_NAME} CODE_SIGN_IDENTITY "iPhone Developer")
endif()
elseif(WINDOWS)
cocos_copy_target_dll(${APP_NAME} COPY_TO ${APP_RES_DIR}/..)
endif()
if(LINUX OR WINDOWS)
if("${COCOS2D_X_VERSION}" VERSION_LESS "4.0")
if(COMMAND cocos_copy_res)
cocos_copy_res(COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
else()
cocos_copy_target_res(${APP_NAME} COPY_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()
else()
cocos_copy_target_res(${APP_NAME} LINK_TO ${APP_RES_DIR} FOLDERS ${GAME_RES_FOLDER})
endif()
endif() endif()

View File

@ -36,7 +36,6 @@
#include <spine/spine-cocos2dx.h> #include <spine/spine-cocos2dx.h>
#include <spine/Debug.h> #include <spine/Debug.h>
#include "AppMacros.h" #include "AppMacros.h"
#include <spine/SkeletonTwoColorBatch.h>
USING_NS_CC; USING_NS_CC;
using namespace std; using namespace std;

View File

@ -55,7 +55,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string></string> <string>1</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>

View File

@ -166,12 +166,11 @@
763105D820BC1B9700927A1E /* Updatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A520BC1B5600927A1E /* Updatable.cpp */; }; 763105D820BC1B9700927A1E /* Updatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A520BC1B5600927A1E /* Updatable.cpp */; };
763105D920BC1B9700927A1E /* VertexAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049220BC1B5500927A1E /* VertexAttachment.cpp */; }; 763105D920BC1B9700927A1E /* VertexAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049220BC1B5500927A1E /* VertexAttachment.cpp */; };
763105DA20BC1B9700927A1E /* VertexEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AE20BC1B5800927A1E /* VertexEffect.cpp */; }; 763105DA20BC1B9700927A1E /* VertexEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AE20BC1B5800927A1E /* VertexEffect.cpp */; };
763A8A98239FDC0400FBEDDC /* SkeletonRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763A8A97239FDC0400FBEDDC /* SkeletonRenderer.cpp */; };
76798D1D22A95AB400F77964 /* ConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76798D1C22A95AB300F77964 /* ConstraintData.cpp */; }; 76798D1D22A95AB400F77964 /* ConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76798D1C22A95AB300F77964 /* ConstraintData.cpp */; };
76798D1E22A95AEF00F77964 /* ConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76798D1C22A95AB300F77964 /* ConstraintData.cpp */; }; 76798D1E22A95AEF00F77964 /* ConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76798D1C22A95AB300F77964 /* ConstraintData.cpp */; };
767D80E322B29F22000BD703 /* MixAndMatchExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 767D80E022B29F22000BD703 /* MixAndMatchExample.cpp */; }; 767D80E322B29F22000BD703 /* MixAndMatchExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 767D80E022B29F22000BD703 /* MixAndMatchExample.cpp */; };
767D80E422B2A003000BD703 /* MixAndMatchExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 767D80E022B29F22000BD703 /* MixAndMatchExample.cpp */; }; 767D80E422B2A003000BD703 /* MixAndMatchExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 767D80E022B29F22000BD703 /* MixAndMatchExample.cpp */; };
76A45BDE1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76A45BDC1E64396800745AA1 /* SkeletonTwoColorBatch.cpp */; };
76A45BDF1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76A45BDC1E64396800745AA1 /* SkeletonTwoColorBatch.cpp */; };
76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */; }; 76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */; };
76AAA3C11D180F7C00C54FCB /* BatchingExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B61D180F7C00C54FCB /* BatchingExample.cpp */; }; 76AAA3C11D180F7C00C54FCB /* BatchingExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B61D180F7C00C54FCB /* BatchingExample.cpp */; };
76AAA3C21D180F7C00C54FCB /* GoblinsExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B81D180F7C00C54FCB /* GoblinsExample.cpp */; }; 76AAA3C21D180F7C00C54FCB /* GoblinsExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B81D180F7C00C54FCB /* GoblinsExample.cpp */; };
@ -179,17 +178,11 @@
76AAA3C51D180F7C00C54FCB /* SpineboyExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3BE1D180F7C00C54FCB /* SpineboyExample.cpp */; }; 76AAA3C51D180F7C00C54FCB /* SpineboyExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3BE1D180F7C00C54FCB /* SpineboyExample.cpp */; };
76AAA40C1D18106000C54FCB /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */; }; 76AAA40C1D18106000C54FCB /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */; };
76AAA40E1D18106000C54FCB /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */; }; 76AAA40E1D18106000C54FCB /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */; };
76AAA40F1D18106000C54FCB /* SkeletonBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */; };
76AAA4101D18106000C54FCB /* SkeletonRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4081D18106000C54FCB /* SkeletonRenderer.cpp */; };
76AAA4111D18106000C54FCB /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */; }; 76AAA4111D18106000C54FCB /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */; };
76AAA4121D18119F00C54FCB /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */; }; 76AAA4121D18119F00C54FCB /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */; };
76AAA4131D18119F00C54FCB /* AttachmentVertices.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4011D18106000C54FCB /* AttachmentVertices.h */; }; 76AAA4131D18119F00C54FCB /* AttachmentVertices.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4011D18106000C54FCB /* AttachmentVertices.h */; };
76AAA4161D18119F00C54FCB /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */; }; 76AAA4161D18119F00C54FCB /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */; };
76AAA4171D18119F00C54FCB /* SkeletonAnimation.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4051D18106000C54FCB /* SkeletonAnimation.h */; }; 76AAA4171D18119F00C54FCB /* SkeletonAnimation.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4051D18106000C54FCB /* SkeletonAnimation.h */; };
76AAA4181D18119F00C54FCB /* SkeletonBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */; };
76AAA4191D18119F00C54FCB /* SkeletonBatch.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4071D18106000C54FCB /* SkeletonBatch.h */; };
76AAA41A1D18119F00C54FCB /* SkeletonRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4081D18106000C54FCB /* SkeletonRenderer.cpp */; };
76AAA41B1D18119F00C54FCB /* SkeletonRenderer.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4091D18106000C54FCB /* SkeletonRenderer.h */; };
76AAA41C1D18119F00C54FCB /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */; }; 76AAA41C1D18119F00C54FCB /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */; };
76AAA41D1D18119F00C54FCB /* spine-cocos2dx.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA40B1D18106000C54FCB /* spine-cocos2dx.h */; }; 76AAA41D1D18119F00C54FCB /* spine-cocos2dx.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA40B1D18106000C54FCB /* spine-cocos2dx.h */; };
76AAA43B1D1811B000C54FCB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */; }; 76AAA43B1D1811B000C54FCB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */; };
@ -209,8 +202,14 @@
76C893B1236715B8009D8DC8 /* IKExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76C893AE236715B8009D8DC8 /* IKExample.cpp */; }; 76C893B1236715B8009D8DC8 /* IKExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76C893AE236715B8009D8DC8 /* IKExample.cpp */; };
76D1BFE02029E35200A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */; }; 76D1BFE02029E35200A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */; };
76D1BFE12029E37700A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */; }; 76D1BFE12029E37700A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */; };
76D28ACB239FAF0B00FB142D /* SkeletonTwoColorBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D28AC5239FAF0A00FB142D /* SkeletonTwoColorBatch.cpp */; };
76D28ACD239FAF0B00FB142D /* SkeletonBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D28ACA239FAF0B00FB142D /* SkeletonBatch.cpp */; };
76D28ACE239FAF2C00FB142D /* SkeletonBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D28ACA239FAF0B00FB142D /* SkeletonBatch.cpp */; };
76D28AD0239FAF2C00FB142D /* SkeletonTwoColorBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D28AC5239FAF0A00FB142D /* SkeletonTwoColorBatch.cpp */; };
76D520E61EB362DD00572471 /* CoinExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E41EB362DD00572471 /* CoinExample.cpp */; }; 76D520E61EB362DD00572471 /* CoinExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E41EB362DD00572471 /* CoinExample.cpp */; };
76D520E71EB3634600572471 /* CoinExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E41EB362DD00572471 /* CoinExample.cpp */; }; 76D520E71EB3634600572471 /* CoinExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E41EB362DD00572471 /* CoinExample.cpp */; };
76F1083A239FC8DA005B0CE9 /* SkeletonTwoColorBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F10837239FC8DA005B0CE9 /* SkeletonTwoColorBatch.cpp */; };
76F1083B239FC8DA005B0CE9 /* SkeletonBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F10838239FC8DA005B0CE9 /* SkeletonBatch.cpp */; };
76F5BD551D2BD7D3005917E5 /* TankExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */; }; 76F5BD551D2BD7D3005917E5 /* TankExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */; };
76F5BD561D2BD7EF005917E5 /* TankExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */; }; 76F5BD561D2BD7EF005917E5 /* TankExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */; };
76F5BD571D2BD7EF005917E5 /* TankExample.h in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD541D2BD7D3005917E5 /* TankExample.h */; }; 76F5BD571D2BD7EF005917E5 /* TankExample.h in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD541D2BD7D3005917E5 /* TankExample.h */; };
@ -367,11 +366,10 @@
763104C020BC1B5E00927A1E /* SkeletonBounds.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBounds.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp"; sourceTree = "<group>"; }; 763104C020BC1B5E00927A1E /* SkeletonBounds.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBounds.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp"; sourceTree = "<group>"; };
763104C120BC1B5E00927A1E /* ShearTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ShearTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp"; sourceTree = "<group>"; }; 763104C120BC1B5E00927A1E /* ShearTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ShearTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp"; sourceTree = "<group>"; };
763104C220BC1B5E00927A1E /* TranslateTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TranslateTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp"; sourceTree = "<group>"; }; 763104C220BC1B5E00927A1E /* TranslateTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TranslateTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp"; sourceTree = "<group>"; };
763A8A97239FDC0400FBEDDC /* SkeletonRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonRenderer.cpp; path = ../../src/spine/SkeletonRenderer.cpp; sourceTree = "<group>"; };
76798D1C22A95AB300F77964 /* ConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConstraintData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ConstraintData.cpp"; sourceTree = "<group>"; }; 76798D1C22A95AB300F77964 /* ConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConstraintData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ConstraintData.cpp"; sourceTree = "<group>"; };
767D80E022B29F22000BD703 /* MixAndMatchExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixAndMatchExample.cpp; sourceTree = "<group>"; }; 767D80E022B29F22000BD703 /* MixAndMatchExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixAndMatchExample.cpp; sourceTree = "<group>"; };
767D80E222B29F22000BD703 /* MixAndMatchExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixAndMatchExample.h; sourceTree = "<group>"; }; 767D80E222B29F22000BD703 /* MixAndMatchExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixAndMatchExample.h; sourceTree = "<group>"; };
76A45BDC1E64396800745AA1 /* SkeletonTwoColorBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonTwoColorBatch.cpp; path = ../../src/spine/SkeletonTwoColorBatch.cpp; sourceTree = "<group>"; };
76A45BDD1E64396800745AA1 /* SkeletonTwoColorBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonTwoColorBatch.h; path = ../../src/spine/SkeletonTwoColorBatch.h; sourceTree = "<group>"; };
76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = "<group>"; }; 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = "<group>"; };
76AAA3B41D180F7C00C54FCB /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 76AAA3B41D180F7C00C54FCB /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
76AAA3B51D180F7C00C54FCB /* AppMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppMacros.h; sourceTree = "<group>"; }; 76AAA3B51D180F7C00C54FCB /* AppMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppMacros.h; sourceTree = "<group>"; };
@ -387,10 +385,6 @@
76AAA4011D18106000C54FCB /* AttachmentVertices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentVertices.h; path = ../../src/spine/AttachmentVertices.h; sourceTree = "<group>"; }; 76AAA4011D18106000C54FCB /* AttachmentVertices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentVertices.h; path = ../../src/spine/AttachmentVertices.h; sourceTree = "<group>"; };
76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonAnimation.cpp; path = ../../src/spine/SkeletonAnimation.cpp; sourceTree = "<group>"; }; 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonAnimation.cpp; path = ../../src/spine/SkeletonAnimation.cpp; sourceTree = "<group>"; };
76AAA4051D18106000C54FCB /* SkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonAnimation.h; path = ../../src/spine/SkeletonAnimation.h; sourceTree = "<group>"; }; 76AAA4051D18106000C54FCB /* SkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonAnimation.h; path = ../../src/spine/SkeletonAnimation.h; sourceTree = "<group>"; };
76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBatch.cpp; path = ../../src/spine/SkeletonBatch.cpp; sourceTree = "<group>"; };
76AAA4071D18106000C54FCB /* SkeletonBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonBatch.h; path = ../../src/spine/SkeletonBatch.h; sourceTree = "<group>"; };
76AAA4081D18106000C54FCB /* SkeletonRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonRenderer.cpp; path = ../../src/spine/SkeletonRenderer.cpp; sourceTree = "<group>"; };
76AAA4091D18106000C54FCB /* SkeletonRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonRenderer.h; path = ../../src/spine/SkeletonRenderer.h; sourceTree = "<group>"; };
76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "spine-cocos2dx.cpp"; path = "../../src/spine/spine-cocos2dx.cpp"; sourceTree = "<group>"; }; 76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "spine-cocos2dx.cpp"; path = "../../src/spine/spine-cocos2dx.cpp"; sourceTree = "<group>"; };
76AAA40B1D18106000C54FCB /* spine-cocos2dx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "spine-cocos2dx.h"; path = "../../src/spine/spine-cocos2dx.h"; sourceTree = "<group>"; }; 76AAA40B1D18106000C54FCB /* spine-cocos2dx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "spine-cocos2dx.h"; path = "../../src/spine/spine-cocos2dx.h"; sourceTree = "<group>"; };
76AAA4521D18132D00C54FCB /* common */ = {isa = PBXFileReference; lastKnownFileType = folder; path = common; sourceTree = "<group>"; }; 76AAA4521D18132D00C54FCB /* common */ = {isa = PBXFileReference; lastKnownFileType = folder; path = common; sourceTree = "<group>"; };
@ -398,8 +392,17 @@
76C893AF236715B8009D8DC8 /* IKExample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IKExample.h; sourceTree = "<group>"; }; 76C893AF236715B8009D8DC8 /* IKExample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IKExample.h; sourceTree = "<group>"; };
76D1BFDE2029E35100A0272D /* SkeletonRendererSeparatorExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonRendererSeparatorExample.h; sourceTree = "<group>"; }; 76D1BFDE2029E35100A0272D /* SkeletonRendererSeparatorExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonRendererSeparatorExample.h; sourceTree = "<group>"; };
76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonRendererSeparatorExample.cpp; sourceTree = "<group>"; }; 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonRendererSeparatorExample.cpp; sourceTree = "<group>"; };
76D28AC5239FAF0A00FB142D /* SkeletonTwoColorBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonTwoColorBatch.cpp; path = ../../src/spine/v3/SkeletonTwoColorBatch.cpp; sourceTree = "<group>"; };
76D28AC6239FAF0B00FB142D /* SkeletonTwoColorBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonTwoColorBatch.h; path = ../../src/spine/v3/SkeletonTwoColorBatch.h; sourceTree = "<group>"; };
76D28AC8239FAF0B00FB142D /* SkeletonBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonBatch.h; path = ../../src/spine/v3/SkeletonBatch.h; sourceTree = "<group>"; };
76D28ACA239FAF0B00FB142D /* SkeletonBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBatch.cpp; path = ../../src/spine/v3/SkeletonBatch.cpp; sourceTree = "<group>"; };
76D520E41EB362DD00572471 /* CoinExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoinExample.cpp; sourceTree = "<group>"; }; 76D520E41EB362DD00572471 /* CoinExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoinExample.cpp; sourceTree = "<group>"; };
76D520E51EB362DD00572471 /* CoinExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoinExample.h; sourceTree = "<group>"; }; 76D520E51EB362DD00572471 /* CoinExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoinExample.h; sourceTree = "<group>"; };
76F10834239FC8D9005B0CE9 /* SkeletonBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonBatch.h; path = ../../src/spine/v4/SkeletonBatch.h; sourceTree = "<group>"; };
76F10835239FC8DA005B0CE9 /* SkeletonTwoColorBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonTwoColorBatch.h; path = ../../src/spine/v4/SkeletonTwoColorBatch.h; sourceTree = "<group>"; };
76F10837239FC8DA005B0CE9 /* SkeletonTwoColorBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonTwoColorBatch.cpp; path = ../../src/spine/v4/SkeletonTwoColorBatch.cpp; sourceTree = "<group>"; };
76F10838239FC8DA005B0CE9 /* SkeletonBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBatch.cpp; path = ../../src/spine/v4/SkeletonBatch.cpp; sourceTree = "<group>"; };
76F1083C239FC8E5005B0CE9 /* SkeletonRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonRenderer.h; path = ../../src/spine/SkeletonRenderer.h; sourceTree = "<group>"; };
76F5BD531D2BD7D3005917E5 /* TankExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TankExample.cpp; sourceTree = "<group>"; }; 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TankExample.cpp; sourceTree = "<group>"; };
76F5BD541D2BD7D3005917E5 /* TankExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TankExample.h; sourceTree = "<group>"; }; 76F5BD541D2BD7D3005917E5 /* TankExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TankExample.h; sourceTree = "<group>"; };
8262943D1AAF051F00CB7CF7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 8262943D1AAF051F00CB7CF7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
@ -691,22 +694,42 @@
76AAA3FF1D18102C00C54FCB /* spine-cocos2dx */ = { 76AAA3FF1D18102C00C54FCB /* spine-cocos2dx */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
76A45BDC1E64396800745AA1 /* SkeletonTwoColorBatch.cpp */, 76F10833239FC8CB005B0CE9 /* v4 */,
76A45BDD1E64396800745AA1 /* SkeletonTwoColorBatch.h */, 76D28AC2239FAED800FB142D /* v3 */,
76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */,
76AAA4011D18106000C54FCB /* AttachmentVertices.h */,
76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */, 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */,
76AAA4051D18106000C54FCB /* SkeletonAnimation.h */, 76AAA4051D18106000C54FCB /* SkeletonAnimation.h */,
76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */, 763A8A97239FDC0400FBEDDC /* SkeletonRenderer.cpp */,
76AAA4071D18106000C54FCB /* SkeletonBatch.h */, 76F1083C239FC8E5005B0CE9 /* SkeletonRenderer.h */,
76AAA4081D18106000C54FCB /* SkeletonRenderer.cpp */, 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */,
76AAA4091D18106000C54FCB /* SkeletonRenderer.h */, 76AAA4011D18106000C54FCB /* AttachmentVertices.h */,
76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */, 76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */,
76AAA40B1D18106000C54FCB /* spine-cocos2dx.h */, 76AAA40B1D18106000C54FCB /* spine-cocos2dx.h */,
); );
name = "spine-cocos2dx"; name = "spine-cocos2dx";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
76D28AC2239FAED800FB142D /* v3 */ = {
isa = PBXGroup;
children = (
76D28ACA239FAF0B00FB142D /* SkeletonBatch.cpp */,
76D28AC8239FAF0B00FB142D /* SkeletonBatch.h */,
76D28AC5239FAF0A00FB142D /* SkeletonTwoColorBatch.cpp */,
76D28AC6239FAF0B00FB142D /* SkeletonTwoColorBatch.h */,
);
name = v3;
sourceTree = "<group>";
};
76F10833239FC8CB005B0CE9 /* v4 */ = {
isa = PBXGroup;
children = (
76F10838239FC8DA005B0CE9 /* SkeletonBatch.cpp */,
76F10834239FC8D9005B0CE9 /* SkeletonBatch.h */,
76F10837239FC8DA005B0CE9 /* SkeletonTwoColorBatch.cpp */,
76F10835239FC8DA005B0CE9 /* SkeletonTwoColorBatch.h */,
);
name = v4;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -855,7 +878,9 @@
763104EF20BC1B5E00927A1E /* IkConstraintTimeline.cpp in Sources */, 763104EF20BC1B5E00927A1E /* IkConstraintTimeline.cpp in Sources */,
763104D820BC1B5E00927A1E /* AnimationState.cpp in Sources */, 763104D820BC1B5E00927A1E /* AnimationState.cpp in Sources */,
763104EE20BC1B5E00927A1E /* SkeletonClipping.cpp in Sources */, 763104EE20BC1B5E00927A1E /* SkeletonClipping.cpp in Sources */,
76F1083A239FC8DA005B0CE9 /* SkeletonTwoColorBatch.cpp in Sources */,
763104E420BC1B5E00927A1E /* ClippingAttachment.cpp in Sources */, 763104E420BC1B5E00927A1E /* ClippingAttachment.cpp in Sources */,
76D28ACD239FAF0B00FB142D /* SkeletonBatch.cpp in Sources */,
763104C620BC1B5E00927A1E /* CurveTimeline.cpp in Sources */, 763104C620BC1B5E00927A1E /* CurveTimeline.cpp in Sources */,
763104E120BC1B5E00927A1E /* AttachmentTimeline.cpp in Sources */, 763104E120BC1B5E00927A1E /* AttachmentTimeline.cpp in Sources */,
763104ED20BC1B5E00927A1E /* EventData.cpp in Sources */, 763104ED20BC1B5E00927A1E /* EventData.cpp in Sources */,
@ -867,7 +892,6 @@
76AAA3C11D180F7C00C54FCB /* BatchingExample.cpp in Sources */, 76AAA3C11D180F7C00C54FCB /* BatchingExample.cpp in Sources */,
763104D520BC1B5E00927A1E /* SkeletonData.cpp in Sources */, 763104D520BC1B5E00927A1E /* SkeletonData.cpp in Sources */,
763104D620BC1B5E00927A1E /* Extension.cpp in Sources */, 763104D620BC1B5E00927A1E /* Extension.cpp in Sources */,
76AAA40F1D18106000C54FCB /* SkeletonBatch.cpp in Sources */,
763104C920BC1B5E00927A1E /* EventTimeline.cpp in Sources */, 763104C920BC1B5E00927A1E /* EventTimeline.cpp in Sources */,
763104EB20BC1B5E00927A1E /* VertexEffect.cpp in Sources */, 763104EB20BC1B5E00927A1E /* VertexEffect.cpp in Sources */,
76AAA3C31D180F7C00C54FCB /* RaptorExample.cpp in Sources */, 76AAA3C31D180F7C00C54FCB /* RaptorExample.cpp in Sources */,
@ -876,6 +900,7 @@
763104E720BC1B5E00927A1E /* PathAttachment.cpp in Sources */, 763104E720BC1B5E00927A1E /* PathAttachment.cpp in Sources */,
763104F820BC1B5E00927A1E /* Json.cpp in Sources */, 763104F820BC1B5E00927A1E /* Json.cpp in Sources */,
763104F620BC1B5E00927A1E /* SlotData.cpp in Sources */, 763104F620BC1B5E00927A1E /* SlotData.cpp in Sources */,
76D28ACB239FAF0B00FB142D /* SkeletonTwoColorBatch.cpp in Sources */,
763104DF20BC1B5E00927A1E /* AttachmentLoader.cpp in Sources */, 763104DF20BC1B5E00927A1E /* AttachmentLoader.cpp in Sources */,
76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */, 76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */,
763104C420BC1B5E00927A1E /* PathConstraint.cpp in Sources */, 763104C420BC1B5E00927A1E /* PathConstraint.cpp in Sources */,
@ -910,11 +935,10 @@
763104FB20BC1B5E00927A1E /* DeformTimeline.cpp in Sources */, 763104FB20BC1B5E00927A1E /* DeformTimeline.cpp in Sources */,
503AE10217EB989F00D1A890 /* RootViewController.mm in Sources */, 503AE10217EB989F00D1A890 /* RootViewController.mm in Sources */,
503AE10117EB989F00D1A890 /* main.m in Sources */, 503AE10117EB989F00D1A890 /* main.m in Sources */,
76A45BDE1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */, 76F1083B239FC8DA005B0CE9 /* SkeletonBatch.cpp in Sources */,
763104CC20BC1B5E00927A1E /* RTTI.cpp in Sources */, 763104CC20BC1B5E00927A1E /* RTTI.cpp in Sources */,
763104F020BC1B5E00927A1E /* Timeline.cpp in Sources */, 763104F020BC1B5E00927A1E /* Timeline.cpp in Sources */,
763104FE20BC1B5E00927A1E /* ShearTimeline.cpp in Sources */, 763104FE20BC1B5E00927A1E /* ShearTimeline.cpp in Sources */,
76AAA4101D18106000C54FCB /* SkeletonRenderer.cpp in Sources */,
763104F120BC1B5E00927A1E /* AtlasAttachmentLoader.cpp in Sources */, 763104F120BC1B5E00927A1E /* AtlasAttachmentLoader.cpp in Sources */,
763104EC20BC1B5E00927A1E /* AnimationStateData.cpp in Sources */, 763104EC20BC1B5E00927A1E /* AnimationStateData.cpp in Sources */,
763104CE20BC1B5E00927A1E /* PointAttachment.cpp in Sources */, 763104CE20BC1B5E00927A1E /* PointAttachment.cpp in Sources */,
@ -925,6 +949,7 @@
763104CA20BC1B5E00927A1E /* PathConstraintSpacingTimeline.cpp in Sources */, 763104CA20BC1B5E00927A1E /* PathConstraintSpacingTimeline.cpp in Sources */,
76D520E61EB362DD00572471 /* CoinExample.cpp in Sources */, 76D520E61EB362DD00572471 /* CoinExample.cpp in Sources */,
763104E220BC1B5E00927A1E /* Updatable.cpp in Sources */, 763104E220BC1B5E00927A1E /* Updatable.cpp in Sources */,
763A8A98239FDC0400FBEDDC /* SkeletonRenderer.cpp in Sources */,
763104D220BC1B5E00927A1E /* RotateTimeline.cpp in Sources */, 763104D220BC1B5E00927A1E /* RotateTimeline.cpp in Sources */,
763104E320BC1B5E00927A1E /* RegionAttachment.cpp in Sources */, 763104E320BC1B5E00927A1E /* RegionAttachment.cpp in Sources */,
); );
@ -934,6 +959,8 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
76D28ACE239FAF2C00FB142D /* SkeletonBatch.cpp in Sources */,
76D28AD0239FAF2C00FB142D /* SkeletonTwoColorBatch.cpp in Sources */,
767D80E422B2A003000BD703 /* MixAndMatchExample.cpp in Sources */, 767D80E422B2A003000BD703 /* MixAndMatchExample.cpp in Sources */,
76798D1E22A95AEF00F77964 /* ConstraintData.cpp in Sources */, 76798D1E22A95AEF00F77964 /* ConstraintData.cpp in Sources */,
7631059E20BC1B9700927A1E /* Animation.cpp in Sources */, 7631059E20BC1B9700927A1E /* Animation.cpp in Sources */,
@ -1014,13 +1041,8 @@
76AAA4471D1811B000C54FCB /* SpineboyExample.h in Sources */, 76AAA4471D1811B000C54FCB /* SpineboyExample.h in Sources */,
76AAA4121D18119F00C54FCB /* AttachmentVertices.cpp in Sources */, 76AAA4121D18119F00C54FCB /* AttachmentVertices.cpp in Sources */,
76AAA4131D18119F00C54FCB /* AttachmentVertices.h in Sources */, 76AAA4131D18119F00C54FCB /* AttachmentVertices.h in Sources */,
76A45BDF1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */,
76AAA4161D18119F00C54FCB /* SkeletonAnimation.cpp in Sources */, 76AAA4161D18119F00C54FCB /* SkeletonAnimation.cpp in Sources */,
76AAA4171D18119F00C54FCB /* SkeletonAnimation.h in Sources */, 76AAA4171D18119F00C54FCB /* SkeletonAnimation.h in Sources */,
76AAA4181D18119F00C54FCB /* SkeletonBatch.cpp in Sources */,
76AAA4191D18119F00C54FCB /* SkeletonBatch.h in Sources */,
76AAA41A1D18119F00C54FCB /* SkeletonRenderer.cpp in Sources */,
76AAA41B1D18119F00C54FCB /* SkeletonRenderer.h in Sources */,
76AAA41C1D18119F00C54FCB /* spine-cocos2dx.cpp in Sources */, 76AAA41C1D18119F00C54FCB /* spine-cocos2dx.cpp in Sources */,
76AAA41D1D18119F00C54FCB /* spine-cocos2dx.h in Sources */, 76AAA41D1D18119F00C54FCB /* spine-cocos2dx.h in Sources */,
503AE10517EB98FF00D1A890 /* main.cpp in Sources */, 503AE10517EB98FF00D1A890 /* main.cpp in Sources */,

View File

@ -31,7 +31,7 @@
#define SPINE_SKELETONANIMATION_H_ #define SPINE_SKELETONANIMATION_H_
#include <spine/spine.h> #include <spine/spine.h>
#include <spine/SkeletonRenderer.h> #include <spine/spine-cocos2dx.h>
#include "cocos2d.h" #include "cocos2d.h"
namespace spine { namespace spine {

View File

@ -28,10 +28,7 @@
*****************************************************************************/ *****************************************************************************/
#include <spine/spine-cocos2dx.h> #include <spine/spine-cocos2dx.h>
#include <spine/SkeletonRenderer.h>
#include <spine/Extension.h> #include <spine/Extension.h>
#include <spine/SkeletonBatch.h>
#include <spine/SkeletonTwoColorBatch.h>
#include <spine/AttachmentVertices.h> #include <spine/AttachmentVertices.h>
#include <algorithm> #include <algorithm>
@ -46,7 +43,7 @@ namespace spine {
int computeTotalCoordCount(Skeleton& skeleton, int startSlotIndex, int endSlotIndex); int computeTotalCoordCount(Skeleton& skeleton, int startSlotIndex, int endSlotIndex);
cocos2d::Rect computeBoundingRect(const float* coords, int vertexCount); cocos2d::Rect computeBoundingRect(const float* coords, int vertexCount);
void interleaveCoordinates(float* dst, const float* src, int vertexCount, int dstStride); void interleaveCoordinates(float* dst, const float* src, int vertexCount, int dstStride);
BlendFunc makeBlendFunc(int blendMode, bool premultipliedAlpha); BlendFunc makeBlendFunc(BlendMode blendMode, bool premultipliedAlpha);
void transformWorldVertices(float* dstCoord, int coordCount, Skeleton& skeleton, int startSlotIndex, int endSlotIndex); void transformWorldVertices(float* dstCoord, int coordCount, Skeleton& skeleton, int startSlotIndex, int endSlotIndex);
bool cullRectangle(Renderer* renderer, const Mat4& transform, const cocos2d::Rect& rect); bool cullRectangle(Renderer* renderer, const Mat4& transform, const cocos2d::Rect& rect);
Color4B ColorToColor4B(const Color& color); Color4B ColorToColor4B(const Color& color);
@ -96,7 +93,7 @@ namespace spine {
_blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;
setOpacityModifyRGB(true); setOpacityModifyRGB(true);
setupGLProgramState(false); setTwoColorTint(false);
_skeleton->setToSetupPose(); _skeleton->setToSetupPose();
_skeleton->updateWorldTransform(); _skeleton->updateWorldTransform();
@ -104,7 +101,9 @@ namespace spine {
void SkeletonRenderer::setupGLProgramState (bool twoColorTintEnabled) { void SkeletonRenderer::setupGLProgramState (bool twoColorTintEnabled) {
if (twoColorTintEnabled) { if (twoColorTintEnabled) {
#if COCOS2D_VERSION < 0x00040000
setGLProgramState(SkeletonTwoColorBatch::getInstance()->getTwoColorTintProgramState()); setGLProgramState(SkeletonTwoColorBatch::getInstance()->getTwoColorTintProgramState());
#endif
return; return;
} }
@ -128,7 +127,9 @@ namespace spine {
break; break;
} }
} }
#if COCOS2D_VERSION < 0x00040000
setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP, texture)); setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP, texture));
#endif
} }
void SkeletonRenderer::setSkeletonData (SkeletonData *skeletonData, bool ownsSkeletonData) { void SkeletonRenderer::setSkeletonData (SkeletonData *skeletonData, bool ownsSkeletonData) {
@ -137,34 +138,34 @@ namespace spine {
} }
SkeletonRenderer::SkeletonRenderer () SkeletonRenderer::SkeletonRenderer ()
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _timeScale(1), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) { : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) {
} }
SkeletonRenderer::SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas) SkeletonRenderer::SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas)
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _timeScale(1), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) { : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) {
initWithSkeleton(skeleton, ownsSkeleton, ownsSkeletonData, ownsAtlas); initWithSkeleton(skeleton, ownsSkeleton, ownsSkeletonData, ownsAtlas);
} }
SkeletonRenderer::SkeletonRenderer (SkeletonData *skeletonData, bool ownsSkeletonData) SkeletonRenderer::SkeletonRenderer (SkeletonData *skeletonData, bool ownsSkeletonData)
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _timeScale(1), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) { : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) {
initWithData(skeletonData, ownsSkeletonData); initWithData(skeletonData, ownsSkeletonData);
} }
SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, Atlas* atlas, float scale) SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, Atlas* atlas, float scale)
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _timeScale(1), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) { : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) {
initWithJsonFile(skeletonDataFile, atlas, scale); initWithJsonFile(skeletonDataFile, atlas, scale);
} }
SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale)
: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _timeScale(1), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) { : _atlas(nullptr), _attachmentLoader(nullptr), _timeScale(1), _debugSlots(false), _debugBones(false), _debugMeshes(false), _debugBoundingRect(false), _effect(nullptr), _startSlotIndex(0), _endSlotIndex(std::numeric_limits<int>::max()) {
initWithJsonFile(skeletonDataFile, atlasFile, scale); initWithJsonFile(skeletonDataFile, atlasFile, scale);
} }
SkeletonRenderer::~SkeletonRenderer () { SkeletonRenderer::~SkeletonRenderer () {
if (_ownsSkeletonData) delete _skeleton->getData(); if (_ownsSkeletonData) delete _skeleton->getData();
if (_ownsSkeleton) delete _skeleton; if (_ownsSkeleton) delete _skeleton;
if (_ownsAtlas) delete _atlas; if (_ownsAtlas && _atlas) delete _atlas;
delete _attachmentLoader; if (_attachmentLoader) delete _attachmentLoader;
delete _clipper; delete _clipper;
} }
@ -450,7 +451,11 @@ namespace spine {
batch->allocateIndices(triangles.indexCount); batch->allocateIndices(triangles.indexCount);
memcpy(triangles.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); memcpy(triangles.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size());
#if COCOS2D_VERSION < 0x00040000
cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags); cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags);
#else
cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, blendFunc, triangles, transform, transformFlags);
#endif
const float* verts = _clipper->getClippedVertices().buffer(); const float* verts = _clipper->getClippedVertices().buffer();
const float* uvs = _clipper->getClippedUVs().buffer(); const float* uvs = _clipper->getClippedUVs().buffer();
@ -478,8 +483,11 @@ namespace spine {
} }
} else { } else {
// Not clipping // Not clipping
#if COCOS2D_VERSION < 0x00040000
cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags); cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags);
#else
cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, blendFunc, triangles, transform, transformFlags);
#endif
if (_effect) { if (_effect) {
V3F_C4B_T2F* vertex = batchedTriangles->getTriangles().verts; V3F_C4B_T2F* vertex = batchedTriangles->getTriangles().verts;
@ -514,7 +522,11 @@ namespace spine {
trianglesTwoColor.indices = twoColorBatch->allocateIndices(trianglesTwoColor.indexCount); trianglesTwoColor.indices = twoColorBatch->allocateIndices(trianglesTwoColor.indexCount);
memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size());
#if COCOS2D_VERSION < 0x00040000
TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags); TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
#else
TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, blendFunc, trianglesTwoColor, transform, transformFlags);
#endif
const float* verts = _clipper->getClippedVertices().buffer(); const float* verts = _clipper->getClippedVertices().buffer();
const float* uvs = _clipper->getClippedUVs().buffer(); const float* uvs = _clipper->getClippedUVs().buffer();
@ -544,7 +556,12 @@ namespace spine {
} }
} }
} else { } else {
#if COCOS2D_VERSION < 0x00040000
TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags); TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
#else
TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, blendFunc, trianglesTwoColor, transform, transformFlags);
#endif
if (_effect) { if (_effect) {
V3F_C4B_C4B_T2F* vertex = batchedTriangles->getTriangles().verts; V3F_C4B_C4B_T2F* vertex = batchedTriangles->getTriangles().verts;
@ -617,17 +634,21 @@ namespace spine {
void SkeletonRenderer::drawDebug (Renderer* renderer, const Mat4 &transform, uint32_t transformFlags) { void SkeletonRenderer::drawDebug (Renderer* renderer, const Mat4 &transform, uint32_t transformFlags) {
#if !defined(USE_MATRIX_STACK_PROJECTION_ONLY) #if !defined(USE_MATRIX_STACK_PROJECTION_ONLY)
Director* director = Director::getInstance(); Director* director = Director::getInstance();
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform); director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform);
#endif #endif
DrawNode* drawNode = DrawNode::create(); DrawNode* drawNode = DrawNode::create();
// Draw bounding rectangle // Draw bounding rectangle
if (_debugBoundingRect) { if (_debugBoundingRect) {
#if COCOS2D_VERSION < 0x00040000
glLineWidth(2); glLineWidth(2);
#else
drawNode->setLineWidth(2.0f);
#endif
const cocos2d::Rect brect = getBoundingBox(); const cocos2d::Rect brect = getBoundingBox();
const Vec2 points[4] = const Vec2 points[4] =
{ {
@ -642,7 +663,11 @@ namespace spine {
if (_debugSlots) { if (_debugSlots) {
// Slots. // Slots.
// DrawPrimitives::setDrawColor4B(0, 0, 255, 255); // DrawPrimitives::setDrawColor4B(0, 0, 255, 255);
glLineWidth(1); #if COCOS2D_VERSION < 0x00040000
glLineWidth(2);
#else
drawNode->setLineWidth(2.0f);
#endif
V3F_C4B_T2F_Quad quad; V3F_C4B_T2F_Quad quad;
for (int i = 0, n = _skeleton->getSlots().size(); i < n; i++) { for (int i = 0, n = _skeleton->getSlots().size(); i < n; i++) {
Slot* slot = _skeleton->getDrawOrder()[i]; Slot* slot = _skeleton->getDrawOrder()[i];
@ -670,7 +695,11 @@ namespace spine {
if (_debugBones) { if (_debugBones) {
// Bone lengths. // Bone lengths.
#if COCOS2D_VERSION < 0x00040000
glLineWidth(2); glLineWidth(2);
#else
drawNode->setLineWidth(2.0f);
#endif
for (int i = 0, n = _skeleton->getBones().size(); i < n; i++) { for (int i = 0, n = _skeleton->getBones().size(); i < n; i++) {
Bone *bone = _skeleton->getBones()[i]; Bone *bone = _skeleton->getBones()[i];
if (!bone->isActive()) continue; if (!bone->isActive()) continue;
@ -690,7 +719,11 @@ namespace spine {
if (_debugMeshes) { if (_debugMeshes) {
// Meshes. // Meshes.
glLineWidth(1); #if COCOS2D_VERSION < 0x00040000
glLineWidth(2);
#else
drawNode->setLineWidth(2.0f);
#endif
for (int i = 0, n = _skeleton->getSlots().size(); i < n; ++i) { for (int i = 0, n = _skeleton->getSlots().size(); i < n; ++i) {
Slot* slot = _skeleton->getDrawOrder()[i]; Slot* slot = _skeleton->getDrawOrder()[i];
if (!slot->getBone().isActive()) continue; if (!slot->getBone().isActive()) continue;
@ -716,9 +749,9 @@ namespace spine {
} }
drawNode->draw(renderer, transform, transformFlags); drawNode->draw(renderer, transform, transformFlags);
#if !defined(USE_MATRIX_STACK_PROJECTION_ONLY) #if !defined(USE_MATRIX_STACK_PROJECTION_ONLY)
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
#endif #endif
} }
cocos2d::Rect SkeletonRenderer::getBoundingBox () const { cocos2d::Rect SkeletonRenderer::getBoundingBox () const {
@ -777,11 +810,18 @@ namespace spine {
} }
void SkeletonRenderer::setTwoColorTint(bool enabled) { void SkeletonRenderer::setTwoColorTint(bool enabled) {
#if COCOS2D_VERSION > 0x00040000
_twoColorTint = enabled;
#endif
setupGLProgramState(enabled); setupGLProgramState(enabled);
} }
bool SkeletonRenderer::isTwoColorTint() { bool SkeletonRenderer::isTwoColorTint() {
#if COCOS2D_VERSION < 0x00040000
return getGLProgramState() == SkeletonTwoColorBatch::getInstance()->getTwoColorTintProgramState(); return getGLProgramState() == SkeletonTwoColorBatch::getInstance()->getTwoColorTintProgramState();
#else
return _twoColorTint;
#endif
} }
void SkeletonRenderer::setVertexEffect(VertexEffect *effect) { void SkeletonRenderer::setVertexEffect(VertexEffect *effect) {
@ -834,17 +874,17 @@ namespace spine {
} }
void SkeletonRenderer::onEnter () { void SkeletonRenderer::onEnter () {
#if CC_ENABLE_SCRIPT_BINDING #if CC_ENABLE_SCRIPT_BINDING
if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) return; if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) return;
#endif #endif
Node::onEnter(); Node::onEnter();
scheduleUpdate(); scheduleUpdate();
} }
void SkeletonRenderer::onExit () { void SkeletonRenderer::onExit () {
#if CC_ENABLE_SCRIPT_BINDING #if CC_ENABLE_SCRIPT_BINDING
if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExit)) return; if (_scriptType == kScriptTypeJavascript && ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnExit)) return;
#endif #endif
Node::onExit(); Node::onExit();
unscheduleUpdate(); unscheduleUpdate();
} }
@ -923,9 +963,9 @@ namespace spine {
void transformWorldVertices(float* dstCoord, int coordCount, Skeleton& skeleton, int startSlotIndex, int endSlotIndex) { void transformWorldVertices(float* dstCoord, int coordCount, Skeleton& skeleton, int startSlotIndex, int endSlotIndex) {
float* dstPtr = dstCoord; float* dstPtr = dstCoord;
#ifndef NDEBUG #ifndef NDEBUG
float* const dstEnd = dstCoord + coordCount; float* const dstEnd = dstCoord + coordCount;
#endif #endif
for (size_t i = 0; i < skeleton.getSlots().size(); ++i) { for (size_t i = 0; i < skeleton.getSlots().size(); ++i) {
/*const*/ Slot& slot = *skeleton.getDrawOrder()[i]; // match the draw order of SkeletonRenderer::Draw /*const*/ Slot& slot = *skeleton.getDrawOrder()[i]; // match the draw order of SkeletonRenderer::Draw
Attachment* const attachment = slot.getAttachment(); Attachment* const attachment = slot.getAttachment();
@ -967,8 +1007,10 @@ namespace spine {
} }
BlendFunc makeBlendFunc(int blendMode, bool premultipliedAlpha) { BlendFunc makeBlendFunc(BlendMode blendMode, bool premultipliedAlpha) {
BlendFunc blendFunc; BlendFunc blendFunc;
#if COCOS2D_VERSION < 0x00040000
switch (blendMode) { switch (blendMode) {
case BlendMode_Additive: case BlendMode_Additive:
blendFunc.src = premultipliedAlpha ? GL_ONE : GL_SRC_ALPHA; blendFunc.src = premultipliedAlpha ? GL_ONE : GL_SRC_ALPHA;
@ -987,13 +1029,32 @@ namespace spine {
blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;
break; break;
} }
#else
switch (blendMode) {
case BlendMode_Additive:
blendFunc.src = premultipliedAlpha ? backend::BlendFactor::ONE : backend::BlendFactor::SRC_ALPHA;
blendFunc.dst = backend::BlendFactor::ONE;
break;
case BlendMode_Multiply:
blendFunc.src = backend::BlendFactor::DST_COLOR;
blendFunc.dst = backend::BlendFactor::ONE_MINUS_SRC_ALPHA;
break;
case BlendMode_Screen:
blendFunc.src = backend::BlendFactor::ONE;
blendFunc.dst = backend::BlendFactor::ONE_MINUS_SRC_COLOR;
break;
default:
blendFunc.src = premultipliedAlpha ? backend::BlendFactor::ONE : backend::BlendFactor::SRC_ALPHA;
blendFunc.dst = backend::BlendFactor::ONE_MINUS_SRC_ALPHA;
}
#endif
return blendFunc; return blendFunc;
} }
bool cullRectangle(Renderer* renderer, const Mat4& transform, const cocos2d::Rect& rect) { bool cullRectangle(Renderer* renderer, const Mat4& transform, const cocos2d::Rect& rect) {
if (Camera::getVisitingCamera() == nullptr) if (Camera::getVisitingCamera() == nullptr)
return true; return false;
auto director = Director::getInstance(); auto director = Director::getInstance();
auto scene = director->getRunningScene(); auto scene = director->getRunningScene();
@ -1024,7 +1085,7 @@ namespace spine {
Color4B ColorToColor4B(const Color& color) { Color4B ColorToColor4B(const Color& color) {
return { (GLubyte)(color.r * 255.f), (GLubyte)(color.g * 255.f), (GLubyte)(color.b * 255.f), (GLubyte)(color.a * 255.f) }; return { (uint8_t)(color.r * 255.f), (uint8_t)(color.g * 255.f), (uint8_t)(color.b * 255.f), (uint8_t)(color.a * 255.f) };
} }
} }

View File

@ -30,8 +30,8 @@
#ifndef SPINE_SKELETONRENDERER_H_ #ifndef SPINE_SKELETONRENDERER_H_
#define SPINE_SKELETONRENDERER_H_ #define SPINE_SKELETONRENDERER_H_
#include <spine/spine.h>
#include "cocos2d.h" #include "cocos2d.h"
#include <spine/spine.h>
namespace spine { namespace spine {
@ -157,6 +157,7 @@ namespace spine {
int _startSlotIndex; int _startSlotIndex;
int _endSlotIndex; int _endSlotIndex;
bool _twoColorTint;
}; };
} }

View File

@ -66,6 +66,8 @@ static void setAttachmentVertices(MeshAttachment* attachment) {
Cocos2dAtlasAttachmentLoader::Cocos2dAtlasAttachmentLoader(Atlas* atlas): AtlasAttachmentLoader(atlas) { Cocos2dAtlasAttachmentLoader::Cocos2dAtlasAttachmentLoader(Atlas* atlas): AtlasAttachmentLoader(atlas) {
} }
Cocos2dAtlasAttachmentLoader::~Cocos2dAtlasAttachmentLoader() { }
void Cocos2dAtlasAttachmentLoader::configureAttachment(Attachment* attachment) { void Cocos2dAtlasAttachmentLoader::configureAttachment(Attachment* attachment) {
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) { if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
setAttachmentVertices((RegionAttachment*)attachment); setAttachmentVertices((RegionAttachment*)attachment);
@ -74,6 +76,36 @@ void Cocos2dAtlasAttachmentLoader::configureAttachment(Attachment* attachment) {
} }
} }
#if COCOS2D_VERSION >= 0x0040000
backend::SamplerAddressMode wrap (TextureWrap wrap) {
return wrap == TextureWrap_ClampToEdge ? backend::SamplerAddressMode::CLAMP_TO_EDGE : backend::SamplerAddressMode::REPEAT;
}
backend::SamplerFilter filter (TextureFilter filter) {
switch (filter) {
case TextureFilter_Unknown:
break;
case TextureFilter_Nearest:
return backend::SamplerFilter::NEAREST;
case TextureFilter_Linear:
return backend::SamplerFilter::LINEAR;
case TextureFilter_MipMap:
return backend::SamplerFilter::LINEAR;
case TextureFilter_MipMapNearestNearest:
return backend::SamplerFilter::NEAREST;
case TextureFilter_MipMapLinearNearest:
return backend::SamplerFilter::NEAREST;
case TextureFilter_MipMapNearestLinear:
return backend::SamplerFilter::LINEAR;
case TextureFilter_MipMapLinearLinear:
return backend::SamplerFilter::LINEAR;
}
return backend::SamplerFilter::LINEAR;
}
#else
GLuint wrap (TextureWrap wrap) { GLuint wrap (TextureWrap wrap) {
return wrap == TextureWrap_ClampToEdge ? GL_CLAMP_TO_EDGE : GL_REPEAT; return wrap == TextureWrap_ClampToEdge ? GL_CLAMP_TO_EDGE : GL_REPEAT;
} }
@ -100,14 +132,23 @@ GLuint filter (TextureFilter filter) {
return GL_LINEAR; return GL_LINEAR;
} }
#endif
Cocos2dTextureLoader::Cocos2dTextureLoader() : TextureLoader() { }
Cocos2dTextureLoader::~Cocos2dTextureLoader() { }
void Cocos2dTextureLoader::load(AtlasPage& page, const spine::String& path) { void Cocos2dTextureLoader::load(AtlasPage& page, const spine::String& path) {
Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path.buffer()); Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path.buffer());
CCASSERT(texture != nullptr, "Invalid image"); CCASSERT(texture != nullptr, "Invalid image");
if (texture) if (texture) {
{
texture->retain(); texture->retain();
Texture2D::TexParams textureParams = { filter(page.minFilter), filter(page.magFilter), wrap(page.uWrap), wrap(page.vWrap) }; #if COCOS2D_VERSION >= 0x0040000
Texture2D::TexParams textureParams(filter(page.minFilter), filter(page.magFilter), wrap(page.uWrap), wrap(page.vWrap));
#else
Texture2D::TexParams textureParams = {filter(page.minFilter), filter(page.magFilter), wrap(page.uWrap), wrap(page.vWrap)};
#endif
texture->setTexParameters(textureParams); texture->setTexParameters(textureParams);
page.setRendererObject(texture); page.setRendererObject(texture);
page.width = texture->getPixelsWide(); page.width = texture->getPixelsWide();
page.height = texture->getPixelsHigh(); page.height = texture->getPixelsHigh();
@ -115,13 +156,16 @@ void Cocos2dTextureLoader::load(AtlasPage& page, const spine::String& path) {
} }
void Cocos2dTextureLoader::unload(void* texture) { void Cocos2dTextureLoader::unload(void* texture) {
if (texture) if (texture) {
{
((Texture2D*)texture)->release(); ((Texture2D*)texture)->release();
} }
} }
Cocos2dExtension::Cocos2dExtension() : DefaultSpineExtension() { }
Cocos2dExtension::~Cocos2dExtension() { }
char *Cocos2dExtension::_readFile(const spine::String &path, int *length) { char *Cocos2dExtension::_readFile(const spine::String &path, int *length) {
Data data = FileUtils::getInstance()->getDataFromFile(FileUtils::getInstance()->fullPathForFilename(path.buffer())); Data data = FileUtils::getInstance()->getDataFromFile(FileUtils::getInstance()->fullPathForFilename(path.buffer()));
if (data.isNull()) return nullptr; if (data.isNull()) return nullptr;

View File

@ -34,18 +34,30 @@
#include "cocos2d.h" #include "cocos2d.h"
#include <spine/SkeletonRenderer.h> #include <spine/SkeletonRenderer.h>
#if COCOS2D_VERSION < 0x00040000
#include <spine/v3/SkeletonBatch.h>
#include <spine/v3/SkeletonTwoColorBatch.h>
#else
#include <spine/v4/SkeletonBatch.h>
#include <spine/v4/SkeletonTwoColorBatch.h>
#endif
#include <spine/SkeletonAnimation.h> #include <spine/SkeletonAnimation.h>
#include <spine/SkeletonBatch.h>
namespace spine { namespace spine {
class Cocos2dAtlasAttachmentLoader: public AtlasAttachmentLoader { class Cocos2dAtlasAttachmentLoader: public AtlasAttachmentLoader {
public: public:
Cocos2dAtlasAttachmentLoader(Atlas* atlas); Cocos2dAtlasAttachmentLoader(Atlas* atlas);
virtual ~Cocos2dAtlasAttachmentLoader();
virtual void configureAttachment(Attachment* attachment); virtual void configureAttachment(Attachment* attachment);
}; };
class Cocos2dTextureLoader: public TextureLoader { class Cocos2dTextureLoader: public TextureLoader {
public: public:
Cocos2dTextureLoader();
virtual ~Cocos2dTextureLoader();
virtual void load(AtlasPage& page, const String& path); virtual void load(AtlasPage& page, const String& path);
@ -54,6 +66,9 @@ namespace spine {
class Cocos2dExtension: public DefaultSpineExtension { class Cocos2dExtension: public DefaultSpineExtension {
public: public:
Cocos2dExtension();
virtual ~Cocos2dExtension();
protected: protected:
virtual char *_readFile(const String &path, int *length); virtual char *_readFile(const String &path, int *length);

View File

@ -27,7 +27,9 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include <spine/SkeletonBatch.h> #include <spine/spine-cocos2dx.h>
#if COCOS2D_VERSION < 0x00040000
#include <spine/Extension.h> #include <spine/Extension.h>
#include <algorithm> #include <algorithm>
@ -149,3 +151,6 @@ cocos2d::TrianglesCommand* SkeletonBatch::nextFreeCommand() {
return _commandsPool[_nextFreeCommand++]; return _commandsPool[_nextFreeCommand++];
} }
} }
#endif

View File

@ -30,8 +30,10 @@
#ifndef SPINE_SKELETONBATCH_H_ #ifndef SPINE_SKELETONBATCH_H_
#define SPINE_SKELETONBATCH_H_ #define SPINE_SKELETONBATCH_H_
#include <spine/spine.h>
#include "cocos2d.h" #include "cocos2d.h"
#if COCOS2D_VERSION < 0x00040000
#include <spine/spine.h>
#include <vector> #include <vector>
namespace spine { namespace spine {
@ -72,4 +74,6 @@ namespace spine {
} }
#endif
#endif // SPINE_SKELETONBATCH_H_ #endif // SPINE_SKELETONBATCH_H_

View File

@ -27,7 +27,9 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include <spine/SkeletonTwoColorBatch.h> #include <spine/spine-cocos2dx.h>
#if COCOS2D_VERSION < 0x00040000
#include <spine/Extension.h> #include <spine/Extension.h>
#include <algorithm> #include <algorithm>
@ -345,3 +347,5 @@ TwoColorTrianglesCommand* SkeletonTwoColorBatch::nextFreeCommand() {
return command; return command;
} }
} }
#endif

View File

@ -30,8 +30,10 @@
#ifndef SPINE_SKELETONTWOCOLORBATCH_H_ #ifndef SPINE_SKELETONTWOCOLORBATCH_H_
#define SPINE_SKELETONTWOCOLORBATCH_H_ #define SPINE_SKELETONTWOCOLORBATCH_H_
#include <spine/spine.h>
#include "cocos2d.h" #include "cocos2d.h"
#if COCOS2D_VERSION < 0x00040000
#include <spine/spine.h>
#include <vector> #include <vector>
namespace spine { namespace spine {
@ -165,4 +167,6 @@ namespace spine {
}; };
} }
#endif
#endif // SPINE_SKELETONTWOCOLORBATCH_H_ #endif // SPINE_SKELETONTWOCOLORBATCH_H_

View File

@ -0,0 +1,193 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated May 1, 2019. Replaces all prior versions.
*
* Copyright (c) 2013-2019, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS
* INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/spine-cocos2dx.h>
#if COCOS2D_VERSION >= 0x00040000
#include <spine/Extension.h>
#include <algorithm>
USING_NS_CC;
#define EVENT_AFTER_DRAW_RESET_POSITION "director_after_draw"
using std::max;
#define INITIAL_SIZE (10000)
#include "renderer/ccShaders.h"
#include "renderer/backend/Device.h"
namespace spine {
static SkeletonBatch* instance = nullptr;
SkeletonBatch* SkeletonBatch::getInstance () {
if (!instance) instance = new SkeletonBatch();
return instance;
}
void SkeletonBatch::destroyInstance () {
if (instance) {
delete instance;
instance = nullptr;
}
}
SkeletonBatch::SkeletonBatch () {
auto program = backend::Device::getInstance()->newProgram(positionTextureColor_vert, positionTextureColor_frag);
_programState = std::make_shared<backend::ProgramState>(program);
program->autorelease();
auto vertexLayout = _programState->getVertexLayout();
vertexLayout->setAttribute("a_position", 0, backend::VertexFormat::FLOAT3, offsetof(V3F_C4B_T2F, vertices), false);
vertexLayout->setAttribute("a_color", 2, backend::VertexFormat::UBYTE4, offsetof(V3F_C4B_T2F, colors), true);
vertexLayout->setAttribute("a_texCoord", 1, backend::VertexFormat::FLOAT2, offsetof(V3F_C4B_T2F, texCoords), false);
vertexLayout->setLayout(sizeof(_vertices[0]));
_locMVP = _programState->getUniformLocation("u_MVPMatrix");
_locTexture = _programState->getUniformLocation("u_texture");
for (unsigned int i = 0; i < INITIAL_SIZE; i++) {
_commandsPool.push_back(createNewTrianglesCommand());
}
reset();
// callback after drawing is finished so we can clear out the batch state
// for the next frame
Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom* eventCustom) {
this->update(0);
});;
}
SkeletonBatch::~SkeletonBatch () {
Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION);
for (unsigned int i = 0; i < _commandsPool.size(); i++) {
CC_SAFE_RELEASE(_commandsPool[i]->getPipelineDescriptor().programState);
delete _commandsPool[i];
_commandsPool[i] = nullptr;
}
}
void SkeletonBatch::update (float delta) {
reset();
}
cocos2d::V3F_C4B_T2F* SkeletonBatch::allocateVertices(uint32_t numVertices) {
if (_vertices.size() - _numVertices < numVertices) {
cocos2d::V3F_C4B_T2F* oldData = _vertices.data();
_vertices.resize((_vertices.size() + numVertices) * 2 + 1);
cocos2d::V3F_C4B_T2F* newData = _vertices.data();
for (uint32_t i = 0; i < this->_nextFreeCommand; i++) {
TrianglesCommand* command = _commandsPool[i];
cocos2d::TrianglesCommand::Triangles& triangles = (cocos2d::TrianglesCommand::Triangles&)command->getTriangles();
triangles.verts = newData + (triangles.verts - oldData);
}
}
cocos2d::V3F_C4B_T2F* vertices = _vertices.data() + _numVertices;
_numVertices += numVertices;
return vertices;
}
void SkeletonBatch::deallocateVertices(uint32_t numVertices) {
_numVertices -= numVertices;
}
unsigned short* SkeletonBatch::allocateIndices(uint32_t numIndices) {
if (_indices.getCapacity() - _indices.size() < numIndices) {
unsigned short* oldData = _indices.buffer();
int oldSize = _indices.size();
_indices.ensureCapacity(_indices.size() + numIndices);
unsigned short* newData = _indices.buffer();
for (uint32_t i = 0; i < this->_nextFreeCommand; i++) {
TrianglesCommand* command = _commandsPool[i];
cocos2d::TrianglesCommand::Triangles& triangles = (cocos2d::TrianglesCommand::Triangles&)command->getTriangles();
if (triangles.indices >= oldData && triangles.indices < oldData + oldSize) {
triangles.indices = newData + (triangles.indices - oldData);
}
}
}
unsigned short* indices = _indices.buffer() + _indices.size();
_indices.setSize(_indices.size() + numIndices, 0);
return indices;
}
void SkeletonBatch::deallocateIndices(uint32_t numIndices) {
_indices.setSize(_indices.size() - numIndices, 0);
}
cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer, float globalOrder, cocos2d::Texture2D* texture, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags) {
TrianglesCommand* command = nextFreeCommand();
const cocos2d::Mat4& projectionMat = Director::getInstance()->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
auto programState = command->getPipelineDescriptor().programState;
CCASSERT(programState, "programState should not be null");
programState->setUniform(_locMVP, projectionMat.m, sizeof(projectionMat.m));
programState->setTexture(_locTexture, 0, texture->getBackendTexture());
command->init(globalOrder, texture, blendType, triangles, mv, flags);
renderer->addCommand(command);
return command;
}
void SkeletonBatch::reset() {
_nextFreeCommand = 0;
_numVertices = 0;
_indices.setSize(0, 0);
}
cocos2d::TrianglesCommand* SkeletonBatch::nextFreeCommand() {
if (_commandsPool.size() <= _nextFreeCommand) {
unsigned int newSize = _commandsPool.size() * 2 + 1;
for (int i = _commandsPool.size(); i < newSize; i++) {
_commandsPool.push_back(createNewTrianglesCommand());
}
}
auto* command = _commandsPool[_nextFreeCommand++];
auto& pipelineDescriptor = command->getPipelineDescriptor();
if (pipelineDescriptor.programState == nullptr)
{
CCASSERT(_programState, "programState should not be null");
pipelineDescriptor.programState = _programState->clone();
}
return command;
}
cocos2d::TrianglesCommand *SkeletonBatch::createNewTrianglesCommand() {
auto* command = new TrianglesCommand();
return command;
}
}
#endif

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