加入5套spine官方运行时
This commit is contained in:
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.25)
|
|||||||
|
|
||||||
project(DateToSpine VERSION 0.1.0 LANGUAGES CXX)
|
project(DateToSpine VERSION 0.1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
|
include(cmake/OfflineDependencies.cmake)
|
||||||
|
|
||||||
option(DTS_BUILD_TESTS "Build DateToSpine tests" ON)
|
option(DTS_BUILD_TESTS "Build DateToSpine tests" ON)
|
||||||
option(DTS_BUILD_GUI "Build the DateToSpine desktop application" ON)
|
option(DTS_BUILD_GUI "Build the DateToSpine desktop application" ON)
|
||||||
option(DTS_BUILD_RUNTIME_PLUGINS "Build bundled Spine runtime adapters" ON)
|
option(DTS_BUILD_RUNTIME_PLUGINS "Build bundled Spine runtime adapters" ON)
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# DateToSpine is distributed as a source-complete offline project. Configuration
|
||||||
|
# must fail when a vendored dependency is missing; it must never fetch one.
|
||||||
|
set(FETCHCONTENT_FULLY_DISCONNECTED ON CACHE BOOL
|
||||||
|
"Never download dependencies while configuring DateToSpine" FORCE)
|
||||||
|
set(FETCHCONTENT_UPDATES_DISCONNECTED ON CACHE BOOL
|
||||||
|
"Never update dependencies while configuring DateToSpine" FORCE)
|
||||||
|
|
||||||
|
function(dts_require_vendored_spine version_line runtime_subdirectory)
|
||||||
|
set(version_root
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/spine-runtimes/${version_line}")
|
||||||
|
set(runtime_root "${version_root}/${runtime_subdirectory}")
|
||||||
|
foreach(required_file IN ITEMS
|
||||||
|
"${version_root}/LICENSE"
|
||||||
|
"${runtime_root}/include/spine/spine.h")
|
||||||
|
if(NOT EXISTS "${required_file}")
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"Offline dependency is incomplete: ${required_file}\n"
|
||||||
|
"Restore the vendored files from the DateToSpine source package. "
|
||||||
|
"CMake will not download them.")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
dts_require_vendored_spine("3.8" "spine-cpp/spine-cpp")
|
||||||
|
dts_require_vendored_spine("4.0" "spine-cpp/spine-cpp")
|
||||||
|
dts_require_vendored_spine("4.1" "spine-cpp/spine-cpp")
|
||||||
|
dts_require_vendored_spine("4.2" "spine-cpp/spine-cpp")
|
||||||
|
dts_require_vendored_spine("4.3" "spine-cpp")
|
||||||
@@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
CMake 只用于开发构建,不是最终用户的运行依赖。Windows 可以使用 Visual Studio Generator 或 Ninja + MSVC。
|
CMake 只用于开发构建,不是最终用户的运行依赖。Windows 可以使用 Visual Studio Generator 或 Ninja + MSVC。
|
||||||
|
|
||||||
|
五个版本的官方 `spine-cpp` 以普通 vendor 源码纳入主仓库,不使用 Git Submodule。CMake 配置启用完全断开模式并检查必要头文件与许可证;缺失时明确失败,绝不执行依赖下载。这样内网只需克隆一次主仓库即可构建。
|
||||||
|
|
||||||
## 2. 分层结构
|
## 2. 分层结构
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ Spine Editor 是外部前置软件。DateToSpine 不控制 Editor 自身的授
|
|||||||
|
|
||||||
## 2. 构建期与运行期网络
|
## 2. 构建期与运行期网络
|
||||||
|
|
||||||
- 开发机可以联网取得依赖和官方测试资源。
|
- 五套正式 Spine Runtime 源码直接随主仓库提供,不使用 Submodule、FetchContent 或构建期下载。
|
||||||
- 正式依赖必须锁定版本和校验值。
|
- 内网环境克隆主仓库后即可取得完整 Runtime;若文件缺失,CMake 直接报错,不尝试联网补齐。
|
||||||
- 可复现构建应支持从内部或本地依赖缓存构建。
|
- Qt、CMake 和编译器属于预先安装的构建工具,不由本项目联网安装。
|
||||||
|
- 官方测试资源只存在于开发源码树,不进入最终安装包。
|
||||||
- 最终应用运行时不得使用网络。
|
- 最终应用运行时不得使用网络。
|
||||||
- CI 下载的官方测试资源不进入打包阶段的输入集合。
|
- CI 下载的官方测试资源不进入打包阶段的输入集合。
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ DateToSpine 是一个面向 macOS 和 Windows 的离线桌面工具,用于扫
|
|||||||
6. Atlas 纹理只使用 Spine 官方 Texture Unpacker 解包,不提供自研兜底。
|
6. Atlas 纹理只使用 Spine 官方 Texture Unpacker 解包,不提供自研兜底。
|
||||||
7. 软件运行期不使用 CDN、在线 API、在线依赖下载、遥测或资源上传。
|
7. 软件运行期不使用 CDN、在线 API、在线依赖下载、遥测或资源上传。
|
||||||
8. 官方测试资源仅用于开发和 CI 测试,不进入最终安装包。
|
8. 官方测试资源仅用于开发和 CI 测试,不进入最终安装包。
|
||||||
|
9. 五套官方 Runtime 源码由主仓库直接携带,不使用 Submodule 或构建期下载。
|
||||||
9. 最终安装包只携带 Runtime 许可、第三方许可和必要声明,不携带 Spine Editor 或官方示例资源。
|
9. 最终安装包只携带 Runtime 许可、第三方许可和必要声明,不携带 Spine Editor 或官方示例资源。
|
||||||
10. 自研源文件按职责拆分,禁止出现数千行的业务代码文件。
|
10. 自研源文件按职责拆分,禁止出现数千行的业务代码文件。
|
||||||
11. 主界面只保留拖入资源、预览/动画切换和一键转换;仅在 Editor 自动识别失败时请求路径。
|
11. 主界面只保留拖入资源、预览/动画切换和一键转换;仅在 Editor 自动识别失败时请求路径。
|
||||||
|
|||||||
-1
Submodule DateToSpine/third_party/spine-runtimes/3.8 deleted from 8b4844bd4b
@@ -0,0 +1,19 @@
|
|||||||
|
CMakeLists.txt
|
||||||
|
examples
|
||||||
|
spine-as3
|
||||||
|
spine-c
|
||||||
|
spine-cocos2d-objc
|
||||||
|
spine-cocos2dx
|
||||||
|
spine-corona
|
||||||
|
spine-csharp
|
||||||
|
spine-js
|
||||||
|
spine-libgdx
|
||||||
|
spine-love
|
||||||
|
spine-lua
|
||||||
|
spine-monogame
|
||||||
|
spine-sfml
|
||||||
|
spine-starling
|
||||||
|
spine-threejs
|
||||||
|
spine-tk2d
|
||||||
|
spine-unity
|
||||||
|
spine-xna
|
||||||
@@ -0,0 +1,922 @@
|
|||||||
|
# 3.8
|
||||||
|
|
||||||
|
## AS3
|
||||||
|
* **Breaking changes**
|
||||||
|
* Renamed `Slot#getAttachmentVertices()` to `Slot#getDeform()`.
|
||||||
|
* Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports.
|
||||||
|
* Renamed `Skin#addAttachment()` to `Skin#setAttachment()`.
|
||||||
|
* Removed `VertexAttachment#applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied.
|
||||||
|
* Removed `inheritDeform` field, getter, and setter from `MeshAttachment`.
|
||||||
|
* Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably.
|
||||||
|
* Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.
|
||||||
|
* Switched projects from FDT to Visual Studio Code. See updated `README.md` files for instructions.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added `SkeletonBinary` to load binary `.skel` files. See `MixAndMatchExample.as` in `spine-startling-example`.
|
||||||
|
* Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`.
|
||||||
|
* Added support for rotated mesh region UVs.
|
||||||
|
* Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them.
|
||||||
|
* Improved Skin API to make it easier to handle mix-and-match use cases.
|
||||||
|
* Added `Skin#getAttachments()`. Returns all attachments in the skin.
|
||||||
|
* Added `Skin#getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index.
|
||||||
|
* Added `Skin#addSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin.
|
||||||
|
* Added `Skin#copySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.
|
||||||
|
* Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
|
||||||
|
* Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
|
||||||
|
* Added IK softness.
|
||||||
|
|
||||||
|
### Starling
|
||||||
|
* Added `MixAndMatchExample.as` to demonstrate the new Skin API additions and how to load binary `.skel` files.
|
||||||
|
* Switched projects from FDT to Visual Studio Code. See updated `README.md` files for instructions.
|
||||||
|
|
||||||
|
## C
|
||||||
|
* **Breaking changes**
|
||||||
|
* Renamed `spSlot#attachmentVertices` to `spSlot#deform`.
|
||||||
|
* Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports.
|
||||||
|
* Renamed `spSkin_addAttachment()` to `Skin#spSkin_addAttachment()`.
|
||||||
|
* Removed `spVertexAttachment_applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `spDeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied.
|
||||||
|
* Removed `inheritDeform` field, getter, and setter from `spMeshAttachment`.
|
||||||
|
* Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably.
|
||||||
|
* Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added `x` and `y` coordinates for setup pose AABB in `spSkeletonData`.
|
||||||
|
* Added support for rotated mesh region UVs.
|
||||||
|
* Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them.
|
||||||
|
* Improved Skin API to make it easier to handle mix-and-match use cases.
|
||||||
|
* Added `spSkin_getAttachments()`. Returns all attachments in the skin.
|
||||||
|
* Added `spSkin_getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index.
|
||||||
|
* Added `spSkin_addSkin(spSkin* skin)`. Adds all attachments, bones, and skins from the specified skin to this skin.
|
||||||
|
* Added `spSkin_copySkin(spSkin* skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `spVertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.
|
||||||
|
* All attachments inserted into skins are reference counted. When the last skin referencing an attachment is disposed, the attachment will also be disposed.
|
||||||
|
* Added `spAttachment_copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
|
||||||
|
* Added `spMeshAttachment_newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
|
||||||
|
* Added IK softness.
|
||||||
|
|
||||||
|
### Cocos2d-Objc
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
* Added `IKExample`.
|
||||||
|
* Added `SkeletonAnimation preUpdateWorldTransformsListener` and `SkeletonAnimation postUpdateWorldTransformsListener`. When set, these callbacks will be invokved before and after the skeleton's `updateWorldTransforms()` method is called. See the `IKExample` how it can be used.
|
||||||
|
|
||||||
|
### SFML
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
* Added `IKExample`.
|
||||||
|
|
||||||
|
## C++
|
||||||
|
* **Breaking Changes**
|
||||||
|
* Renamed `Slot::getAttachmentVertices()` to `Slot::getDeform()`.
|
||||||
|
* Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports.
|
||||||
|
* Renamed `Skin::addAttachment()` to `Skin::setAttachment()`.
|
||||||
|
* Removed `VertexAttachment::applyDeform()` and replaced it with `VertexAttachment::getDeformAttachment()`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied.
|
||||||
|
* Removed `_inheritDeform` field, getter, and setter from `MeshAttachment`.
|
||||||
|
* Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably.
|
||||||
|
* Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* `AnimationState` and `TrackEntry` now also accept a subclass of `AnimationStateListenerObject` as a listener for animation events in the overloaded `setListener()` method.
|
||||||
|
* `SkeletonBinary` and `SkeletonJson` now parse and set all non-essential data like audio path.
|
||||||
|
* Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`.
|
||||||
|
* Added support for rotated mesh region UVs.
|
||||||
|
* Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them.
|
||||||
|
* Improved Skin API to make it easier to handle mix-and-match use cases.
|
||||||
|
* Added `Skin#getAttachments()`. Returns all attachments in the skin.
|
||||||
|
* Added `Skin#getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index.
|
||||||
|
* Added `Skin#addSkin(Skin &skin)`. Adds all attachments, bones, and skins from the specified skin to this skin.
|
||||||
|
* Added `Skin#copySkin(Skin &skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.
|
||||||
|
* All attachments inserted into skins are reference counted. When the last skin referencing an attachment is disposed, the attachment will also be disposed.
|
||||||
|
* Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
|
||||||
|
* Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
|
||||||
|
* Added IK softness.
|
||||||
|
* Exposed `x` and `y` on `SkeletonData` through getters and setters.
|
||||||
|
|
||||||
|
* **Bug fixes**
|
||||||
|
* Fixed binary skeleton loading to stop after default skin attachment load errors, preventing corrupted reads when atlas regions are missing.
|
||||||
|
|
||||||
|
### Cocos2d-x
|
||||||
|
* Updated to cocos2d-x 3.17.1
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
* Exmaple project requires Visual Studio 2019 on Windows
|
||||||
|
* Added `IKExample`.
|
||||||
|
* Added `SkeletonAnimation::setPreUpdateWorldTransformsListener()` and `SkeletonAnimation::setPreUpdateWorldTransformsListener()`. When set, these callbacks will be invokved before and after the skeleton's `updateWorldTransforms()` method is called. See the `IKExample` how it can be used.
|
||||||
|
|
||||||
|
### SFML
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
|
||||||
|
### UE4
|
||||||
|
* Added `bAutoPlaying` flag to `USpineSkeletonAnimationComponent`. When `false`, the component will not update the internal animation state and skeleton.
|
||||||
|
* Updated example project to UE 4.22.
|
||||||
|
* (Re-)Importing Spine assets will perform a version compatibility check and alert users about mismatches in editor mode.
|
||||||
|
* `USpineSkeletonRendererComponent` allows passing a `USpineSkeletonComponent` to update it. This way, the renderer component can be used without a skeleton component on the same actor.
|
||||||
|
* Added blueprint-callable methods to `SpineSkeletonComponent` and `SpineSkeletonAnimationComponent` to query and set skins, and enumerate bones, slots, and animations.
|
||||||
|
* Extended skeleton data editor preview. The preview now shows bones, slots, animations, and skins found in the skeleton data. See this [blog post](http://esotericsoftware.com/blog/Unreal-Engine-4-quality-of-life-improvements).
|
||||||
|
* Added preview animation and skin fields, allowing you to preview animations and skins right in the editor. See this [blog post](http://esotericsoftware.com/blog/Unreal-Engine-4-quality-of-life-improvements).
|
||||||
|
* Removed dependency on `RHI`, `RenderCore`, and `ShaderCore`.
|
||||||
|
* Re-importing atlases and their textures now works consistently in all situations.
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
* Materials on `SkeletonRendererComponent` are now blueprint read and writeable. This allows setting dynamic material instances at runtime.
|
||||||
|
* Added `InitialSkin` property to `USpineWidget`. This allows previewing different skins in the UMG Designer. Initial skins can still be overridden via blueprint events such as `On Initialized`.
|
||||||
|
|
||||||
|
## C# ##
|
||||||
|
* **Breaking changes**
|
||||||
|
* **Changed `IkConstraintData.Bones` type from `List<BoneData>` to `ExposedList<BoneData>`** for unification reasons. *Note: this modification will most likely not affect user code.*
|
||||||
|
* Renamed `Slot.AttachmentVertices` to `Slot.Deform`.
|
||||||
|
* Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports.
|
||||||
|
* Renamed `Skin.AddAttachment()` to `Skin.SetAttachment()`.
|
||||||
|
* Removed `FindAttachmentsForSlot(int slotIndex, List<Attachment> attachments)` and `FindNamesForSlot (int slotIndex, List<string> names)` and replaced it with `Skin.GetAttachments(int slotIndex, List<SkinEntry> attachments)` which returns the combined `SkinEntry` object holding both name and attachment.
|
||||||
|
* Removed `VertexAttachment.ApplyDeform()` and replaced it with `VertexAttachment.DeformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied.
|
||||||
|
* Removed `inheritDeform` field, getter, and setter from `MeshAttachment`.
|
||||||
|
* Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably.
|
||||||
|
* Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`.
|
||||||
|
* Added support for rotated mesh region UVs.
|
||||||
|
* Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them.
|
||||||
|
* Improved Skin API to make it easier to handle mix-and-match use cases.
|
||||||
|
* Added `Skin.GetAttachments()`. Returns all attachments in the skin.
|
||||||
|
* Added `Skin.GetAttachments(int slotIndex, List<SkinEntry> attachments)`. Returns all attachements in the skin for the given slot index. This method replaces `FindAttachmentsForSlot` and `FindNamesForSlot`.
|
||||||
|
* Added `Skin.AddSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin.
|
||||||
|
* Added `Skin.CopySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.
|
||||||
|
* Added `Attachment.Copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
|
||||||
|
* Added `MeshAttachment.NewLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
|
||||||
|
* Added IK softness.
|
||||||
|
|
||||||
|
### Unity
|
||||||
|
|
||||||
|
* **Breaking changes**
|
||||||
|
* **Officially supported Unity versions are 2017.1-2020.2**.
|
||||||
|
* **Spine `.asmdef` files are again active by default**. They have previously been deactivated to `.txt` extension which is now no longer necessary.
|
||||||
|
* **Removed PoseSkeleton() and PoseWithAnimation()** extension methods to prevent issues where animations are not mixed out. Problem was that these methods did not set AnimationState, leaving incorrect state at e.g. attachments enabled at slots when starting subsequent animations. As a replacement you can use `AnimationState.ClearTrack(0);` followed by `var entry = AnimationState.SetAnimation(0, animation, loop); entry.TrackTime = time` to achieve similar behaviour.
|
||||||
|
* **The `Shadow alpha cutoff` shader parameter is now respecting slot-color alpha** values at all Spine shaders. A fragment's texture color alpha is multiplied with slot-color alpha before the result is tested against the `Shadow alpha cutoff` threshold.
|
||||||
|
* **Removed redundant `Attachment.GetClone()` and `MeshAttachment.GetLinkedClone()` extension methods**. Use methods `Attachment.Copy` and `MeshAttachment.NewLinkedMesh()` instead.
|
||||||
|
* **Renamed extension method `Attachment.GetClone(bool cloneMeshesAsLinked)` to `Attachment.GetCopy(bool cloneMeshesAsLinked)`** to follow the naming scheme of the Spine API.
|
||||||
|
* `SkeletonDataAsset.atlasAssets` is now an array of the base class `AtlasAssetBase` instead of `SpineAtlasAsset`, which provides `IEnumerable<> Materials` instead of `List<> materials`. Replace any access via `atlasAsset.materials[0]` with `atlasAsset.Materials.First()` and add a `using System.Linq;` statement.
|
||||||
|
* **Changed `MeshAttachment.GetLinkedMesh()` method signatures:** removed optional parameters `bool inheritDeform = true, bool copyOriginalProperties = false`.
|
||||||
|
* Changed namespace `Spine.Unity.Modules` to `Spine.Unity` and `Spine.Unity.Examples` after restructuring (see section below) in respective classes:
|
||||||
|
* When receiving namespace related errors, replace using statements of `using Spine.Unity.Modules.AttachmentTools;` with `using Spine.Unity.AttachmentTools;`. You can remove `using Spine.Unity.Modules;` statements when a `using Spine.Unity` statement is already present in the file.
|
||||||
|
* `AttachmentTools`, `SkeletonPartsRenderer`, `SkeletonRenderSeparator`, `SkeletonRendererCustomMaterials` changed to namespace `Spine.Unity`.
|
||||||
|
* `SkeletonGhost`, `SkeletonGhostRenderer`, `AtlasRegionAttacher`, `SkeletonGraphicMirror`, `SkeletonRagdoll`, `SkeletonRagdoll2D`, `SkeletonUtilityEyeConstraint`, `SkeletonUtilityGroundConstraint`, `SkeletonUtilityKinematicShadow` changed to namespace `Spine.Unity.Examples`.
|
||||||
|
* Split `Editor/Utility/SpineEditorUtilities` class into multiple files with partial class qualifier.
|
||||||
|
* Nested classes `SpineEditorUtilities.AssetUtility` and `SpineEditorUtilities.EditorInstantiation` are now no longer nested. If you receive namespace related errors, replace any occurrance of
|
||||||
|
* `SpineEditorUtilities.AssetUtility` with `AssetUtility` and
|
||||||
|
* `SpineEditorUtilities.EditorInstantiation` with `EditorInstantiation`.
|
||||||
|
* **Timeline Support has been moved to a separate UPM Package** Previously the Spine Timeline integration was located in the `Modules/Timeline` directory and was deactivated by default, making it necessary to activate it via the Spine Preferences. Now the Timeline integration has been moved to an additional UPM package which can be found under `Modules/com.esotericsoftware.spine.timeline`.
|
||||||
|
* **Installation:** You can download the Unity Package Manager (UPM) package via the [download page](http://esotericsoftware.com/spine-unity-download) or find it in the [spine-runtimes/spine-unity/Modules](https://github.com/EsotericSoftware/spine-runtimes/tree/3.8-beta/spine-unity/Modules) subdirectory on the git repository. You can then either unzip (copy if using git) the package to
|
||||||
|
a) the `Packages` directory in your project where it will automatically be loaded, or
|
||||||
|
b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the `+` icon, choose `Add package from disk..` and point it to the package.json file.
|
||||||
|
The Project panel should now show an entry `Spine Timeline Extensions` under `Packages`. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.
|
||||||
|
* `SkeletonMecanim`'s `Layer Mix Mode` enum name `MixMode.SpineStyle` has been renamed to `MixMode.Hard`. This is most likely not set via code and thus unlikely to be a problem. Serialized scenes and prefabs are unaffected.
|
||||||
|
* `SkeletonRootMotion` and `SkeletonMecanimRootMotion` components now support arbitrary bones in the hierarchy as `Root Motion Bone`. Previously there were problems when selecting a non-root bone as `Root Motion Bone`. `Skeleton.ScaleX` and `.ScaleY` and parent bone scale is now respected as well.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* **Spine Preferences stored in Assets/Editor/SpineSettings.asset** Now Spine uses the new `SettingsProvider` API, storing settings in a SpineSettings.asset file which can be shared with team members. Your old preferences are automatically migrated to the new system.
|
||||||
|
* Added support for Unity's SpriteMask to `SkeletonAnimation` and `SkeletonMecanim`. All mask interaction modes are supported. See this [blog post](http://esotericsoftware.com/blog/Unity-SpriteMask-and-RectMask2D-support).
|
||||||
|
* Added support for Unity's RectMask2D to SkeletonGraphics. See this [blog post](http://esotericsoftware.com/blog/Unity-SpriteMask-and-RectMask2D-support).
|
||||||
|
* Added `Create 2D Hinge Chain` button at `SkeletonUtilityBone` inspector, previously only `Create 3D Hinge Chain` was available.
|
||||||
|
* **Now supporting Lightweight Render Pipeline (LWRP) through an additional UPM package.**
|
||||||
|
* **Installation:** You can download the Unity Package Manager (UPM) package via the [download page](http://esotericsoftware.com/spine-unity-download) or find it in the [spine-runtimes/spine-unity/Modules](https://github.com/EsotericSoftware/spine-runtimes/tree/3.8-beta/spine-unity/Modules) subdirectory on the git repository. You can then either unzip (copy if using git) the package to
|
||||||
|
* a) the `Packages` directory in your project where it will automatically be loaded, or
|
||||||
|
* b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the `+` icon, choose `Add package from disk..` and point it to the package.json file.
|
||||||
|
|
||||||
|
> If you are using git and Unity 2019.2 or newer versions and receive an error that dependencies could not be resolved by the package manager (only higher versions of Unity's `Lightweight RP` package are available, e.g. `6.9.0` and up), please copy the prepared package-UNITYVERSION.json file for your Unity version (e.g. `package-2019.2.json`) over the existing package.json file to change the dependency accordingly. Unfortunately Unity's Package Manager does not provide a way to specify a version range for a dependency like "5.7.2 - 6.9.0" yet, so this manual step is necessary for git users.
|
||||||
|
|
||||||
|
The Project panel should now show an entry `Spine Lightweight RP Shaders` under `Packages`. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.
|
||||||
|
* **Usage:** The package provides two shaders specifically built for the lightweight render pipeline:
|
||||||
|
* `Lightweight Render Pipeline/Spine/Skeleton`, as a lightweight variant of the `Spine/Skeleton` shader,
|
||||||
|
* `Lightweight Render Pipeline/Spine/Skeleton Lit`, as a lightweight variant of the `Spine/Skeleton Lit` shader and
|
||||||
|
* `Lightweight Render Pipeline/Spine/Sprite`, as a lightweight variant of the `Spine/Sprite/Vertex Lit` and `Pixel Lit` shaders, which were not functioning in the lightweight render pipeline. The shaders can be assigned to materials as usual and will respect your settings of the assigned `LightweightRenderPipelineAsset` under `Project Settings - Graphics`.
|
||||||
|
* **Restrictions** As all Spine shaders, the LWRP shaders **do not support `Premultiply alpha` (PMA) atlas textures in Linear color space**. Please export your atlas textures as `straight alpha` textures with disabled `Premultiply alpha` setting when using Linear color space. You can check the current color space via `Project Settings - Player - Other Settings - Color Space.`.
|
||||||
|
* **Example:** You can find an example scene in the package under `com.esotericsoftware.spine.lwrp-shaders-3.8/Examples/LWRP Shaders.unity` that demonstrates usage of the LWRP shaders.
|
||||||
|
* Added `Spine/Skeleton Lit ZWrite` shader. This variant of the `Spine/Skeleton Lit` shader writes to the depth buffer with configurable depth alpha threshold. Apart from that it is identical to `Spine/Skeleton Lit`.
|
||||||
|
* Additional yield instructions to wait for animation track events `End`, `Complete` and `Interrupt`.
|
||||||
|
* `WaitForSpineAnimationComplete` now proves an additional `bool includeEndEvent` parameter, defaults to `false` (previous behaviour).
|
||||||
|
* Added a new `WaitForSpineAnimationEnd` yield instruction.
|
||||||
|
* Added a new generic `WaitForSpineAnimation` yield instruction which can be configured to wait for any combination of animation track events. It is now used as base class for `WaitForSpineAnimationComplete` and `WaitForSpineAnimationEnd`.
|
||||||
|
* Additional **Fix Draw Order** parameter at SkeletonRenderer, defaults to `disabled` (previous behaviour).
|
||||||
|
Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A").
|
||||||
|
If true, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes
|
||||||
|
by e.g. the LWRP renderer, leading to incorrect draw order (e.g. "A1 B A2" changed to "A1A2 B").
|
||||||
|
You can leave this parameter disabled when everything is drawn correctly to save the additional performance cost.
|
||||||
|
* **Additional Timeline features.** SpineAnimationStateClip now provides a `Speed Multiplier`, a start time offset parameter `Clip In`, support for blending successive animations by overlapping tracks. An additional `Use Blend Duration` parameter *(defaults to true)* allows for automatic synchronisation of MixDuration with the current overlap blend duration. An additional Spine preferences parameter `Use Blend Duration` has been added which can be disabled to default to the previous behaviour before this update.
|
||||||
|
* Additional `SpriteMask and RectMask2D` example scene added for demonstration of mask setup and interaction.
|
||||||
|
* `Real physics hinge chains` for both 2D and 3D physics. The [SkeletonUtilityBone](http://esotericsoftware.com/spine-unity#SkeletonUtilityBone) Inspector provides an interface to create 2D and 3D hinge chains. Previously created chains have only been respecting gravity, but not momentum of the skeleton or parent bones. The new physics rig created when pressing `Create 3D Hinge Chain` and `Create 2D Hinge Chain` creates a more complex setup that also works when flipping the skeleton. Note that the chain root node is no longer parented to bones of the skeleton. This is a requirement in Unity to have momentum applied properly - do not reparent the chain root to bones of your skeleton, or you will loose any momentum applied by the skeleton's movement.
|
||||||
|
* `Outline rendering functionality for all shaders.` Every shader now provides an additional set of `Outline` parameters to enable custom outline rendering. When outline rendering is enabled via the `Material` inspector, it automatically switches the shader to the respective `Spine/Outline` shader variant. Outlines are generated by sampling neighbour pixels, so be sure to add enough transparent padding when exporting your atlas textures to fit the desired outline width. In order to enable outline rendering at a skeleton, it is recommended to first prepare an additional outline material copy and then switch the material of the target skeleton to this material. This prevents unnecessary additional runtime material copies and drawcalls. Material switching can be prepared via a [SkeletonRendererCustomMaterials](http://esotericsoftware.com/spine-unity#SkeletonRendererCustomMaterials) component and then enabled or disabled at runtime. Alternatively, you can also directly modify the `SkeletonRenderer.CustomMaterialOverride` property.
|
||||||
|
Outline rendering is fully supported on `SkeletonGraphic` shaders as well.
|
||||||
|
* Added `SkeletonRenderer.EditorSkipSkinSync` scripting API property to be able to set custom skins in editor scripts. Enable this property when overwriting the Skeleton's skin from an editor script. Without setting this parameter, changes will be overwritten by the next inspector update. Only affects Inspector synchronisation of skin with `initialSkinName`, not startup initialization.
|
||||||
|
* All `Spine/SkeletonGraphic` shaders now provide a parameter `CanvasGroup Compatible` which can be enabled to support `CanvasGroup` alpha blending. For correct results, you should then disable `Pma Vertex Colors` in the `SkeletonGraphic` Inspector, in section `Advanced` (otherwise Slot alpha will be applied twice).
|
||||||
|
* **Now supporting Universal Render Pipeline (URP), including the 2D Renderer pipeline, through an additional UPM package.**
|
||||||
|
* **Installation:** You can download the Unity Package Manager (UPM) package via the [download page](http://esotericsoftware.com/spine-unity-download) or find it in the [spine-runtimes/spine-unity/Modules](https://github.com/EsotericSoftware/spine-runtimes/tree/3.8-beta/spine-unity/Modules) subdirectory on the git repository. You can then either unzip (copy if using git) the package to
|
||||||
|
* a) the `Packages` directory in your project where it will automatically be loaded, or
|
||||||
|
* b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the `+` icon, choose `Add package from disk..` and point it to the package.json file.
|
||||||
|
|
||||||
|
The Project panel should now show an entry `Spine Universal RP Shaders` under `Packages`. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.
|
||||||
|
* **Usage:** The package provides two shaders specifically built for the universal render pipeline:
|
||||||
|
* `Universal Render Pipeline/Spine/Skeleton`, as a universal variant of the `Spine/Skeleton` shader,
|
||||||
|
* `Universal Render Pipeline/Spine/Skeleton Lit`, as a universal variant of the `Spine/Skeleton Lit` shader,
|
||||||
|
* `Universal Render Pipeline/Spine/Sprite`, as a universal variant of the `Spine/Sprite/Vertex Lit` and `Pixel Lit` shaders, which were not functioning in the universal render pipeline,
|
||||||
|
* `Universal Render Pipeline/2D/Spine/Skeleton Lit`, as a universal 2D Renderer variant of the `Spine/Skeleton Lit` shader, and
|
||||||
|
* `Universal Render Pipeline/2D/Spine/Sprite`, as a universal 2D Renderer variant of the `Spine/Sprite/Vertex Lit` and `Pixel Lit` shaders.
|
||||||
|
The shaders can be assigned to materials as usual and will respect your settings of the assigned `UniversalRenderPipelineAsset` under `Project Settings - Graphics`.
|
||||||
|
* **Restrictions** As all Spine shaders, the URP shaders **do not support `Premultiply alpha` (PMA) atlas textures in Linear color space**. Please export your atlas textures as `straight alpha` textures with disabled `Premultiply alpha` setting when using Linear color space. You can check the current color space via `Project Settings - Player - Other Settings - Color Space.`.
|
||||||
|
* **Example:** You can find an example scene in the package under `com.esotericsoftware.spine.urp-shaders-3.8/Examples/URP Shaders.unity` that demonstrates usage of the URP shaders.
|
||||||
|
* Spine Preferences now provide an **`Atlas Texture Settings`** parameter for applying customizable texture import settings at all newly imported Spine atlas textures.
|
||||||
|
When exporting atlas textures from Spine with `Premultiply alpha` enabled (the default), you can leave it at `PMATexturePreset`. If you have disabled `Premultiply alpha`, set it to the included `StraightAlphaTexturePreset` asset. You can also create your own `TextureImporter` `Preset` asset and assign it here (include `PMA` or `Straight` in the name). In Unity versions before 2018.3 you can use `Texture2D` template assets instead of the newer `Preset` assets. Materials created for imported textures will also have the `Straight Alpha Texture` parameter configured accordingly.
|
||||||
|
* All `Sprite` shaders (including URP and LWRP extension packages) now provide an additional `Fixed Normal Space` option `World-Space`. PReviously options were limited to `View-Space` and `Model-Space`.
|
||||||
|
* `SkeletonGraphic` now fully supports [`SkeletonUtility`](http://esotericsoftware.com/spine-unity#SkeletonUtility) for generating a hierarchy of [`SkeletonUtilityBones`](http://esotericsoftware.com/spine-unity#SkeletonUtilityBone) in both modes `Follow` and `Override`. This also enables creating hinge chain physics rigs and using `SkeletonUtilityConstraints` such as `SkeletonUtilityGroundConstraint` and `SkeletonUtilityEyeConstraint` on `SkeletonGraphic`.
|
||||||
|
* Added `OnMeshAndMaterialsUpdated` callback event to `SkeletonRenderer` and `SkeletonGraphic`. It is issued at the end of `LateUpdate`, before rendering.
|
||||||
|
* Added `Skeleton-OutlineOnly` single pass shader to LWRP and URP extension modules. It can be assigned to materials as `Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly`. This allows for separate outline child *GameObjects* that reference the existing Mesh of their parent, and re-draw the mesh using this outline shader.
|
||||||
|
* Added example component `RenderExistingMesh` to render a mesh again with different materials, as required by the new `Skeleton-OutlineOnly` shaders.
|
||||||
|
In URP the outline has to be rendered via a separate GameObject as URP does not allow multiple render passes. To add an outline to your SkeletenRenderer:
|
||||||
|
1) Add a child GameObject and move it a bit back (e.g. position Z = 0.01).
|
||||||
|
2) Add a `RenderExistingMesh` component, provided in the `Spine Examples/Scripts/Sample Components` directory.
|
||||||
|
3) Copy the original material, add *_Outline* to its name and set the shader to `Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly`.
|
||||||
|
4) Assign this *_Outline* material at the `RenderExistingMesh` component under *Replacement Materials*.
|
||||||
|
* Added `Outline Shaders URP` example scene to URP extension module to demonstrate the above additions.
|
||||||
|
* Added support for Unity's [`SpriteAtlas`](https://docs.unity3d.com/Manual/class-SpriteAtlas.html) as atlas provider (as an alternative to `.atlas.txt` and `.png` files) alongside a skeleton data file. There is now an additional `Spine SpriteAtlas Import` tool window accessible via `Window - Spine - SpriteAtlas Import`. Additional information can be found in a new section on the [spine-unity documentation page](http://esotericsoftware.com/spine-unity#Advanced---Using-Unity-SpriteAtlas-as-Atlas-Provider).
|
||||||
|
* Added support for **multiple atlas textures at `SkeletonGraphic`**. You can enable this feature by enabling the parameter `Multiple CanvasRenders` in the `Advanced` section of the `SkeletonGraphic` Inspector. This automatically creates the required number of child `CanvasRenderer` GameObjects for each required draw call (submesh).
|
||||||
|
* Added support for **Render Separator Slots** at `SkeletonGraphic`. Render separation can be enabled directly in the `Advanced` section of the `SkeletonGraphic` Inspector, it does not require any additional components (like `SkeletonRenderSeparator` or `SkeletonPartsRenderer` for `SkeletonRenderer` components). When enabled, additional separator GameObjects will be created automatically for each separation part, and `CanvasRenderer` GameObjects re-parented to them accordingly. The separator GameObjects can be moved around and re-parented in the hierarchy according to your requirements to achieve the desired draw order within your `Canvas`. A usage example can be found in the updated `Spine Examples/Other Examples/SkeletonRenderSeparator` scene.
|
||||||
|
* Added `SkeletonGraphicCustomMaterials` component, providing functionality to override materials and textures of a `SkeletonGraphic`, similar to `SkeletonRendererCustomMaterials`. Note: overriding materials or textures per slot is not provided due to structural limitations.
|
||||||
|
* Added **Root Motion support** for `SkeletonAnimation`, `SkeletonMecanim` and `SkeletonGraphic` via new components `SkeletonRootMotion` and `SkeletonMecanimRootMotion`. The `SkeletonAnimation` and `SkeletonGraphic` component Inspector now provides a line `Root Motion` with `Add Component` and `Remove Component` buttons to add/remove the new `SkeletonRootMotion` component to your GameObject. The `SkeletonMecanim` Inspector detects whether root motion is enabled at the `Animator` component and adds a `SkeletonMecanimRootMotion` component automatically.
|
||||||
|
* `SkeletonMecanim` now provides an additional `Custom MixMode` parameter under `Mecanim Translator`. It is enabled by default in version 3.8 to maintain current behaviour, using the set `Mix Mode` for each Mecanim layer. When disabled, `SkeletonMecanim` will use the recommended `MixMode` according to the layer blend mode. Additional information can be found in the [Mecanim Translator section](http://esotericsoftware.com/spine-unity#Parameters-for-animation-blending-control) on the spine-unity documentation pages.
|
||||||
|
* Added **SkeletonGraphic Timeline support**. Added supprot for multi-track Timeline preview in the Editor outside of play mode (multi-track scrubbing). See the [Timeline-Extension-UPM-Package](http://esotericsoftware.com/spine-unity#Timeline-Extension-UPM-Package) section of the spine-unity documentation for more information.
|
||||||
|
* Added support for double-sided lighting at all `SkeletonLit` shaders (including URP and LWRP packages).
|
||||||
|
* Added frustum culling update mode parameters `Update When Invisible` (Inspector parameter) and `UpdateMode` (available via code) to all Skeleton components. This provides a simple way to disable certain updates when the `Renderer` is no longer visible (outside all cameras, culled in frustum culling). The new `UpdateMode` property allows disabling updates at a finer granularity level than disabling the whole component. Available modes are: `Nothing`, `OnlyAnimationStatus`, `EverythingExceptMesh` and `FullUpdate`.
|
||||||
|
* Added a new `Spine/Outline/OutlineOnly-ZWrite` shader to provide correct outline-only rendering. Note: the shader requires two render passes and is therefore not compatible with URP. The `Spine Examples/Other Examples/Outline Shaders` example scene has been updated to demonstrate the new shader.
|
||||||
|
* Added `OnMeshAndMaterialsUpdated` callback event to `SkeletonRenderSeparator` and `SkeletonPartsRenderer`. It is issued at the end of `LateUpdate`, before rendering.
|
||||||
|
* Added `Root Motion Scale X/Y` parameters to `SkeletonRootMotionBase` subclasses (`SkeletonRootMotion` and `SkeletonMecanimRootMotion`). Also providing `AdjustRootMotionToDistance()` and other methods to allow for easy delta compensation. Delta compensation can be used to e.g. stretch a jump to a given distance. Root motion can be adjusted at the start of an animation or every frame via `skeletonRootMotion.AdjustRootMotionToDistance(targetPosition - transform.position, trackIndex);`.
|
||||||
|
* Now providing a `Canvas Group Tint Black` parameter at the `SkeletonGraphic` Inspector in the `Advanced` section. When using the `Spine/SkeletonGraphic Tint Black` shader you can enable this parameter to receive proper blending results when using `Additive` blend mode under a `CanvasGroup`. Be sure to also have the parameter `CanvasGroup Compatible` enabled at the shader. Note that the normal `Spine/SkeletonGraphic` does not support `Additive` blend mode at a `CanvasGroup`, as it requires additional shader channels to work.
|
||||||
|
* Added `Mix and Match Skins` example scene to demonstrate how the 3.8 Skin API and combining skins can be used for a wardrobe and equipment use case.
|
||||||
|
* Spine Timeline Extensions: Added `Hold Previous` parameter at `SpineAnimationStateClip`.
|
||||||
|
* Added more warning messages at incompatible SkeletonRenderer/SkeletonGraphic Component vs Material settings. They appear both as an info box in the Inspector as well as upon initialization in the Console log window. The Inspector box warnings can be disabled via `Edit - Preferences - Spine`.
|
||||||
|
* Now providing `BeforeApply` update callbacks at all skeleton animation components (`SkeletonAnimation`, `SkeletonMecanim` and `SkeletonGraphic`).
|
||||||
|
* Added `BoundingBoxFollowerGraphic` component. This class is a counterpart of `BoundingBoxFollower` that can be used with `SkeletonGraphic`.
|
||||||
|
* Added Inspector context menu functions `SkeletonRenderer - Add all BoundingBoxFollower GameObjects` and `SkeletonGraphic - Add all BoundingBoxFollowerGraphic GameObjects` that automatically generate bounding box follower GameObjects for every `BoundingBoxAttachment` for all skins of a skeleton.
|
||||||
|
* `GetRemappedClone()` now provides an additional parameter `pivotShiftsMeshUVCoords` for `MeshAttachment` to prevent uv shifts at a non-central Sprite pivot. This parameter defaults to `true` to maintain previous behaviour.
|
||||||
|
* `SkeletonRenderer` components now provide an additional update mode `Only Event Timelines` at the `Update When Invisible` property. This mode saves additional timeline updates compared to update mode `Everything Except Mesh`.
|
||||||
|
* Now all URP (Universal Render Pipeline) and LWRP (Lightweight Render Pipeline) shaders support SRP (Scriptable Render Pipeline) batching. See [Unity SRPBatcher documentation pages](https://docs.unity3d.com/Manual/SRPBatcher.html) for additional information.
|
||||||
|
* Sprite shaders now provide four `Diffuse Ramp` modes as an Inspector Material parameter: `Hard`, `Soft`, `Old Hard` and `Old Soft`. In spine-unity 3.8 it defaults to `Old Hard` to keep the behaviour of existing projects unchanged. Note that `Old Hard` and `Old Soft` ramp versions were using only the right half of the ramp texture, and additionally multiplying the light intensity by 2, both leading to brighter lighting than without a ramp texture active. The new ramp modes `Hard` and `Soft` use the full ramp texture and do not modify light intensity, being consistent with lighting without a ramp texture active.
|
||||||
|
* Added **native support for slot blend modes** `Additive`, `Multiply` and `Screen` with automatic assignment at newly imported skeleton assets. `BlendModeMaterialAssets` are now obsolete and replaced by the native properties at `SkeletonDataAsset`. The `SkeletonDataAsset` Inspector provides a new `Blend Modes - Upgrade` button to upgrade an obsolete `BlendModeMaterialAsset` to the native blend modes properties. This upgrade will be performed automatically on imported and re-imported assets in Unity 2020.1 and newer to prevent reported `BlendModeMaterialAsset` issues in these Unity versions. spine-unity 4.0 and newer will automatically perform this upgrade regardless of the Unity version.
|
||||||
|
* `BoneFollower` and `BoneFollowerGraphic` components now provide better support for following bones when the skeleton's Transform is not the parent of the follower's Transform. Previously e.g. rotating a common parent Transform did not lead to the desired result, as well as negatively scaling a skeleton's Transform when it is not a parent of the follower's Transform.
|
||||||
|
* URP and LWRP `Sprite` and `SkeletonLit` shaders no longer require `Advanced - Add Normals` enabled to properly cast and receive shadows. It is recommended to disable `Add Normals` if normals are otherwise not needed.
|
||||||
|
* Added an example component `RootMotionDeltaCompensation` located in `Spine Examples/Scripts/Sample Components` which can be used for applying simple delta compensation. You can enable and disable the component to toggle delta compensation of the currently playing animation on and off.
|
||||||
|
* Root motion delta compensation now allows to only adjust X or Y components instead of both. Adds two parameters to `SkeletonRootMotionBase.AdjustRootMotionToDistance()` which default to adjusting both X and Y as before. The `RootMotionDeltaCompensation` example component exposes these parameters as public attributes.
|
||||||
|
* Root motion delta compensation now allows to also add translation root motion to e.g. adjust a horizontal jump upwards or downwards over time. This is necessary because a Y root motion of zero cannot be scaled to become non-zero.
|
||||||
|
* `Attachment.GetRemappedClone(Sprite)` method now provides an additional optional parameter `useOriginalRegionScale`. When set to `true`, the replaced attachment's scale is used instead of the Sprite's `Pixel per Unity` setting, allowing for more consistent scaling. *Note:* When remapping Sprites, be sure to set the Sprite's `Mesh Type` to `Full Rect` and not `Tight`, otherwise the scale will be wrong.
|
||||||
|
|
||||||
|
* **Changes of default values**
|
||||||
|
* `SkeletonMecanim`'s `Layer Mix Mode` now defaults to `MixMode.MixNext` instead of `MixMode.MixAlways`.
|
||||||
|
* `BlendModeMaterialAsset` and it's instance `Default BlendModeMaterials.asset` now have `Apply Additive Material` set to `true` by default in order to apply all blend modes by default.
|
||||||
|
|
||||||
|
* **Deprecated**
|
||||||
|
* Deprecated `Modules/SlotBlendModes/SlotBlendModes` component. Changed namespace from `Spine.Unity.Modules` to `Spine.Unity.Deprecated`. Moved to `Deprecated/SlotBlendModes`.
|
||||||
|
|
||||||
|
* **Restructuring (Non-Breaking)**
|
||||||
|
|
||||||
|
Note: The following changes will most likely not affect users of the Spine-Unity runtime as the API remains unchanged and no references are invalidated.
|
||||||
|
* Removed duplicates of `.cginc` files in `Modules/Shaders/Sprite` that were also present in the `Modules/Shaders/Sprite/CGIncludes` directory.
|
||||||
|
* Moved shaders from `Modules/Shaders` to `Shaders` directory.
|
||||||
|
* Moved shaders from `Modules/SkeletonGraphic/Shaders` to `Shaders/SkeletonGraphic`.
|
||||||
|
* Renamed shader `Shaders/Spine-SkeletonLit.shader` to `Shaders/Spine-Skeleton-Lit.shader`.
|
||||||
|
* Moved components from `SkeletonGraphic` to `Components` and `Components/Following` except for `SkeletonGraphicMirror` which was moved to `Spine Examples/Scripts/Sample Components`.
|
||||||
|
* Moved `BoneFollower`, `BoneFollowerGraphic` and `PointFollower` from `Components` directory to `Components/Following`.
|
||||||
|
* Moved `BoundingBoxFollower` component from `Modules/BoundingBoxFollower` to `Components/Following`.
|
||||||
|
* Moved `Modules/SkeletonRenderSeparator` directory to `Components/SkeletonRenderSeparator`.
|
||||||
|
* Moved `Modules/CustomMaterials` directory to `Components/SkeletonRendererCustomMaterials`.
|
||||||
|
* Moved `Asset Types/BlendModeMaterialsAsset.cs` class, `Shaders/BlendModes/Default BlendModeMaterials.asset` and materials from `Shaders/BlendModes` to `SkeletonDataModifierAssets/BlendModeMaterials` directory.
|
||||||
|
* Moved `Modules/Ghost` directory to `Spine Examples/Scripts/Sample Components/Ghost`.
|
||||||
|
* Moved `Modules/SkeletonUtility Modules` directory to `Spine Examples/Scripts/Sample Components/SkeletonUtility Modules`.
|
||||||
|
* Moved `Modules/AnimationMatchModifier` directory to `Spine Examples/Scripts/MecanimAnimationMatchModifier`.
|
||||||
|
* Moved `SkeletonRagdoll` and `SkeletonRagdoll2D` components from `Modules/Ragdoll` directory to `Spine Examples/Scripts/Sample Components/SkeletonUtility Modules`.
|
||||||
|
* Moved `AttachmentTools.cs` to `Utility` directory.
|
||||||
|
* Split the file `AttachmentTools` into 5 separate files for each contained class. No namespace or other API changes performed.
|
||||||
|
* Split the file `Mesh Generation/SpineMesh` into 4 separate files for each contained class. No namespace or other API changes performed.
|
||||||
|
* Moved `SkeletonExtensions.cs` to `Utility` directory.
|
||||||
|
* Moved `Modules/YieldInstructions` directory to `Utility/YieldInstructions`.
|
||||||
|
* Moved corresponding editor scripts of the above components to restructured directories as well.
|
||||||
|
* Renamed inspector editor class `PointFollowerEditor` to `PointFollowerInspector` for consistency reasons.
|
||||||
|
|
||||||
|
### XNA/MonoGame
|
||||||
|
* Updated to latest MonoGame version 3.7.1
|
||||||
|
* Rewrote example project to be cleaner and better demonstrate basic Spine features.
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
* Added normalmap support via `SpineEffectNormalmap` and support for loading multiple texture layers following a suffix-pattern. Please see the example code on how to use them.
|
||||||
|
|
||||||
|
## Java
|
||||||
|
* **Breaking changes**
|
||||||
|
* Renamed `Slot#getAttachmentVertices()` to `Slot#getDeform()`.
|
||||||
|
* Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports.
|
||||||
|
* Renamed `Skin#addAttachment()` to `Skin#setAttachment()`.
|
||||||
|
* Removed `VertexAttachment#applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied.
|
||||||
|
* Removed `inheritDeform` field, getter, and setter from `MeshAttachment`.
|
||||||
|
* Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably.
|
||||||
|
* `JsonRollback` tool now converts from 3.8 JSON to 3.7.
|
||||||
|
* Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`.
|
||||||
|
* Added support for rotated mesh region UVs.
|
||||||
|
* Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them.
|
||||||
|
* Improved Skin API to make it easier to handle mix-and-match use cases.
|
||||||
|
* Added `Skin#getAttachments()`. Returns all attachments in the skin.
|
||||||
|
* Added `Skin#getAttachments(int slotIndex)`. Returns all attachements in the skin for the given slot index.
|
||||||
|
* Added `Skin#addSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin.
|
||||||
|
* Added `Skin#copySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.
|
||||||
|
* Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
|
||||||
|
* Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
|
||||||
|
* Added IK softness.
|
||||||
|
|
||||||
|
### libGDX
|
||||||
|
* `SkeletonViewer` can load a skeleton by specifying it as the first argument on the command line.
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
|
||||||
|
## Lua
|
||||||
|
* **Breaking changes**
|
||||||
|
* Renamed `Slot:getAttachmentVertices()` to `Slot#deform`.
|
||||||
|
* Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports.
|
||||||
|
* Renamed `Skin:addAttachment()` to `Skin#setAttachment()`.
|
||||||
|
* Removed `VertexAttachment:applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied.
|
||||||
|
* Removed `inheritDeform` field, getter, and setter from `MeshAttachment`.
|
||||||
|
* Changed the `.json` file format to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`.
|
||||||
|
* Added support for rotated mesh region UVs.
|
||||||
|
* Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them.
|
||||||
|
* Improved Skin API to make it easier to handle mix-and-match use cases.
|
||||||
|
* Added `Skin:getAttachments()`. Returns all attachments in the skin.
|
||||||
|
* Added `Skin:getAttachments(slotIndex)`. Returns all attachements in the skin for the given slot index.
|
||||||
|
* Added `Skin:addSkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin.
|
||||||
|
* Added `Skin:copySkin(Skin skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.
|
||||||
|
* Added `Attachment:copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
|
||||||
|
* Added `MeshAttachment:newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
|
||||||
|
* Added IK softness.
|
||||||
|
|
||||||
|
### Love2D
|
||||||
|
* Added support for 0-1 RGBA color component range change in Löve 0.11+. Older Löve versions using the 0-255 range are still supported!
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
|
||||||
|
### Corona
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
|
||||||
|
## Typescript/Javascript
|
||||||
|
* **Breaking changes**
|
||||||
|
* Renamed `MixDirection.in/out` to `MixDirection.mixIn/mixOut` as it was crashing a JS compressor.
|
||||||
|
* Renamed `Slot#getAttachmentVertices()` to `Slot#getDeform()`.
|
||||||
|
* Changed the `.json` curve format and added more assumptions for omitted values, reducing the average size of JSON exports.
|
||||||
|
* Renamed `Skin#addAttachment()` to `Skin#setAttachment()`.
|
||||||
|
* Removed `VertexAttachment#applyDeform()` and replaced it with `VertexAttachment#deformAttachment`. The attachment set on this field is used to decide if a `DeformTimeline` should be applied to the attachment active on the slot to which the timeline is applied.
|
||||||
|
* Removed `inheritDeform` field, getter, and setter from `MeshAttachment`.
|
||||||
|
* Changed `.skel` binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably.
|
||||||
|
* Changed the `.json` and `.skel` file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.
|
||||||
|
* Updated runtime to be compatible with TypeScript 3.6.3.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added support for loading binary data via `AssetManager#loadBinary()`. `AssetManager#get()` will return a `Uint8Array` for such assets.
|
||||||
|
* Added support for loading binaries via new `SkeletonBinary`. Parses a `Uint8Array`.
|
||||||
|
* Added `x` and `y` coordinates for setup pose AABB in `SkeletonData`.
|
||||||
|
* Added support for rotated mesh region UVs.
|
||||||
|
* Added skin-specific bones and constraints which are only updated if the skeleton's current skin contains them.
|
||||||
|
* Improved Skin API to make it easier to handle mix-and-match use cases.
|
||||||
|
* Added `Skin#getAttachments()`. Returns all attachments in the skin.
|
||||||
|
* Added `Skin#getAttachments(slotIndex: number)`. Returns all attachements in the skin for the given slot index.
|
||||||
|
* Added `Skin#addSkin(skin: Skin)`. Adds all attachments, bones, and skins from the specified skin to this skin.
|
||||||
|
* Added `Skin#copySkin(skin: Skin)`. Adds all attachments, bones, and skins from the specified skin to this skin. `VertexAttachment` are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.
|
||||||
|
* Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
|
||||||
|
* Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
|
||||||
|
* Added IK softness.
|
||||||
|
* Added `AssetManager.setRawDataURI(path, data)`. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file.
|
||||||
|
|
||||||
|
### WebGL backend
|
||||||
|
* `Input` can now take a partially defined implementation of `InputListener`.
|
||||||
|
* Added mix-and-match example to demonstrate the new Skin API.
|
||||||
|
|
||||||
|
### Canvas backend
|
||||||
|
|
||||||
|
### Three.js backend
|
||||||
|
* `SkeletonMesh` now takes an optional `SkeletonMeshMaterialParametersCustomizer` function that allows you to modify the `ShaderMaterialParameters` before the material is finalized. Use it to modify things like THREEJS' `Material.depthTest` etc. See #1590.
|
||||||
|
|
||||||
|
### Player
|
||||||
|
* `SpinePlayer#setAnimation()` can now be called directly to set the animation being displayed.
|
||||||
|
* The player supports loading `.skel` binary skeleton files by setting the `SpinePlayerConfig#skelUrl` field instead of `SpinePlayerConfig#jsonUrl`.
|
||||||
|
* Added `SpinePlayerConfig#rawDataURIs`. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file. See the example for a demonstration.
|
||||||
|
|
||||||
|
# 3.7
|
||||||
|
|
||||||
|
## AS3
|
||||||
|
* **Breaking changes**
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* `MixPose` is now called `MixBlend`
|
||||||
|
* Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
|
||||||
|
* Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194
|
||||||
|
* **Additions**
|
||||||
|
* Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
|
||||||
|
* Support for stretchy IK
|
||||||
|
* Support for audio events, see `audioPath`, `volume` and `balance` fields on event (data).
|
||||||
|
* `TrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130).
|
||||||
|
|
||||||
|
### Starling
|
||||||
|
* Added support for vertex effects. See `RaptorExample.as`
|
||||||
|
* Added 'getTexture()' method to 'StarlingTextureAtlasAttachmentLoader'
|
||||||
|
* Breaking change: if a skeleton requires two color tinting, you have to enable it via `SkeletonSprite.twoColorTint = true`. In this case the skeleton will use the `TwoColorMeshStyle`, which internally uses a different vertex layout and shader. This means that skeletons with two color tinting enabled will break batching and hence increase the number of draw calls in your app.
|
||||||
|
* Added `VertexEffect` and implementations `JitterEffect` and `SwirlEffect`. Allows you to modify vertices before they are submitted for drawing. See Starling changes.
|
||||||
|
* Fix issues with StarlingAtlasAttachmentLoader, see https://github.com/EsotericSoftware/spine-runtimes/issues/939
|
||||||
|
* Fix issues with region trimming support, see https://github.com/EsotericSoftware/spine-runtimes/commit/262bc26c64d4111002d80e201cb1a3345e6727df
|
||||||
|
* Added support for overriding `StarlingAtlasAttachmentLoader#getTexture()`, see https://github.com/EsotericSoftware/spine-runtimes/commit/ea7dbecb98edc74e439aa9ef90dcf6eed865f718
|
||||||
|
* Texture atlas operations are no longer handled in `Starling#newRegionAttachment` and `Starling#newMeshAttachment` but delegated to the atlas.
|
||||||
|
* Added sample for additive animation blending, see https://github.com/EsotericSoftware/spine-runtimes/blob/6a556de01429878df47bb276a97959a8bdbbe32f/spine-starling/spine-starling-example/src/spine/examples/OwlExample.as
|
||||||
|
* Added sample on how to use bounding box attachment vertices https://github.com/EsotericSoftware/spine-runtimes/commit/e20428b02699226164fa73ba4b12f7d029ae6f4d
|
||||||
|
* Fully transparent meshes are not submitted for rendering.
|
||||||
|
* No hit-tests are performed when a skeleton is invisible.
|
||||||
|
|
||||||
|
## C
|
||||||
|
* **Breaking changes**
|
||||||
|
* Listeners on `spAnimationState` and `spTrackEntry` will now also be called if a track entry gets disposed as part of disposing an animation state.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* The spine-cocos2dx and spine-ue4 runtimes are now based on spine-cpp. See below for changes.
|
||||||
|
* Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
|
||||||
|
* Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194
|
||||||
|
* `spMeshAttachment` has two new fields `regionTextureWith` and `regionTextureHeight`. These must be set in custom attachment loader. See `AtlasAttachmentLoader`.
|
||||||
|
* **Additions**
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `spTransformConstraintData`.
|
||||||
|
* `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
|
||||||
|
* Added `spVertexEffect` and corresponding implementations `spJitterVertexEffect` and `spSwirlVertexEffect`. Create/dispose through the corresponding `spXXXVertexEffect_create()/dispose()` functions. Set on framework/engine specific renderer.
|
||||||
|
* Functions in `extension.h` are not prefixed with `_sp` instead of just `_` to avoid interference with other libraries.
|
||||||
|
* Introduced `SP_API` macro. Every spine-c function is prefixed with this macro. By default, it is an empty string. Can be used to markup spine-c functions with e.g. ``__declspec` when compiling to a dll or linking to that dll.
|
||||||
|
* Added `void *userData` to `spAnimationState`to be consumed in callbacks.
|
||||||
|
* Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `spTrackEntry->mixBlend = SP_MIXBLEND_ADD)` on each track. To specify the blend percentage, set `spTrackEntry->alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
|
||||||
|
* Optimized attachment lookup to give a 40x speed-up. See https://github.com/EsotericSoftware/spine-runtimes/commit/cab81276263890b65d07fa2329ace16db1e365ff
|
||||||
|
* Support for stretchy IK
|
||||||
|
* Support for audio events, see `audioPath`, `volume` and `balance` fields on event (data).
|
||||||
|
* `spTrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130).
|
||||||
|
|
||||||
|
### Cocos2d-Objc
|
||||||
|
* Added vertex effect support to modify vertices of skeletons on the CPU. See `RaptorExample.m`.
|
||||||
|
* Explanation how to handle ARC, see https://github.com/EsotericSoftware/spine-runtimes/commit/a4f122b08c5e2a51d6aad6fc5a947f7ec31f2eb8
|
||||||
|
* The super class `::update()` method of `SkeletonRenderer` is now called, see https://github.com/EsotericSoftware/spine-runtimes/commit/f7bb98185236a6d8f35bfefc70afe4f31e9ec9d2
|
||||||
|
* Added improved tint-black shader.
|
||||||
|
|
||||||
|
### SFML
|
||||||
|
* `spine-sfml.h` no longer defines `SPINE_SHORT_NAMES` to avoid collisions with other APIs. See #1058.
|
||||||
|
* Added support for vertex effects. See raptor example.
|
||||||
|
* Added premultiplied alpha support to `SkeletonDrawable`. Use `SkeletonDrawable::setUsePremultipliedAlpha()`, see https://github.com/EsotericSoftware/spine-runtimes/commit/34086c1f41415309b2ecce86055f6656fcba2950
|
||||||
|
* Added additive animation blending sample, see https://github.com/EsotericSoftware/spine-runtimes/blob/b7e712d3ca1d6be3ebcfe3254dc2cea9c44dda71/spine-sfml/example/main.cpp#L369
|
||||||
|
|
||||||
|
## C++
|
||||||
|
* ** Additions **
|
||||||
|
* Added C++ Spine runtime. See the [spine-cpp Runtime Guide](https://esotericsoftware.com/spine-cpp) for more information on spine-cpp.
|
||||||
|
* Added parsing of non-essential data (fps, images path, audio path) to for `.json`/`.skel` parsers.
|
||||||
|
|
||||||
|
### Cocos2d-x
|
||||||
|
* Added ETC1 alpha support, thanks @halx99! Does not work when two color tint is enabled.
|
||||||
|
* Added `spAtlasPage_setCustomTextureLoader()` which let's you do texture loading manually. Thanks @jareguo.
|
||||||
|
* Added `SkeletonRenderer:setSlotsRange()` and `SkeletonRenderer::createWithSkeleton()`. This allows you to split rendering of a skeleton up into multiple parts, and render other nodes in between. See `SkeletonRendererSeparatorExample.cpp` for an example.
|
||||||
|
* Fully transparent attachments will not be rendered, improving rendering performance.
|
||||||
|
* Added improved tint-black shader.
|
||||||
|
* Updated to cocos2d-x 3.16
|
||||||
|
* The skeleton setup pose and world transform are now calculated on initialization to avoid flickering on start-up.
|
||||||
|
* Updated to cocos2d-x 3.17.1
|
||||||
|
* **Breaking change**: Switched from [spine-c](spine-c) to [spine-cpp](spine-cpp) as the underlying Spine runtime. See the [spine-cpp Runtime Guide](https://esotericsoftware.com/spine-cpp) for more information on spine-cpp.
|
||||||
|
* Added `Cocos2dAttachmentLoader` to be used when constructing an `Atlas`. Used by default by `SkeletonAnimation` and `SkeletonRenderer` when creating instances via the `createXXX` methods.
|
||||||
|
* All C structs and enums `spXXX` have been replaced with their C++ equivalents `spine::XXX` in all public interfaces.
|
||||||
|
* All instantiations via `new` of C++ classes from spine-cpp should contain `(__FILE__, __LINE__)`. This allows the tracking of instantations and detection of memory leaks via the `spine::DebugExtension`.
|
||||||
|
|
||||||
|
### SFML
|
||||||
|
* Create a second SFML backend using [spine-cpp](spine-cpp/). See the [spine-cpp Runtime Guide](https://esotericsoftware.com/spine-cpp) for more information on spine-cpp.
|
||||||
|
* Added support for vertex effects. See raptor example.
|
||||||
|
* Added premultiplied alpha support to `SkeletonDrawable`. Use `SkeletonDrawable::setUsePremultipliedAlpha()`, see https://github.com/EsotericSoftware/spine-runtimes/commit/34086c1f41415309b2ecce86055f6656fcba2950
|
||||||
|
* Added additive animation blending sample, see https://github.com/EsotericSoftware/spine-runtimes/blob/b7e712d3ca1d6be3ebcfe3254dc2cea9c44dda71/spine-sfml/example/main.cpp#L369
|
||||||
|
|
||||||
|
### UE4
|
||||||
|
* spine-c is now exposed from the plugin shared library on Windows via __declspec.
|
||||||
|
* Updated to Unreal Engine 4.18
|
||||||
|
* Added C++ example, see https://github.com/EsotericSoftware/spine-runtimes/commit/15011e81b7061495dba45e28b4d3f4efb10d7f40
|
||||||
|
* `SkeletonRendererComponent` generates collision meshes by default.
|
||||||
|
* Disabled generation of collision meshes by `SkeletonRendererComponent`. Both `ProceduralMeshComponent` and `RuntimeMeshComponent` have a bug that generates a new PhysiX file every frame per component. Users are advised to add a separate collision shape to the root scene component of an actor instead.
|
||||||
|
* Using UE4 `FMemory` allocator by default. This should fix issues on some consoles.
|
||||||
|
* **Breaking change** moved away from `RuntimeMeshComponent`, as its maintainance has seized, back to `ProceduralMeshComponent`. Existing projects should just work. However, if you run into issues, you may have to remove the old `SpineSkeletonRendererComponent` and add a new one to your existing actors.
|
||||||
|
* **Breaking change** due to the removal of `RuntimeMeshComponent` and reversal to `ProceduralMeshComponent`, two color tinting is currently not supported. `ProceduralMeshComponent` does not support enough vertex attributes for us to encode the second color in the vertex stream. You can remove the `RuntimeMeshComponent/` directory from your plugins directory and remove the component from any `build.cs` files that may reference it.
|
||||||
|
* **Breaking change**: Switched from [spine-c](spine-c) to [spine-cpp](spine-cpp) as the underlying Spine runtime. See the [spine-cpp Runtime Guide](https://esotericsoftware.com/spine-cpp) for more information on spine-cpp.
|
||||||
|
* All C structs and enums `spXXX` have been replaced with their C++ equivalents `spine::XXX` in all public interfaces.
|
||||||
|
* All instantiations via `new` of C++ classes from spine-cpp should contain `(__FILE__, __LINE__)`. This allows the tracking of instantations and detection of memory leaks via the `spine::DebugExtension`.
|
||||||
|
* Updated to Unreal Engine 4.20 (samples require 4.17+), see the `spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/SpinePlugin.build.cs` file on how to compile in 4.20 with the latest UBT API changes.
|
||||||
|
* Updated to Unreal Engine 4.21 (samples require 4.21).
|
||||||
|
* **Breaking change**: `UBoneDriverComponent` and `UBoneFollowerComponent` are now `USceneComponent` instead of `UActorComponent`. They either update only themselves, or also the owning `UActor`, depending on whether the new flag `UseComponentTransform` is set. See https://github.com/EsotericSoftware/spine-runtimes/pull/1175
|
||||||
|
* Added query methods for slots, bones, skins and animations to `SpineSkeletonComponent` and `UTrackEntry`. These allow you to query these objects by name in both C++ and blueprints.
|
||||||
|
* Added `Preview Animation` and `Preview Skin` properties to `SpineSkeletonAnimationComponent`. Enter an animation or skin name to live-preview it in the editor. Enter an empty string to reset the animation or skin.
|
||||||
|
|
||||||
|
## C# ##
|
||||||
|
* **Breaking changes**
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
|
||||||
|
* Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194
|
||||||
|
* **Additions**
|
||||||
|
* Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#MixBlend = MixBlend.add` on each track. To specify the blend percentage, set `TrackEntry#Alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
|
||||||
|
* Support for stretchy IK
|
||||||
|
* Support for audio events, see `audioPath`, `volume` and `balance` fields on event (data).
|
||||||
|
* `TrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130).
|
||||||
|
|
||||||
|
### Unity
|
||||||
|
* **Runtime and Editor, and Assembly Definition** Files and folders have been reorganized into "Runtime" and "Editor". Each of these have an `.asmdef` file that defines these separately as their own assembly in Unity *(Note: Spine `.asmdef` files are currently deactivated to `.txt` extension, see below)*. For projects not using assembly definition, you may delete the `.asmdef` files. These assembly definitions will be ignored by older versions of Unity that don't support it.
|
||||||
|
* In this scheme, the entirety of the base spine-csharp runtime is inside the "Runtime" folder, to be compiled in the same assembly as spine-unity so they can continue to share internal members.
|
||||||
|
* **Spine `.asmdef` files are now deactivated (using `.txt` extension) by default** This prevents problems when updating Spine through unitypackages, overwriting the Timeline reference entry in `spine-unity.asmdef` (added automatically when enabling Unity 2019 Timeline support, see `Timeline Support for Unity 2019`), causing compile errors. In case you want to enable the `.asmdef` files, rename the files:
|
||||||
|
`Spine/Runtime/spine-unity.txt` to `Spine/Runtime/spine-unity.asmdef` and
|
||||||
|
`Spine/Editor/spine-unity-editor.txt` to `Spine/Editor/spine-unity-editor.asmdef`.
|
||||||
|
* **SkeletonAnimator is now SkeletonMecanim** The Spine-Unity Mecanim-driven component `SkeletonAnimator` has been renamed `SkeletonMecanim` to make it more autocomplete-friendly and more obvious at human-glance. The .meta files and guids should remain intact so existing projects and prefabs should not break. However, user code needs to be updated to use `SkeletonMecanim`.
|
||||||
|
* **SpineAtlasAsset** The existing `AtlasAsset` type has been renamed to `SpineAtlasAsset` to signify that it specifically uses a Spine/libGDX atlas as its source. Serialization should be intact but user code will need to be updated to refer to existing atlases as `SpineAtlasAsset`.
|
||||||
|
* **AtlasAssetBase** `SpineAtlasAsset` now has an abstract base class called `SpineAtlasAsset`. This is the base class to derive when using alternate atlas sources. Existing SkeletonDataAsset field "atlasAssets" now have the "AtlasAssetBase" type. Serialization should be intact, but user code will need to be updated to refer to the atlas assets accordingly.
|
||||||
|
* This change is in preparation for alternate atlas options such as Unity's SpriteAtlas.
|
||||||
|
* **Optional Straight Alpha for shaders** Spine-Unity's included Unity shaders now have a `_STRAIGHT_ALPHA_INPUT` shader_feature, toggled as a checkbox in the Material's inspector. This allows the Material to use a non-premultiplied alpha/straight alpha input texture.
|
||||||
|
* The following shaders now have the "Straight Alpha Texture" checkbox when used on a material:
|
||||||
|
* `Spine/Skeleton`
|
||||||
|
* `Spine/Skeleton Tint Black`
|
||||||
|
* `Spine/Skeleton Lit`
|
||||||
|
* `Spine/Skeleton Tint`
|
||||||
|
* `Spine/Skeleton Fill`
|
||||||
|
* `Spine/SkeletonGraphic (Premultiply Alpha)` was renamed to `Spine/SkeletonGraphic`
|
||||||
|
* `Spine/SkeletonGraphic Tint Black (Premultiply Alpha)` was renamed to `Spine/SkeletonGraphic Tint Black`
|
||||||
|
* `Spine/Skeleton PMA Multiply`
|
||||||
|
* `Spine/Skeleton PMA Screen`
|
||||||
|
* Dedicated straight alpha shaders were removed from the runtime.
|
||||||
|
* `Spine/Straight Alpha/Skeleton Fill`
|
||||||
|
* `Spine/Straight Alpha/Skeleton Tint`
|
||||||
|
* **Detection of Incorrect Texture Settings** Especially when atlas textures are exported with setting `Premultiply alpha` enabled, it is important to configure Unity's texture import settings correctly. By default, you will now receive warnings where texture settings are expected to cause incorrect rendering.
|
||||||
|
* The following rules apply:
|
||||||
|
* `sRGB (Color Texture)` shall be disabled when `Generate Mip Maps` is enabled, otherwise you will receive white border outlines.
|
||||||
|
* `Alpha Is Transparency` shall be disabled on `Premultiply alpha` textures, otherwise you will receive light ghosting artifacts in transparent areas.
|
||||||
|
* These warnings can be disabled in `Edit - Preferences - Spine`.
|
||||||
|
* **Sprite Mask Support for all Included Shaders** The `Skeleton Animation` and `Skeleton Mecanim` components now provide an additional `Mask Interaction` field in the Inspector, covering identical functionality as Unity's built in `Sprite Renderer` component:
|
||||||
|
* `Mask Interaction` modes:
|
||||||
|
* `None` - The sprite will not interact with the masking system. Default behavior.
|
||||||
|
* `Visible Inside Mask` - The sprite will be visible only in areas where a mask is present.
|
||||||
|
* `Visible Outside Mask` - The sprite will be visible only in areas where no mask is present.
|
||||||
|
* `Automatically Generated Materials` When switching `Mask Interaction` modes in the Inspector outside of Play mode, the required additional material assets are generated for the respective `Stencil Compare` parameters - with file suffixes `'_InsideMask'` and `'_OutsideMask'`, placed in the same folder as the original materials. By default all generated materials are kept as references by the `Skeleton Animation` component for switching at runtime.
|
||||||
|
These materials can be managed and optimized via the `SkeletonAnimation`'s `Advanced` section:
|
||||||
|
* Using the `Clear` button you can clear the reference to unneeded materials,
|
||||||
|
* Using the `Delete` button the respective assets are deleted as well as references cleared. Note that other `Skeleton Animation` GameObjects might still reference the materials, so use with caution!
|
||||||
|
* With the `Set` button you can again assign a link to the respective materials to prepare them for runtime use. If the materials were not present or have been deleted, they are generated again based on the default materials.
|
||||||
|
* When switching `Mask Interaction` mode at runtime, the previously prepared materials are switched active automatically. When the respective materials have not been prepared, material copies of the default materials are created on the fly. Note that these materials are not shared between similar `Skeleton Animation` GameObjects, so it is recommended to use the generated material assets where possible.
|
||||||
|
* **Every shader now exposes the `Stencil Compare` parameter** for further customization. This way you have maximum flexibility to use custom mechanisms to switch materials at runtime if you should ever need more than the three materials generated by `Skeleton Animation`'s `Mask Interaction` parameter. Reference `Stencil Compare` values are:
|
||||||
|
* `CompareFunction.Disabled` for `Mask Interaction - None`
|
||||||
|
* `CompareFunction.LessEqual` for `Mask Interaction - Visible Inside Mask`
|
||||||
|
* `CompareFunction.Greater` for `Mask Interaction - Visible Outside Mask`
|
||||||
|
* **RectMask2D Support for SkeletonGraphic** Both `SkeletonGraphic` shaders '`Spine/SkeletonGraphic`' and '`Spine/SkeletonGraphic Tint Black`' now respect masking areas defined via Unity's `RectMask2D` component.
|
||||||
|
* **Timeline Support for Unity 2019** using the existing Timeline components. By default, all Spine Timeline components are deactivated in Unity 2019 and **can be activated via the Spine Preferences menu**. This step became necessary because in Unity 2019, Timeline has been moved to a separate Package and is no longer included in the Unity core. Please visit `Edit - Preferences - Spine` and at `Timeline Package Support` hit `Enable` to automatically perform all necessary steps to activate the Timeline components.
|
||||||
|
This will automatically:
|
||||||
|
1. download the Unity Timeline package
|
||||||
|
2. activate the Spine Timeline components by setting the compile definition `SPINE_TIMELINE_PACKAGE_DOWNLOADED` for all platforms
|
||||||
|
3. modify the `spine-unity.asmdef` file by adding the reference to the Unity Timeline library.
|
||||||
|
* Added `Create 2D Hinge Chain` functionality at `SkeletonUtilityBone` inspector, previously only `Create 3D Hinge Chain` was available.
|
||||||
|
|
||||||
|
### XNA/MonoGame
|
||||||
|
* Added support for any `Effect` to be used by `SkeletonRenderer`
|
||||||
|
* Added support for `IVertexEffect` to modify vertices of skeletons on the CPU. `IVertexEffect` instances can be set on the `SkeletonRenderer`. See example project.
|
||||||
|
* Added `SkeletonDebugRenderer`
|
||||||
|
* Made `MeshBatcher` of SkeletonRenderer accessible via a getter. Allows user to batch their own geometry together with skeleton meshes for maximum batching instead of using XNA SpriteBatcher.
|
||||||
|
|
||||||
|
## Java
|
||||||
|
* **Breaking changes**
|
||||||
|
* Skeleton attachments: Moved update of attached skeleton out of libGDX `SkeletonRenderer`, added overloaded method `Skeleton#updateWorldTransform(Bone)`, used for `SkeletonAttachment`. You now MUST call this new method with the bone of the parent skeleton to which the child skeleton is attached. See `SkeletonAttachmentTest` for and example.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* `MixPose` is now called `MixBlend`.
|
||||||
|
* Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
|
||||||
|
* Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194
|
||||||
|
* **Additions**
|
||||||
|
* Added `EventData#audioPath` field. This field contains the file name of the audio file used for the event.
|
||||||
|
* Added convenience method to add all attachments from one skin to another, see https://github.com/EsotericSoftware/spine-runtimes/commit/a0b7bb6c445efdfac12b0cdee2057afa3eff3ead
|
||||||
|
* Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
|
||||||
|
* Support for stretchy IK
|
||||||
|
* Support for audio events, see `audioPath`, `volume` and `balance` fields on event (data).
|
||||||
|
* `TrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130).
|
||||||
|
|
||||||
|
### libGDX
|
||||||
|
* Added `VertexEffect` interface, instances of which can be set on `SkeletonRenderer`. Allows to modify vertices before submitting them to GPU. See `SwirlEffect`, `JitterEffect` and `VertexEffectTest`.
|
||||||
|
* Added improved tint-black shader.
|
||||||
|
* Improved performance by avoiding batch flush when not switching between normal and additive rendering with PMA
|
||||||
|
* Improvements to skeleton viewer.
|
||||||
|
* `TwoColorPolygonBatch` implements the `Batch` interface, allowing to the be used with other libGDX classes that require a batcher for drawing, potentially improving performance. See https://github.com/EsotericSoftware/spine-runtimes/commit/a46b3d1d0c135d51f9bef9ca17a5f8e5dda69927
|
||||||
|
* Added `SkeletonDrawable` to render skeletons in scene2d UI https://github.com/EsotericSoftware/spine-runtimes/commit/b93686c185e2c9d5466969a8e07eee573ebe4b97
|
||||||
|
|
||||||
|
## Lua
|
||||||
|
* **Breaking changes**
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
|
||||||
|
* Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194
|
||||||
|
* **Additions**
|
||||||
|
* Added `JitterEffect` and `SwirlEffect` and support for vertex effects in Corona and Love
|
||||||
|
* Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry:setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry.alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.
|
||||||
|
* Support for stretchy IK
|
||||||
|
* Support for audio events, see `audioPath`, `volume` and `balance` fields on event (data).
|
||||||
|
* `TrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130).
|
||||||
|
|
||||||
|
### Love2D
|
||||||
|
* Added support for vertex effects. Set an implementation like "JitterEffect" on `Skeleton.vertexEffect`. See `main.lua` for an example.
|
||||||
|
|
||||||
|
### Corona
|
||||||
|
* Added support for vertex effects. Set an implementation like "JitterEffect" on `SkeletonRenderer.vertexEffect`. See `main.lua` for an example
|
||||||
|
|
||||||
|
## Typescript/Javascript
|
||||||
|
* **Breaking changes**
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* Skeleton `flipX/flipY` has been replaced with `scaleX/scaleY`. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritance
|
||||||
|
* Mix time is no longer affected by `TrackEntry#timeScale`. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194
|
||||||
|
* **Additions**
|
||||||
|
* Added `AssetManager.loadTextureAtlas`. Instead of loading the `.atlas` and corresponding image files manually, you can simply specify the location of the `.atlas` file and AssetManager will load the atlas and all its images automatically. `AssetManager.get("atlasname.atlas")` will then return an instance of `spine.TextureAtlas`.
|
||||||
|
* Added additive animation blending. When playing back multiple animations on different tracks, where each animation modifies the same skeleton property, the results of tracks with lower indices are discarded, and only the result from the track with the highest index is used. With animation blending, the results of all tracks are mixed together. This allows effects like mixing multiple facial expressions (angry, happy, sad) with percentage mixes. By default the old behaviour is retained (results from lower tracks are discarded). To enable additive blending across animation tracks, call `TrackEntry#setMixBlend(MixBlend.add)` on each track. To specify the blend percentage, set `TrackEntry#alpha`. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion. See https://github.com/EsotericSoftware/spine-runtimes/blob/f045d221836fa56191ccda73dd42ae884d4731b8/spine-ts/webgl/tests/test-additive-animation-blending.html for an example.
|
||||||
|
* Added work-around for iOS WebKit JIT bug, see https://github.com/EsotericSoftware/spine-runtimes/commit/c28bbebf804980f55cdd773fed9ff145e0e7e76c
|
||||||
|
* Support for stretchy IK
|
||||||
|
* Support for audio events, see `audioPath`, `volume` and `balance` fields on event (data).
|
||||||
|
* `TrackEntry` has an additional field called `holdPrevious`. It can be used to counter act a limitation of `AnimationState` resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this [forum thread](http://esotericsoftware.com/forum/Probably-Easy-Animation-mixing-with-multiple-tracks-10682?p=48130&hilit=holdprevious#p48130).
|
||||||
|
* Added `AssetManager#setRawDataURI(path, data)`. Allows to set raw data URIs for a specific path, which in turn enables embedding assets into JavaScript/HTML.
|
||||||
|
|
||||||
|
### WebGL backend
|
||||||
|
* Added `VertexEffect` interface, instances of which can be set on `SkeletonRenderer`. Allows to modify vertices before submitting them to GPU. See `SwirlEffect`, `JitterEffect`, and the example which allows to set effects.
|
||||||
|
* Added `slotRangeStart` and `slotRangeEnd` parameters to `SkeletonRenderer#draw` and `SceneRenderer#drawSkeleton`. This allows you to render only a range of slots in the draw order. See `spine-ts/webgl/tests/test-slot-range.html` for an example.
|
||||||
|
* Added improved tint-black shader.
|
||||||
|
* Added `SceneRenderer#drawTextureUV()`, allowing to draw a texture with manually specified texture coordinates.
|
||||||
|
* Exposed all renderers in `SceneRenderer`.
|
||||||
|
|
||||||
|
### Canvas backend
|
||||||
|
* Added support for shearing and non-uniform scaling inherited from parent bones.
|
||||||
|
* Added support for alpha tinting.
|
||||||
|
|
||||||
|
### Three.js backend
|
||||||
|
* Added `VertexEffect` interface, instances of which can be set on `SkeletonMesh`. Allows to modify vertices before submitting them to GPU. See `SwirlEffect`, `JitterEffect`.
|
||||||
|
* Added support for multi-page atlases
|
||||||
|
|
||||||
|
### Widget backend
|
||||||
|
* Added fields `atlasContent`, `atlasPagesContent`, and `jsonContent` to `WidgetConfiguration` allowing you to directly pass the contents of the `.atlas`, atlas page `.png` files, and the `.json` file without having to do a request. See `README.md` and the example for details.
|
||||||
|
* `SpineWidget.setAnimation()` now takes an additional optional parameter for callbacks when animations are completed/interrupted/etc.
|
||||||
|
|
||||||
|
# 3.6
|
||||||
|
|
||||||
|
## AS3
|
||||||
|
* **Breaking changes**
|
||||||
|
* Removed `Bone.worldToLocalRotationX` and `Bone.worldToLocalRotationY`. Replaced by `Bone.worldToLocalRotation` (rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Made `Bone` fields `_a`, `_b`, `_c`, `_d`, `_worldX` and `_worldY` public, removed underscore prefix.
|
||||||
|
* Removed `VertexAttachment.computeWorldVertices` overload, changed `VertexAttachment.computeWorldVertices2` to `VertexAttachment.computeWorldVertices`, added `stride` parameter.
|
||||||
|
* Removed `RegionAttachment.vertices` field. The vertices array is provided to `RegionAttachment.computeWorldVertices` by the API user now.
|
||||||
|
* Removed `RegionAttachment.updateWorldVertices`, added `RegionAttachment.computeWorldVertices`. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided `worldVertices` array, starting at `offset`, then moving by `stride` array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.
|
||||||
|
* Replaced `r`, `g`, `b`, `a` fields with instances of new `Color` class in `RegionAttachment`, `MeshAttachment`, `Skeleton`, `SkeletonData`, `Slot` and `SlotData`.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added `Skeleton.getBounds` from reference implementation.
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
|
||||||
|
* Added `Bone.localToWorldRotation`(rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
|
||||||
|
* Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
|
||||||
|
* `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
|
||||||
|
* `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
|
||||||
|
* Added `VertexEffect` and implementations `JitterEffect` and `SwirlEffect`. Allows you to modify vertices before they are submitted for drawing. See Starling changes.
|
||||||
|
|
||||||
|
### Starling
|
||||||
|
* Fixed renderer to work with 3.6 changes.
|
||||||
|
* Added support for two color tinting.
|
||||||
|
* Added support for clipping.
|
||||||
|
* Added support for rotated regions in texture atlas loaded via StarlingAtlasAttachmentLoader.
|
||||||
|
* Added support for vertex effects. See `RaptorExample.as`
|
||||||
|
* Added 'getTexture()' method to 'StarlingTextureAtlasAttachmentLoader'
|
||||||
|
* Breaking change: if a skeleton requires two color tinting, you have to enable it via `SkeletonSprite.twoColorTint = true`. In this case the skeleton will use the `TwoColorMeshStyle`, which internally uses a different vertex layout and shader. This means that skeletons with two color tinting enabled will break batching and hence increase the number of draw calls in your app.
|
||||||
|
|
||||||
|
## C
|
||||||
|
* **Breaking changes**
|
||||||
|
* `spVertexAttachment_computeWorldVertices` and `spRegionAttachment_computeWorldVerticeS` now take new parameters to make it possible to directly output the calculated vertex positions to a vertex buffer. Removes the need for additional copies in the backends' respective renderers.
|
||||||
|
* Removed `spBoundingBoxAttachment_computeWorldVertices`, superseded by `spVertexAttachment_computeWorldVertices`.
|
||||||
|
* Removed `spPathAttachment_computeWorldVertices` and `spPathAttachment_computeWorldVertices1`, superseded by `spVertexAttachment_computeWorldVertices`.
|
||||||
|
* Removed `sp_MeshAttachment_computeWorldVertices`, superseded by `spVertexAttachment_computeWorldVertices`.
|
||||||
|
* Removed `spBone_worldToLocalRotationX` and `spBone_worldToLocalRotationY`. Replaced by `spBone_worldToLocalRotation` (rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Replaced `r`, `g`, `b`, `a` fields with instances of new `spColor` struct in `spRegionAttachment`, `spMeshAttachment`, `spSkeleton`, `spSkeletonData`, `spSlot` and `spSlotData`.
|
||||||
|
* Removed `spVertexIndex`from public API.
|
||||||
|
* Listeners on `spAnimationState` or `spTrackEntry` will now be also called in case a track entry is disposed as part of dispoing the `spAnimationState`.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* **Additions**
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `spTransformConstraintData`.
|
||||||
|
* Added `spPointAttachment`, additional method `spAtlasAttachmentLoadeR_newPointAttachment`.
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
|
||||||
|
* Added `spBone_localToWorldRotation`(rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added two color tinting support, including `spTwoColorTimeline` and additional fields on `spSlot` and `spSlotData`.
|
||||||
|
* Added `userData` field to `spTrackEntry`, so users can expose data in `spAnimationState` callbacks.
|
||||||
|
* Modified kvec.h used by SkeletonBinary.c to use Spine's MALLOC/FREE macros. That way there's only one place to inject custom allocators ([extension.h](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/spine-c/include/spine/extension.h)) [commit](https://github.com/EsotericSoftware/spine-runtimes/commit/c2cfbc6cb8709daa082726222d558188d75a004f)
|
||||||
|
* Added macros to define typed dynamic arrays, see `Array.h/.c`
|
||||||
|
* Added `spClippingAttachment` and respective enum.
|
||||||
|
* Added `spSkeletonClipper` and `spTriangulator`, used to implement software clipping of attachments.
|
||||||
|
* `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
|
||||||
|
* `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
|
||||||
|
* Added `spVertexEffect` and corresponding implementations `spJitterVertexEffect` and `spSwirlVertexEffect`. Create/dispose through the corresponding `spXXXVertexEffect_create()/dispose()` functions. Set on framework/engine specific renderer. See changes for spine-c based frameworks/engines below.
|
||||||
|
* Functions in `extension.h` are not prefixed with `_sp` instead of just `_` to avoid interference with other libraries.
|
||||||
|
* Introduced `SP_API` macro. Every spine-c function is prefixed with this macro. By default, it is an empty string. Can be used to markup spine-c functions with e.g. ``__declspec` when compiling to a dll or linking to that dll.
|
||||||
|
|
||||||
|
### Cocos2d-X
|
||||||
|
* Fixed renderer to work with 3.6 changes
|
||||||
|
* Optimized rendering by removing all per-frame allocation in `SkeletonRenderer`, resulting in 15% performance increase for large numbers of skeletons being rendered per frame.
|
||||||
|
* Added support for two color tinting. Tinting is enabled/disabled per `SkeletonRenderer`/`SkeletonAnimation` instance. Use `SkeletonRenderer::setTwoColorTint()`. Note that two color tinting requires the use of a non-standard shader and vertex format. This means that skeletons rendered with two color tinting will break batching. However, skeletons with two color tinting enabled and rendered after each other will be batched.
|
||||||
|
* Updated example to use Cocos2d-x 3.14.1.
|
||||||
|
* Added mesh debug rendering. Enable/Disable via `SkeletonRenderer::setDebugMeshesEnabled()`.
|
||||||
|
* Added support for clipping.
|
||||||
|
* SkeletonRenderer now combines the displayed color of the Node (cascaded from all parents) with the skeleton color for tinting.
|
||||||
|
* Added support for vertex effects. See `RaptorExample.cpp`.
|
||||||
|
* Added ETC1 alpha support, thanks @halx99! Does not work when two color tint is enabled.
|
||||||
|
* Added `spAtlasPage_setCustomTextureLoader()` which let's you do texture loading manually. Thanks @jareguo.
|
||||||
|
* Added `SkeletonRenderer:setSlotsRange()` and `SkeletonRenderer::createWithSkeleton()`. This allows you to split rendering of a skeleton up into multiple parts, and render other nodes in between. See `SkeletonRendererSeparatorExample.cpp` for an example.
|
||||||
|
|
||||||
|
### Cocos2d-Objc
|
||||||
|
* Fixed renderer to work with 3.6 changes
|
||||||
|
* Added support for two color tinting. Tinting is enabled/disabled per `SkeletonRenderer/SkeletonAnimation.twoColorTint = true`. Note that two color tinted skeletons do not batch with other nodes.
|
||||||
|
* Added support for clipping.
|
||||||
|
|
||||||
|
### SFML
|
||||||
|
* Fixed renderer to work with 3.6 changes. Sadly, two color tinting does not work, as the vertex format in SFML is fixed.
|
||||||
|
* Added support for clipping.
|
||||||
|
* Added support for vertex effects. See raptor example.
|
||||||
|
* Added premultiplied alpha support to `SkeletonDrawable`.
|
||||||
|
|
||||||
|
### Unreal Engine 4
|
||||||
|
* Fixed renderer to work with 3.6 changes
|
||||||
|
* Added new UPROPERTY to SpineSkeletonRendererComponent called `Color`. This allows to set the tint color of the skeleton in the editor, C++ and Blueprints. Under the hood, the `spSkeleton->color` will be set on every tick of the renderer component.
|
||||||
|
* Added support for clipping.
|
||||||
|
* Switched from built-in ProceduralMeshComponent to RuntimeMeshComponent by Koderz (https://github.com/Koderz/UE4RuntimeMeshComponent, MIT). Needed for more flexibility regarding vertex format, should not have an impact on existing code/assets. You need to copy the RuntimeMeshComponentPlugin from our repository in `spine-ue4\Plugins\` to your project as well!
|
||||||
|
* Added support for two color tinting. All base materials, e.g. SpineUnlitNormalMaterial, now do proper two color tinting. No material parameters have changed.
|
||||||
|
* Updated to Unreal Engine 4.16.1. Note that 4.16 has a regression which will make it impossible to compile plain .c files!
|
||||||
|
* spine-c is now exposed from the plugin shared library on Windows via __declspec.
|
||||||
|
|
||||||
|
## C#
|
||||||
|
* **Breaking changes**
|
||||||
|
* `MeshAttachment.parentMesh` is now a private field to enforce using the `.ParentMesh` setter property in external code. The `MeshAttachment.ParentMesh` property is an appropriate replacement wherever `.parentMesh` was used.
|
||||||
|
* `Skeleton.GetBounds` takes a scratch array as input so it doesn't have to allocate a new array on each invocation itself. Reduces GC activity.
|
||||||
|
* Removed `Bone.WorldToLocalRotationX` and `Bone.WorldToLocalRotationY`. Replaced by `Bone.WorldToLocalRotation` (rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added `stride` parameter to `VertexAttachment.ComputeWorldVertices`.
|
||||||
|
* Removed `RegionAttachment.Vertices` field. The vertices array is provided to `RegionAttachment.ComputeWorldVertices` by the API user now.
|
||||||
|
* Removed `RegionAttachment.UpdateWorldVertices`, added `RegionAttachment.ComputeWorldVertices`. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided `worldVertices` array, starting at `offset`, then moving by `stride` array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
|
||||||
|
* Added `Bone.localToWorldRotation`(rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
|
||||||
|
* Added `PointAttachment`, additional method `NewPointAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `ClippingAttachment`, additional method `NewClippingAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
|
||||||
|
* `AnimationState.Apply` returns a bool indicating if any timeline was applied or not.
|
||||||
|
* `Animation.Apply` and `Timeline.Apply`` now take enums `MixPose` and `MixDirection` instead of bools.
|
||||||
|
|
||||||
|
### Unity
|
||||||
|
* Refactored renderer to work with new 3.6 features.
|
||||||
|
* **Two color tinting** is currently supported via extra UV2 and UV3 mesh vertex streams. To use Two color tinting, you need to:
|
||||||
|
* switch on "Tint Black" under "Advanced...",
|
||||||
|
* use the new `Spine/Skeleton Tint Black` shader, or your own shader that treats the UV2 and UV3 streams similarly.
|
||||||
|
* Additionally, for SkeletonGraphic, you can use `Spine/SkeletonGraphic Tint Black` (or the bundled SkeletonGraphicTintBlack material) or your own shader that uses UV2 and UV3 streams similarly. **Additional Shader Channels** TexCoord1 and TexCoord2 will need to be enabled from the Canvas component's inspector. These correspond to UV2 and UV3.
|
||||||
|
* **Clipping** is now supported. Caution: The SkeletonAnimation switches to slightly slower mesh generation code when clipping so limit your use of `ClippingAttachment`s when using on large numbers of skeletons.
|
||||||
|
* **SkeletonRenderer.initialFlip** Spine components such as SkeletonRenderer, SkeletonAnimation, SkeletonAnimator now has `initialFlipX` and `initialFlipY` fields which are also visible in the inspector under "Advanced...". It will allow you to set and preview a starting flip value for your skeleton component. This is applied immediately when the internal skeleton object is instantiated.
|
||||||
|
* **[SpineAttribute] Improvements**
|
||||||
|
* **Icons have been added to SpineAttributeDrawers**. This should make your default inspectors easier to understand at a glance.
|
||||||
|
* **Added Constraint Attributes** You can now use `[SpineIkConstraint]` `[SpineTransformConstraint]` `[SpinePathConstraint]`
|
||||||
|
* **SpineAttribute dataField** parameter can also now detect sibling fields within arrays and serializable structs/classes.
|
||||||
|
* **[SpineAttribute(includeNone:false)]** SpineAttributes now have an `includeNone` optional parameter to specify if you want to include or exclude a none ("") value option in the dropdown menu. Default is `includeNone:true`.
|
||||||
|
* **[SpineAttachment(skinField:"mySkin")]** The SpineAttachment attribute now has a skinField optional parameter to limit the dropdown items to attachments in a specific skin instead of the just default skin or all the skins in SkeletonData.
|
||||||
|
* **SkeletonDebugWindow**. Debugging tools have been moved from the SkeletonAnimation and SkeletonUtility component inspectors into its own utility window. You can access "Skeleton Debug" under the `Advanced...` foldout in the SkeletonAnimation inspector, or in SkeletonAnimation's right-click/context menu.
|
||||||
|
* **Skeleton Baking Window** The old Skeleton Baking feature is also now accessible through the SkeletonDataAsset's right-click/context menu.
|
||||||
|
* **AttachmentTools source material**. `AttachmentTools` methods can now accept a `sourceMaterial` argument to copy material properties from.
|
||||||
|
* **AttachmentTools Skin Extensions**. Using AttachmentTools, you can now add entries by slot name by also providing a skeleton argument. Also `Append(Skin)`, `RemoveAttachment` and `Clear` have been added.
|
||||||
|
* **BoneFollower and SkeletonUtilityBone Add RigidBody Button**. The BoneFollower and SkeletonUtilityBone component inspectors will now offer to add a `Rigidbody` or `Rigidbody2D` if it detects a collider of the appropriate type. Having a rigidbody on a moving transform with a collider fits better with the Unity physics systems and prevents excess calculations. It will not detect colliders on child objects so you have to add Rigidbody components manually accordingly.
|
||||||
|
* **SkeletonRenderer.OnPostProcessVertices** is a new callback that gives you a reference to the MeshGenerator after it has generated a mesh from the current skeleton pose. You can access `meshGenerator.VertexBuffer` or `meshGenerator.ColorBuffer` to modify these before they get pushed into the UnityEngine.Mesh for rendering. This can be useful for non-shader vertex effects.
|
||||||
|
* **Examples**
|
||||||
|
* **Examples now use properties**. The code in the example scripts have been switched over to using properties instead of fields to encourage their use for consistency. This is in anticipation of both users who want to move the Spine folders to the Unity Plugins folder (compiled as a different assembly), and of Unity 2017's ability to manually define different assemblies for shorter compilation times.
|
||||||
|
* **Mix And Match**. The mix-and-match example scene, code and data have been updated to reflect the current recommended setup for animation-compatible custom equip systems The underlying API has changed since 3.5 and the new API calls in MixAndMatch.cs is recommended. Documentation is in progress.
|
||||||
|
* **Sample Components**. `AtasRegionAttacher` and `SpriteAttacher` are now part of `Sample Components`, to reflect that they are meant to be used as sample code rather than production. A few other sample components have also been added. New imports of the unitypackage Examples folder will see a "Legacy" folder comprised of old sample components that no longer contain the most up-to-date and recommended workflows, but are kept in case old setups used them for production.
|
||||||
|
* **Spine folder**. In the unitypackage, the "spine-csharp" and "spine-unity" folders are now inside a "Spine" folder. This change will only affect fresh imports. Importing the unitypackage to update Spine-Unity in your existing project will update the appropriate files however you chose to arrange them, as long as the meta files are intact.
|
||||||
|
* **Breaking changes**
|
||||||
|
* The Sprite shaders module was updated to the latest version from the [source](https://github.com/traggett/UnitySpriteShaders/commits/master). Some changes were made to the underlying keyword structure. You may need to review the settings of your lit materials. Particularly, your Fixed Normals settings.
|
||||||
|
* The `Spine/Skeleton Lit` shader was switched over to non-fixed-function code. It now no longer requires mesh normals and has fixed normals at the shader level.
|
||||||
|
* The old MeshGenerator classes, interfaces and code in `Spine.Unity.MeshGeneration` are now deprecated. All mesh-generating components now share the class `Spine.Unity.MeshGenerator` defined in `SpineMesh.cs`. MeshGenerator is a serializable class.
|
||||||
|
* The `SkeletonRenderer.renderMeshes` optimization is currently non-functional.
|
||||||
|
* Old triangle-winding code has been removed from `SkeletonRenderer`. Please use shaders that have backface culling off.
|
||||||
|
* Render settings in `SkeletonGraphic` can now be accessed under `SkeletonGraphic.MeshGenerator.settings`. This is visible in the SkeletonGraphic inspector as `Advanced...`
|
||||||
|
* We will continue to bundle the unitypackage with the empty .cs files of deprecated classes until Spine 3.7 to ensure the upgrade process does not break.
|
||||||
|
* The [SpineAttachment(slotField:)] optional parameter found property value now acts as a Find(slotName) argument rather than Contains(slotName).
|
||||||
|
* `SkeletonAnimator` now uses a `SkeletonAnimator.MecanimTranslator` class to translate an Animator's Mecanim State Machine into skeleton poses. This makes code reuse possible for a Mecanim version of SkeletonGraphic.
|
||||||
|
* `SkeletonAnimator` `autoreset` and the `mixModes` array are now a part of SkeletonAnimator's MecanimTranslator `.Translator`. `autoReset` is set to true by default. Old prefabs and scene objects with Skeleton Animator may no longer have correct values set.
|
||||||
|
* Warnings and conditionals checking for specific Unity 5.2-and-below incompatibility have been removed.
|
||||||
|
|
||||||
|
## XNA/MonoGame
|
||||||
|
* Added support for clipping
|
||||||
|
* Removed `RegionBatcher` and `SkeletonRegionRenderer`, renamed `SkeletonMeshRenderer` to `SkeletonRenderer`
|
||||||
|
* Added support for two color tint. For it to work, you need to add the `SpineEffect.fx` file to your content project, then load it via `var effect = Content.Load<Effect>("SpineEffect");`, and set it on the `SkeletonRenderer`. See the example project for code.
|
||||||
|
* Added support for any `Effect` to be used by `SkeletonRenderer`
|
||||||
|
* Added support for `IVertexEffect` to modify vertices of skeletons on the CPU. `IVertexEffect` instances can be set on the `SkeletonRenderer`. See example project.
|
||||||
|
* Added `SkeletonDebugRenderer`
|
||||||
|
* Made `MeshBatcher` of SkeletonRenderer accessible via a getter. Allows user to batch their own geometry together with skeleton meshes for maximum batching instead of using XNA SpriteBatcher.
|
||||||
|
|
||||||
|
## Java
|
||||||
|
* **Breaking changes**
|
||||||
|
* `Skeleton.getBounds` takes a scratch array as input so it doesn't have to allocate a new array on each invocation itself. Reduces GC activity.
|
||||||
|
* Removed `Bone.worldToLocalRotationX` and `Bone.worldToLocalRotationY`. Replaced by `Bone.worldToLocalRotation` (rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added `stride` parameter to `VertexAttachment.computeWorldVertices`.
|
||||||
|
* Removed `RegionAttachment.vertices` field. The vertices array is provided to `RegionAttachment.computeWorldVertices` by the API user now.
|
||||||
|
* Removed `RegionAttachment.updateWorldVertices`, added `RegionAttachment.computeWorldVertices`. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided `worldVertices` array, starting at `offset`, then moving by `stride` array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.
|
||||||
|
* Skeleton attachments: Moved update of attached skeleton out of libGDX `SkeletonRenderer`, added overloaded method `Skeleton#updateWorldTransform(Bone), used for `SkeletonAttachment`. You now MUST call this new method
|
||||||
|
with the bone of the parent skeleton to which the child skeleton is attached. See `SkeletonAttachmentTest` for and example.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
|
||||||
|
* Added `Bone.localToWorldRotation`(rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
|
||||||
|
* Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
|
||||||
|
* `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
|
||||||
|
* `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
|
||||||
|
|
||||||
|
### libGDX
|
||||||
|
* Fixed renderer to work with 3.6 changes
|
||||||
|
* Added support for two color tinting. Use the new `TwoColorPolygonBatch` together with `SkeletonRenderer`
|
||||||
|
* Added support for clipping. See `SkeletonClipper`. Used automatically by `SkeletonRenderer`. Does not work when using a `SpriteBatch` with `SkeletonRenderer`. Use `PolygonSpriteBatch` or `TwoColorPolygonBatch` instead.
|
||||||
|
* Added `VertexEffect` interface, instances of which can be set on `SkeletonRenderer`. Allows to modify vertices before submitting them to GPU. See `SwirlEffect`, `JitterEffect` and `VertexEffectTest`.
|
||||||
|
|
||||||
|
## Lua
|
||||||
|
* **Breaking changes**
|
||||||
|
* Removed `Bone:worldToLocalRotationX` and `Bone:worldToLocalRotationY`. Replaced by `Bone:worldToLocalRotation` (rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* `VertexAttachment:computeWorldVertices` now takes offsets and stride to allow compositing vertices directly in a vertex buffer to be send to the GPU. The compositing is now performed in the backends' respective renderers. This also affects the subclasses `MeshAttachment`, `BoundingBoxAttachment` and `PathAttachment`.
|
||||||
|
* Removed `RegionAttachment:updateWorldVertices`, added `RegionAttachment:computeWorldVertices`, which takes offsets and stride to allow compositing vertices directly in a vertex buffer to be send to the GPU. The compositing is now performed in the backends' respective renderers.
|
||||||
|
* Removed `MeshAttachment.worldVertices` field. Computation is now performed in each backends' respective renderer. The `uv` coordinates are now stored in `MeshAttachment.uvs`.
|
||||||
|
* Removed `RegionAttachment.vertices` field. Computation is now performed in each backends respective renderer. The `uv` coordinates for each vertex are now stored in the `RegionAttachment.uvs` field.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* **Additions**
|
||||||
|
* Added `Bone:localToWorldRotation`(rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
|
||||||
|
* Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
|
||||||
|
* Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
|
||||||
|
* `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
|
||||||
|
* `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
|
||||||
|
* Added `JitterEffect` and `SwirlEffect` and support for vertex effects in Corona and Love
|
||||||
|
|
||||||
|
### Love2D
|
||||||
|
* Fixed renderer to work with 3.6 changes
|
||||||
|
* Added support for two color tinting. Enable it via `SkeletonRenderer.new(true)`.
|
||||||
|
* Added clipping support.
|
||||||
|
* Added support for vertex effects. Set an implementation like "JitterEffect" on `Skeleton.vertexEffect`. See `main.lua` for an example.
|
||||||
|
|
||||||
|
### Corona
|
||||||
|
* Fixed renderer to work with 3.6 changes. Sadly, two color tinting is not supported, as Corona doesn't let us change the vertex format needed and its doesn't allow to modify shaders in the way needed for two color tinting
|
||||||
|
* Added clipping support.
|
||||||
|
* Added support for vertex effects. Set an implementation like "JitterEffect" on `SkeletonRenderer.vertexEffect`. See `main.lua` for an example
|
||||||
|
|
||||||
|
## Typescript/Javascript
|
||||||
|
* **Breaking changes**
|
||||||
|
* `Skeleton.getBounds` takes a scratch array as input so it doesn't have to allocate a new array on each invocation itself. Reduces GC activity.
|
||||||
|
* Removed `Bone.worldToLocalRotationX` and `Bone.worldToLocalRotationY`. Replaced by `Bone.worldToLocalRotation` (rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Removed `VertexAttachment.computeWorldVertices` overload, changed `VertexAttachment.computeWorldVerticesWith` to `VertexAttachment.computeWorldVertices`, added `stride` parameter.
|
||||||
|
* Removed `RegionAttachment.vertices` field. The vertices array is provided to `RegionAttachment.computeWorldVertices` by the API user now.
|
||||||
|
* Removed `RegionAttachment.updateWorldVertices`, added `RegionAttachment.computeWorldVertices`. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided `worldVertices` array, starting at `offset`, then moving by `stride` array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.
|
||||||
|
* The completion event will fire for looped 0 duration animations every frame.
|
||||||
|
* Removed the Spine Widget in favor of [Spine Web Player](https://esotericsoftware.com/spine-player).
|
||||||
|
|
||||||
|
* **Additions**
|
||||||
|
* Added support for local and relative transform constraint calculation, including additional fields in `TransformConstraintData`
|
||||||
|
* Added `Bone.localToWorldRotation`(rotation given relative to x-axis, counter-clockwise, in degrees).
|
||||||
|
* Added two color tinting support, including `TwoColorTimeline` and additional fields on `Slot` and `SlotData`.
|
||||||
|
* Added `PointAttachment`, additional method `newPointAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `ClippingAttachment`, additional method `newClippingAttachment` in `AttachmentLoader` interface.
|
||||||
|
* Added `SkeletonClipper` and `Triangulator`, used to implement software clipping of attachments.
|
||||||
|
* `AnimationState#apply` returns boolean indicating if any timeline was applied or not.
|
||||||
|
* `Animation#apply` and `Timeline#apply`` now take enums `MixPose` and `MixDirection` instead of booleans
|
||||||
|
* Added `AssetManager.loadTextureAtlas`. Instead of loading the `.atlas` and corresponding image files manually, you can simply specify the location of the `.atlas` file and AssetManager will load the atlas and all its images automatically. `AssetManager.get("atlasname.atlas")` will then return an instance of `spine.TextureAtlas`.
|
||||||
|
* Added the [Spine Web Player](https://esotericsoftware.com/spine-player)
|
||||||
|
|
||||||
|
|
||||||
|
### WebGL backend
|
||||||
|
* Fixed WebGL context loss
|
||||||
|
* Added `Restorable` interface, implemented by any WebGL resource that needs restoration after a context loss. All WebGL resource classes (`Shader`, `Mesh`, `GLTexture`) implement this interface.
|
||||||
|
* Added `ManagedWebGLRenderingContext`. Handles setup of a `WebGLRenderingContext` given a canvas element and restoration of WebGL resources (`Shader`, `Mesh`, `GLTexture`) on WebGL context loss. WebGL resources register themselves with the `ManagedWebGLRenderingContext`. If the context is informed of a context loss and restoration, the registered WebGL resources' `restore()` method is called. The `restore()` method implementation on each resource type will recreate the GPU side objects.
|
||||||
|
* All classes that previously took a `WebGLRenderingContext` in the constructor now also allow a `ManagedWebGLRenderingContext`. This ensures existing applications do not break.
|
||||||
|
* To use automatic context restauration:
|
||||||
|
1. Create or fetch a canvas element from the DOM
|
||||||
|
2. Instantiate a `ManagedWebGLRenderingContext`, passing the canvas to the constructor. This will setup a `WebGLRenderingContext` internally and manage context loss/restoration.
|
||||||
|
3. Pass the `ManagedWebGLRenderingContext` to the constructors of classes that you previously passed a `WebGLRenderingContext` to (`AssetManager`, `GLTexture`, `Mesh`, `Shader`, `PolygonBatcher`, `SceneRenderer`, `ShapeRenderer`, `SkeletonRenderer`, `SkeletonDebugRenderer`).
|
||||||
|
* Fixed renderer to work with 3.6 changes.
|
||||||
|
* Added support for two color tinting.
|
||||||
|
* Improved performance by using `DYNAMIC_DRAW` for vertex buffer objects and fixing bug that copied to much data to the GPU each frame in `PolygonBatcher`/`Mesh`.
|
||||||
|
* Added two color tinting support, enabled by default. You can disable it via the constructors of `SceneRenderer`, `SkeletonRenderer`and `PolygonBatcher`. Note that you will need to use a shader created via `Shader.newTwoColoredTexturedShader` shader with `SkeletonRenderer` and `PolygonBatcher` if two color tinting is enabled.
|
||||||
|
* Added clipping support
|
||||||
|
* Added `VertexEffect` interface, instances of which can be set on `SkeletonRenderer`. Allows to modify vertices before submitting them to GPU. See `SwirlEffect`, `JitterEffect`, and the example which allows to set effects.
|
||||||
|
* Added `slotRangeStart` and `slotRangeEnd` parameters to `SkeletonRenderer#draw` and `SceneRenderer#drawSkeleton`. This allows you to render only a range of slots in the draw order. See `spine-ts/webgl/tests/test-slot-range.html` for an example.
|
||||||
|
|
||||||
|
### Canvas backend
|
||||||
|
* Fixed renderer to work for 3.6 changes. Sadly, we can't support two color tinting via the Canvas API.
|
||||||
|
* Added support for shearing and non-uniform scaling inherited from parent bones.
|
||||||
|
* Added support for alpha tinting.
|
||||||
|
|
||||||
|
### Three.js backend
|
||||||
|
* Fixed renderer to work with 3.6 changes. Two color tinting is not supported.
|
||||||
|
* Added clipping support
|
||||||
|
* Added `VertexEffect` interface, instances of which can be set on `SkeletonMesh`. Allows to modify vertices before submitting them to GPU. See `SwirlEffect`, `JitterEffect`.
|
||||||
|
* Added support for multi-page atlases
|
||||||
|
|
||||||
|
### Widget backend
|
||||||
|
* Fixed WebGL context loss (see WebGL backend changes). Enabled automatically.
|
||||||
|
* Fixed renderer to work for 3.6 changes. Supports two color tinting & clipping (see WebGL backend changes for details).
|
||||||
|
* Added fields `atlasContent`, `atlasPagesContent`, and `jsonContent` to `WidgetConfiguration` allowing you to directly pass the contents of the `.atlas`, atlas page `.png` files, and the `.json` file without having to do a request. See `README.md` and the example for details.
|
||||||
|
* `SpineWidget.setAnimation()` now takes an additional optional parameter for callbacks when animations are completed/interrupted/etc.
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.8.9)
|
||||||
|
project(spine)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
message("MSCV detected")
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
else()
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused-value -Wno-c++11-long-long -Wno-variadic-macros -Werror -Wextra -pedantic -Wnonportable-include-path -Wshadow -std=c89")
|
||||||
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wunused-value -Wno-c++11-long-long -Wno-variadic-macros -Werror -Wextra -Wnon-virtual-dtor -pedantic -Wnonportable-include-path -Wshadow -std=c++03 -fno-exceptions -fno-rtti")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_INSTALL_PREFIX "./")
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
|
set(SPINE_SFML FALSE CACHE BOOL FALSE)
|
||||||
|
set(SPINE_COCOS2D_OBJC FALSE CACHE BOOL FALSE)
|
||||||
|
set(SPINE_COCOS2D_X FALSE CACHE BOOL FALSE)
|
||||||
|
|
||||||
|
if((${SPINE_SFML}) OR (${CMAKE_CURRENT_BINARY_DIR} MATCHES "spine-sfml"))
|
||||||
|
add_subdirectory(spine-c)
|
||||||
|
add_subdirectory(spine-sfml/c)
|
||||||
|
add_subdirectory(spine-cpp)
|
||||||
|
add_subdirectory(spine-sfml/cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if((${SPINE_COCOS2D_OBJC}) OR (${CMAKE_CURRENT_BINARY_DIR} MATCHES "spine-cocos2d-objc"))
|
||||||
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
add_subdirectory(spine-cocos2d-objc)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if((${SPINE_COCOS2D_X}) OR (${CMAKE_CURRENT_BINARY_DIR} MATCHES "spine-cocos2dx"))
|
||||||
|
add_subdirectory(spine-cocos2dx)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(spine-c/spine-c-unit-tests)
|
||||||
|
add_subdirectory(spine-cpp/spine-cpp-unit-tests)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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.
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Spine Runtimes
|
||||||
|
|
||||||
|
This GitHub project hosts the Spine Runtimes which are needed to use [Spine](http://esotericsoftware.com/) 2D skeletal animation data with various game toolkits.
|
||||||
|
|
||||||
|
## Licensing
|
||||||
|
|
||||||
|
You are welcome to evaluate the Spine Runtimes and the examples we provide in this repository free of charge.
|
||||||
|
|
||||||
|
You can integrate the Spine Runtimes into your software free of charge, but users of your software must have their own [Spine license](https://esotericsoftware.com/spine-purchase). Please make your users aware of this requirement! This option is often chosen by those making development tools, such as an SDK, game toolkit, or software library.
|
||||||
|
|
||||||
|
In order to distribute your software containing the Spine Runtimes to others that don't have a Spine license, you need a [Spine license](https://esotericsoftware.com/spine-purchase) at the time of integration. Then you can distribute your software containing the Spine Runtimes however you like, provided others don't modify it or use it to create new software. If others want to do that, they'll need their own Spine license.
|
||||||
|
|
||||||
|
For the official legal terms governing the Spine Runtimes, please read the [Spine Runtimes License Agreement](http://esotericsoftware.com/spine-runtimes-license) and Section 2 of the [Spine Editor License Agreement](http://esotericsoftware.com/spine-editor-license#s2).
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
See the [Spine Runtimes Guide](http://esotericsoftware.com/spine-runtimes-guide) for detailed information about using the Spine Runtimes. The Spine [documentation page](http://esotericsoftware.com/spine-documentation#runtimesTitle) provides further information about tools and data formats. For runtime specific documentation, refer to the `README.md` file in each runtime directory.
|
||||||
|
|
||||||
|
## Bugs, enhancements, and tasks
|
||||||
|
|
||||||
|
Review our backlog of bugs, enhancements, and tasks in the [spine-runtimes](https://github.com/EsotericSoftware/spine-runtimes/issues) and [spine-editor](https://github.com/EsotericSoftware/spine-editor/issues) issue trackers. Our [roadmap](http://esotericsoftware.com/spine-roadmap) provides a more convenient view of the same issue tracker information.
|
||||||
|
|
||||||
|
## Versioning
|
||||||
|
|
||||||
|
The default branch on GitHub is stable and works with data exported from the latest, non-beta version of the Spine editor. New development is done in an `X.X-beta` branch, which may be a work in progress. Important changes to the runtimes can be reviewed in the [CHANGELOG.md file](CHANGELOG.md). Occasionally the Spine Runtimes are [tagged](https://github.com/EsotericSoftware/spine-runtimes/releases) with the specific Spine editor version they work with.
|
||||||
|
|
||||||
|
It is highly suggested to [freeze](http://esotericsoftware.com/spine-settings#Version) the Spine editor version to match the Spine Runtimes source being used and to update them in lock step. See the [Spine Runtimes Guide](http://esotericsoftware.com/spine-runtime-architecture#Versioning) for more information.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
In order to merge your contributions, we need a signed [contributor license agreement (CLA)](http://esotericsoftware.com/licenses/cla.txt) from you. You can send a copy of the CLA to contact@esotericsoftware.com.
|
||||||
|
|
||||||
|
When possible, it is best to base your contributions on the current beta branch (`X.X-beta`). Please be sure to follow the style and formatting you find in the respective runtime code to which you are contributing.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
These example projects show off many of Spine's features. Below are a number
|
||||||
|
of other example resources that may prove useful.
|
||||||
|
|
||||||
|
See our online demos, which render Spine animations right in your browser:
|
||||||
|
http://esotericsoftware.com/spine-demos/
|
||||||
|
|
||||||
|
Many companies around the world are doing great things with Spine:
|
||||||
|
http://esotericsoftware.com/spine-showcase
|
||||||
|
|
||||||
|
Tag your tweets using #madewithspine to show up on our Twitter page:
|
||||||
|
http://esotericsoftware.com/madewithspine
|
||||||
|
|
||||||
|
Learn how to use Spine with the Spine User Guide:
|
||||||
|
http://esotericsoftware.com/spine-user-guide
|
||||||
|
And the accompanying Spine User Guide videos:
|
||||||
|
https://www.youtube.com/playlist?list=PLwGl7Ikd_6GRFo7d0uRu_fN2RIlvkxW7b
|
||||||
|
And our other videos:
|
||||||
|
https://www.youtube.com/user/EsotericSoftware/videos
|
||||||
|
|
||||||
|
Super Spineboy is a full example game using Spine and libgdx:
|
||||||
|
https://github.com/EsotericSoftware/spine-superspineboy
|
||||||
+1557
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+286
@@ -0,0 +1,286 @@
|
|||||||
|
|
||||||
|
spineboy-pma.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
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 257 KiB |
+4304
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+286
@@ -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
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 255 KiB |
@@ -0,0 +1,8 @@
|
|||||||
|
Copyright (c) 2013, Esoteric Software
|
||||||
|
|
||||||
|
The images in this project may be redistributed as long as they are accompanied
|
||||||
|
by this license file. The images may not be used for commercial use of any
|
||||||
|
kind.
|
||||||
|
|
||||||
|
The project file is released into the public domain. It may be used as the basis
|
||||||
|
for derivative work.
|
||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+39
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "spine-runtimes",
|
||||||
|
"version": "3.5.35",
|
||||||
|
"lockfileVersion": 2,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "spine-runtimes",
|
||||||
|
"version": "3.5.35",
|
||||||
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/offscreencanvas": "^2019.6.4",
|
||||||
|
"@types/webvr-api": "^0.0.36"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/offscreencanvas": {
|
||||||
|
"version": "2019.6.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.6.4.tgz",
|
||||||
|
"integrity": "sha512-u8SAgdZ8ROtkTF+mfZGOscl0or6BSj9A4g37e6nvxDc+YB/oDut0wHkK2PBBiC2bNR8TS0CPV+1gAk4fNisr1Q=="
|
||||||
|
},
|
||||||
|
"node_modules/@types/webvr-api": {
|
||||||
|
"version": "0.0.36",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/webvr-api/-/webvr-api-0.0.36.tgz",
|
||||||
|
"integrity": "sha512-fGXlG8KA8cHOGR2BG7w40nSEKgAqg9h7cUm6zW1dSI7DCba7RvJNKGt0sgJzAXXvNzAAOcIGY6OpHEnKGhhjsQ=="
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/offscreencanvas": {
|
||||||
|
"version": "2019.6.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.6.4.tgz",
|
||||||
|
"integrity": "sha512-u8SAgdZ8ROtkTF+mfZGOscl0or6BSj9A4g37e6nvxDc+YB/oDut0wHkK2PBBiC2bNR8TS0CPV+1gAk4fNisr1Q=="
|
||||||
|
},
|
||||||
|
"@types/webvr-api": {
|
||||||
|
"version": "0.0.36",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/webvr-api/-/webvr-api-0.0.36.tgz",
|
||||||
|
"integrity": "sha512-fGXlG8KA8cHOGR2BG7w40nSEKgAqg9h7cUm6zW1dSI7DCba7RvJNKGt0sgJzAXXvNzAAOcIGY6OpHEnKGhhjsQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"name": "spine-runtimes",
|
||||||
|
"version": "3.5.35",
|
||||||
|
"description": "2D skeletal animation runtimes for Spine.",
|
||||||
|
"main": "spine-ts/build/spine-all.js",
|
||||||
|
"directories": {
|
||||||
|
"example": "examples"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"spine-ts"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git@github.com:EsotericSoftware/spine-runtimes.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"spine",
|
||||||
|
"runtimes",
|
||||||
|
"2d",
|
||||||
|
"skeletal",
|
||||||
|
"animation"
|
||||||
|
],
|
||||||
|
"author": "Esoteric Software",
|
||||||
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/EsotericSoftware/spine-runtimes/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/EsotericSoftware/spine-runtimes#readme",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/offscreencanvas": "^2019.6.4",
|
||||||
|
"@types/webvr-api": "^0.0.36"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
if(MSVC)
|
||||||
|
message("MSCV detected")
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
else()
|
||||||
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -std=c89")
|
||||||
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wnon-virtual-dtor -pedantic -std=c++03 -fno-exceptions -fno-rtti")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include_directories(include)
|
||||||
|
file(GLOB INCLUDES "spine-cpp/include/**/*.h")
|
||||||
|
file(GLOB SOURCES "spine-cpp/src/**/*.cpp")
|
||||||
|
|
||||||
|
add_library(spine-cpp STATIC ${SOURCES} ${INCLUDES})
|
||||||
|
target_include_directories(spine-cpp PUBLIC spine-cpp/include)
|
||||||
|
install(TARGETS spine-cpp DESTINATION dist/lib)
|
||||||
|
install(FILES ${INCLUDES} DESTINATION dist/include)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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.
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
# spine-cpp
|
||||||
|
|
||||||
|
The spine-cpp runtime provides basic functionality to load and manipulate [spine](http://esotericsoftware.com) skeletal animation data using C++. It does not perform rendering but can be extended to enable spine animations for other projects that utilize C++. Note, this library uses C++03 for maximum portability and therefore does not take advantage of any C++11 or newer features such as std::unique_ptr.
|
||||||
|
|
||||||
|
## Licensing
|
||||||
|
|
||||||
|
You are welcome to evaluate the Spine Runtimes and the examples we provide in this repository free of charge.
|
||||||
|
|
||||||
|
You can integrate the Spine Runtimes into your software free of charge, but users of your software must have their own [Spine license](https://esotericsoftware.com/spine-purchase). Please make your users aware of this requirement! This option is often chosen by those making development tools, such as an SDK, game toolkit, or software library.
|
||||||
|
|
||||||
|
In order to distribute your software containing the Spine Runtimes to others that don't have a Spine license, you need a [Spine license](https://esotericsoftware.com/spine-purchase) at the time of integration. Then you can distribute your software containing the Spine Runtimes however you like, provided others don't modify it or use it to create new software. If others want to do that, they'll need their own Spine license.
|
||||||
|
|
||||||
|
For the official legal terms governing the Spine Runtimes, please read the [Spine Runtimes License Agreement](http://esotericsoftware.com/spine-runtimes-license) and Section 2 of the [Spine Editor License Agreement](http://esotericsoftware.com/spine-editor-license#s2).
|
||||||
|
|
||||||
|
## Spine version
|
||||||
|
|
||||||
|
spine-cpp works with data exported from spine 3.8.xx.
|
||||||
|
|
||||||
|
spine-cpp supports all spine features.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
1. Download the spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it as a zip via the download button above.
|
||||||
|
2. Copy the contents of the `spine-cpp/spine-cpp/src` and `spine-cpp/spine-cpp/include` directories into your project. Be sure your header search is configured to find the contents of the `spine-cpp/spine-cpp/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
### [Please see the spine-cpp guide for full documentation](http://esotericsoftware.com/spine-cpp)
|
||||||
|
|
||||||
|
## Extension
|
||||||
|
|
||||||
|
Extending spine-cpp requires implementing both the `SpineExtension` class and the TextureLoader class:
|
||||||
|
|
||||||
|
```
|
||||||
|
#include <spine/Extension.h>
|
||||||
|
void spine::SpineExtension *spine::getDefaultExtension() {
|
||||||
|
return new spine::DefaultExtension();
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyTextureLoader : public spine::TextureLoader
|
||||||
|
{
|
||||||
|
virtual void load(spine::AtlasPage& page, const spine::String& path) {
|
||||||
|
void* texture = ... load the texture based on path ...
|
||||||
|
page->setRendererObject(texture); // use the texture later in your rendering code
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void unload(void* texture) { // TODO }
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
## Runtimes extending spine-cpp
|
||||||
|
|
||||||
|
- [spine-sfml](../spine-sfml/cpp)
|
||||||
|
- [spine-cocos2dx](../spine-cocos2dx)
|
||||||
|
- [spine-ue4](../spine-ue4)
|
||||||
Vendored
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.8.9)
|
||||||
|
project(spine_cpp_unit_test)
|
||||||
|
|
||||||
|
set(CMAKE_INSTALL_PREFIX "./")
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
|
|
||||||
|
include_directories(../spine-cpp/include teamcity minicppunit tests memory)
|
||||||
|
|
||||||
|
set(SRC
|
||||||
|
src/main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(spine_cpp_unit_test ${SRC})
|
||||||
|
target_link_libraries(spine_cpp_unit_test spine-cpp)
|
||||||
|
|
||||||
|
|
||||||
|
#########################################################
|
||||||
|
# copy resources to build output directory
|
||||||
|
#########################################################
|
||||||
|
add_custom_command(TARGET spine_cpp_unit_test PRE_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/../../examples/spineboy/export $<TARGET_FILE_DIR:spine_cpp_unit_test>/testdata/spineboy)
|
||||||
|
|
||||||
|
add_custom_command(TARGET spine_cpp_unit_test PRE_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/../../examples/raptor/export $<TARGET_FILE_DIR:spine_cpp_unit_test>/testdata/raptor)
|
||||||
|
|
||||||
|
add_custom_command(TARGET spine_cpp_unit_test PRE_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/../../examples/goblins/export $<TARGET_FILE_DIR:spine_cpp_unit_test>/testdata/goblins)
|
||||||
|
|
||||||
|
add_custom_command(TARGET spine_cpp_unit_test PRE_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/../../examples/coin/export $<TARGET_FILE_DIR:spine_cpp_unit_test>/testdata/coin)
|
||||||
|
|
||||||
|
add_custom_command(TARGET spine_cpp_unit_test PRE_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/../../examples/tank/export $<TARGET_FILE_DIR:spine_cpp_unit_test>/testdata/tank)
|
||||||
|
|
||||||
|
add_custom_command(TARGET spine_cpp_unit_test PRE_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/../../examples/stretchyman/export $<TARGET_FILE_DIR:spine_cpp_unit_test>/testdata/stretchyman)
|
||||||
Vendored
Executable
+67
@@ -0,0 +1,67 @@
|
|||||||
|
# spine-cpp-unit-tests
|
||||||
|
|
||||||
|
The spine-cpp-unit-tests project is to test the [spine](http://esotericsoftware.com) skeletal animation system. It does not perform rendering. It is primarily used for regression testing and leak detection. It is designed to be run from a Continuous Integration server and to passively verify changes automatically on check-in.
|
||||||
|
|
||||||
|
## Mini CPP Unit Testing
|
||||||
|
[MiniCppUnit](https://sourceforge.net/p/minicppunit/wiki/Home/) is a minimal unit testing framework similar to JUnit. It is used here to avoid large dependancies.
|
||||||
|
|
||||||
|
Tests are sorted into Suites, Fixtures and Cases. There is one suite, it contains many fixtures and each fixture contains test cases. To turn off a fixture, edit "TestOptions.h". To turn off specific test cases, comment out the TEST_CASE() line in the fixture's header.
|
||||||
|
|
||||||
|
## Memory Leak Detection
|
||||||
|
This project includes a very minimal memory leak detector. It is based roughly on the leak detector in the [Popcap Framework](https://sourceforge.net/projects/popcapframework/?source=directory), but has been modified over the years.
|
||||||
|
|
||||||
|
## Continuous Integration
|
||||||
|
The test runner includes the ability to format output messages to signal a CI server. An example interface for [Teamcity](https://www.jetbrains.com/teamcity/) is included. To implement for another server, determine the wireformat for the messages and duplicate/edit the teamcity_messages class. [Teamcity Wire Format](https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity)
|
||||||
|
|
||||||
|
### Trigger
|
||||||
|
Your CI server should trigger on VCS check-in.
|
||||||
|
|
||||||
|
### CMake Build Step
|
||||||
|
The first build step for the CI server should be to run CMake on the 'spine-cpp-unit-tests' folder. Follow the usage directions below.
|
||||||
|
|
||||||
|
### Compile Build Step
|
||||||
|
This build step should not execute if the previous step did not successfully complete.
|
||||||
|
Depending on the test agent build environment, you should build the output solution or project from the cmake step. Debug is fine.
|
||||||
|
|
||||||
|
### Test Runner Build Step
|
||||||
|
This build step should not execute if the previous step did not successfully complete.
|
||||||
|
Again, depending on the test agent build environment, you should have produced an executable. Run this executable.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Make sure [CMake](https://cmake.org/download/) is installed.
|
||||||
|
|
||||||
|
Create a 'build' directory in the 'spine-cpp-unit-tests' folder. Then switch to that folder and execute cmake:
|
||||||
|
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
|
||||||
|
### Win32 build
|
||||||
|
msbuild spine_unit_test.sln /t:spine_unit_test /p:Configuration="Debug" /p:Platform="Win32"
|
||||||
|
|
||||||
|
|
||||||
|
## Licensing
|
||||||
|
This spine Runtime may only be used for personal or internal use, typically to evaluate spine before purchasing. If you would like to incorporate a spine Runtime into your applications, distribute software containing a spine Runtime, or modify a spine Runtime, then you will need a valid [spine license](https://esotericsoftware.com/spine-purchase). Please see the [spine Runtimes Software License](https://github.com/EsotericSoftware/spine-runtimes/blob/master/LICENSE) for detailed information.
|
||||||
|
|
||||||
|
The spine Runtimes are developed with the intent to be used with data exported from spine. By purchasing spine, `Section 2` of the [spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the spine Runtimes.
|
||||||
|
|
||||||
|
original "walk"": 330
|
||||||
|
second "walk": 0d0
|
||||||
|
|
||||||
|
queue interrupt for original walk
|
||||||
|
queue start for second walk
|
||||||
|
drain interrupt and start
|
||||||
|
|
||||||
|
0d0 is interrupted
|
||||||
|
0d0 is ended
|
||||||
|
|
||||||
|
"run": 0c0
|
||||||
|
0d0 is interrupted
|
||||||
|
second walk becomes mixingFrom of run
|
||||||
|
0c0 is started
|
||||||
|
|
||||||
|
queue is drained
|
||||||
|
|
||||||
|
first walk: 6f0
|
||||||
|
second walk: 9c0
|
||||||
+109
@@ -0,0 +1,109 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <spine/spine.h>
|
||||||
|
#include <spine/Debug.h>
|
||||||
|
|
||||||
|
#pragma warning ( disable : 4710 )
|
||||||
|
|
||||||
|
using namespace spine;
|
||||||
|
|
||||||
|
void loadBinary(const String &binaryFile, const String &atlasFile, Atlas *&atlas, SkeletonData *&skeletonData,
|
||||||
|
AnimationStateData *&stateData, Skeleton *&skeleton, AnimationState *&state) {
|
||||||
|
atlas = new(__FILE__, __LINE__) Atlas(atlasFile, NULL);
|
||||||
|
assert(atlas != NULL);
|
||||||
|
|
||||||
|
SkeletonBinary binary(atlas);
|
||||||
|
skeletonData = binary.readSkeletonDataFile(binaryFile);
|
||||||
|
assert(skeletonData);
|
||||||
|
|
||||||
|
skeleton = new(__FILE__, __LINE__) Skeleton(skeletonData);
|
||||||
|
assert(skeleton != NULL);
|
||||||
|
|
||||||
|
stateData = new(__FILE__, __LINE__) AnimationStateData(skeletonData);
|
||||||
|
assert(stateData != NULL);
|
||||||
|
stateData->setDefaultMix(0.4f);
|
||||||
|
|
||||||
|
state = new(__FILE__, __LINE__) AnimationState(stateData);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadJson(const String &jsonFile, const String &atlasFile, Atlas *&atlas, SkeletonData *&skeletonData,
|
||||||
|
AnimationStateData *&stateData, Skeleton *&skeleton, AnimationState *&state) {
|
||||||
|
atlas = new(__FILE__, __LINE__) Atlas(atlasFile, NULL);
|
||||||
|
assert(atlas != NULL);
|
||||||
|
|
||||||
|
SkeletonJson json(atlas);
|
||||||
|
skeletonData = json.readSkeletonDataFile(jsonFile);
|
||||||
|
assert(skeletonData);
|
||||||
|
|
||||||
|
skeleton = new(__FILE__, __LINE__) Skeleton(skeletonData);
|
||||||
|
assert(skeleton != NULL);
|
||||||
|
|
||||||
|
stateData = new(__FILE__, __LINE__) AnimationStateData(skeletonData);
|
||||||
|
assert(stateData != NULL);
|
||||||
|
stateData->setDefaultMix(0.4f);
|
||||||
|
|
||||||
|
state = new(__FILE__, __LINE__) AnimationState(stateData);
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispose(Atlas *atlas, SkeletonData *skeletonData, AnimationStateData *stateData, Skeleton *skeleton,
|
||||||
|
AnimationState *state) {
|
||||||
|
delete skeleton;
|
||||||
|
delete state;
|
||||||
|
delete stateData;
|
||||||
|
delete skeletonData;
|
||||||
|
delete atlas;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TestData {
|
||||||
|
TestData(const String &jsonSkeleton, const String &binarySkeleton, const String &atlas) : _jsonSkeleton(
|
||||||
|
jsonSkeleton), _binarySkeleton(binarySkeleton), _atlas(atlas) {}
|
||||||
|
|
||||||
|
String _jsonSkeleton;
|
||||||
|
String _binarySkeleton;
|
||||||
|
String _atlas;
|
||||||
|
};
|
||||||
|
|
||||||
|
void testLoading() {
|
||||||
|
Vector<TestData> testData;
|
||||||
|
testData.add(TestData("testdata/coin/coin-pro.json", "testdata/coin/coin-pro.skel", "testdata/coin/coin.atlas"));
|
||||||
|
/*testData.add(TestData("testdata/goblins/goblins-pro.json", "testdata/goblins/goblins-pro.skel",
|
||||||
|
"testdata/goblins/goblins.atlas"));
|
||||||
|
testData.add(TestData("testdata/raptor/raptor-pro.json", "testdata/raptor/raptor-pro.skel",
|
||||||
|
"testdata/raptor/raptor.atlas"));
|
||||||
|
testData.add(TestData("testdata/spineboy/spineboy-pro.json", "testdata/spineboy/spineboy-pro.skel",
|
||||||
|
"testdata/spineboy/spineboy.atlas"));
|
||||||
|
testData.add(TestData("testdata/stretchyman/stretchyman-pro.json", "testdata/stretchyman/stretchyman-pro.skel",
|
||||||
|
"testdata/stretchyman/stretchyman.atlas"));
|
||||||
|
testData.add(TestData("testdata/tank/tank-pro.json", "testdata/tank/tank-pro.skel", "testdata/tank/tank.atlas"));*/
|
||||||
|
|
||||||
|
for (size_t i = 0; i < testData.size(); i++) {
|
||||||
|
TestData &data = testData[i];
|
||||||
|
Atlas *atlas = NULL;
|
||||||
|
SkeletonData *skeletonData = NULL;
|
||||||
|
AnimationStateData *stateData = NULL;
|
||||||
|
Skeleton *skeleton = NULL;
|
||||||
|
AnimationState *state = NULL;
|
||||||
|
|
||||||
|
printf("Loading %s\n", data._jsonSkeleton.buffer());
|
||||||
|
loadJson(data._jsonSkeleton, data._atlas, atlas, skeletonData, stateData, skeleton, state);
|
||||||
|
dispose(atlas, skeletonData, stateData, skeleton, state);
|
||||||
|
|
||||||
|
printf("Loading %s\n", data._binarySkeleton.buffer());
|
||||||
|
loadBinary(data._binarySkeleton, data._atlas, atlas, skeletonData, stateData, skeleton, state);
|
||||||
|
dispose(atlas, skeletonData, stateData, skeleton, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
SpineExtension* getDefaultExtension() {
|
||||||
|
return new DefaultSpineExtension();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
DebugExtension debug(SpineExtension::getInstance());
|
||||||
|
SpineExtension::setInstance(&debug);
|
||||||
|
|
||||||
|
testLoading();
|
||||||
|
|
||||||
|
debug.reportLeaks();
|
||||||
|
}
|
||||||
+122
@@ -0,0 +1,122 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Animation_h
|
||||||
|
#define Spine_Animation_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/HashMap.h>
|
||||||
|
#include <spine/MixBlend.h>
|
||||||
|
#include <spine/MixDirection.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Timeline;
|
||||||
|
|
||||||
|
class Skeleton;
|
||||||
|
|
||||||
|
class Event;
|
||||||
|
|
||||||
|
class SP_API Animation : public SpineObject {
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
friend class TrackEntry;
|
||||||
|
|
||||||
|
friend class AnimationStateData;
|
||||||
|
|
||||||
|
friend class AttachmentTimeline;
|
||||||
|
|
||||||
|
friend class ColorTimeline;
|
||||||
|
|
||||||
|
friend class DeformTimeline;
|
||||||
|
|
||||||
|
friend class DrawOrderTimeline;
|
||||||
|
|
||||||
|
friend class EventTimeline;
|
||||||
|
|
||||||
|
friend class IkConstraintTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintMixTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintPositionTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintSpacingTimeline;
|
||||||
|
|
||||||
|
friend class RotateTimeline;
|
||||||
|
|
||||||
|
friend class ScaleTimeline;
|
||||||
|
|
||||||
|
friend class ShearTimeline;
|
||||||
|
|
||||||
|
friend class TransformConstraintTimeline;
|
||||||
|
|
||||||
|
friend class TranslateTimeline;
|
||||||
|
|
||||||
|
friend class TwoColorTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Animation(const String &name, Vector<Timeline *> &timelines, float duration);
|
||||||
|
|
||||||
|
~Animation();
|
||||||
|
|
||||||
|
/// Applies all the animation's timelines to the specified skeleton.
|
||||||
|
/// See also Timeline::apply(Skeleton&, float, float, Vector, float, MixPose, MixDirection)
|
||||||
|
void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector<Event *> *pEvents, float alpha,
|
||||||
|
MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
const String &getName();
|
||||||
|
|
||||||
|
Vector<Timeline *> &getTimelines();
|
||||||
|
|
||||||
|
bool hasTimeline(int id);
|
||||||
|
|
||||||
|
float getDuration();
|
||||||
|
|
||||||
|
void setDuration(float inValue);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<Timeline *> _timelines;
|
||||||
|
HashMap<int, bool> _timelineIds;
|
||||||
|
float _duration;
|
||||||
|
String _name;
|
||||||
|
|
||||||
|
/// @param target After the first and before the last entry.
|
||||||
|
static int binarySearch(Vector<float> &values, float target, int step);
|
||||||
|
|
||||||
|
/// @param target After the first and before the last entry.
|
||||||
|
static int binarySearch(Vector<float> &values, float target);
|
||||||
|
|
||||||
|
static int linearSearch(Vector<float> &values, float target, int step);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Animation_h */
|
||||||
Vendored
+448
@@ -0,0 +1,448 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_AnimationState_h
|
||||||
|
#define Spine_AnimationState_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/Pool.h>
|
||||||
|
#include <spine/MixBlend.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/HasRendererObject.h>
|
||||||
|
#include "Slot.h"
|
||||||
|
|
||||||
|
#ifdef SPINE_USE_STD_FUNCTION
|
||||||
|
#include <functional>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum EventType {
|
||||||
|
EventType_Start,
|
||||||
|
EventType_Interrupt,
|
||||||
|
EventType_End,
|
||||||
|
EventType_Complete,
|
||||||
|
EventType_Dispose,
|
||||||
|
EventType_Event
|
||||||
|
};
|
||||||
|
|
||||||
|
class AnimationState;
|
||||||
|
class TrackEntry;
|
||||||
|
|
||||||
|
class Animation;
|
||||||
|
class Event;
|
||||||
|
class AnimationStateData;
|
||||||
|
class Skeleton;
|
||||||
|
class RotateTimeline;
|
||||||
|
class AttachmentTimeline;
|
||||||
|
|
||||||
|
#ifdef SPINE_USE_STD_FUNCTION
|
||||||
|
typedef std::function<void (AnimationState* state, EventType type, TrackEntry* entry, Event* event)> AnimationStateListener;
|
||||||
|
#else
|
||||||
|
typedef void (*AnimationStateListener) (AnimationState* state, EventType type, TrackEntry* entry, Event* event);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// Abstract class to inherit from to create a callback object
|
||||||
|
class SP_API AnimationStateListenerObject {
|
||||||
|
public:
|
||||||
|
AnimationStateListenerObject() { };
|
||||||
|
virtual ~AnimationStateListenerObject() { };
|
||||||
|
public:
|
||||||
|
/// The callback function to be called
|
||||||
|
virtual void callback(AnimationState* state, EventType type, TrackEntry* entry, Event* event) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// State for the playback of an animation
|
||||||
|
class SP_API TrackEntry : public SpineObject, public HasRendererObject {
|
||||||
|
friend class EventQueue;
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TrackEntry();
|
||||||
|
|
||||||
|
virtual ~TrackEntry();
|
||||||
|
|
||||||
|
/// The index of the track where this entry is either current or queued.
|
||||||
|
int getTrackIndex();
|
||||||
|
|
||||||
|
/// The animation to apply for this track entry.
|
||||||
|
Animation* getAnimation();
|
||||||
|
|
||||||
|
/// If true, the animation will repeat. If false, it will not, instead its last frame is applied if played beyond its duration.
|
||||||
|
bool getLoop();
|
||||||
|
void setLoop(bool inValue);
|
||||||
|
|
||||||
|
/// If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead
|
||||||
|
/// of being mixed out.
|
||||||
|
///
|
||||||
|
/// When mixing between animations that key the same property, if a lower track also keys that property then the value will
|
||||||
|
/// briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%
|
||||||
|
/// while the second animation mixes from 0% to 100%. Setting holdPrevious to true applies the first animation
|
||||||
|
/// at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which
|
||||||
|
/// keys the property, only when a higher track also keys the property.
|
||||||
|
///
|
||||||
|
/// Snapping will occur if holdPrevious is true and this animation does not key all the same properties as the
|
||||||
|
/// previous animation.
|
||||||
|
bool getHoldPrevious();
|
||||||
|
void setHoldPrevious(bool inValue);
|
||||||
|
|
||||||
|
/// Seconds to postpone playing the animation. When a track entry is the current track entry, delay postpones incrementing
|
||||||
|
/// the track time. When a track entry is queued, delay is the time from the start of the previous animation to when the
|
||||||
|
/// track entry will become the current track entry.
|
||||||
|
float getDelay();
|
||||||
|
void setDelay(float inValue);
|
||||||
|
|
||||||
|
/// Current time in seconds this track entry has been the current track entry. The track time determines
|
||||||
|
/// TrackEntry.AnimationTime. The track time can be set to start the animation at a time other than 0, without affecting looping.
|
||||||
|
float getTrackTime();
|
||||||
|
void setTrackTime(float inValue);
|
||||||
|
|
||||||
|
/// The track time in seconds when this animation will be removed from the track. Defaults to the animation duration for
|
||||||
|
/// non-looping animations and to int.MaxValue for looping animations. If the track end time is reached and no
|
||||||
|
/// other animations are queued for playback, and mixing from any previous animations is complete, properties keyed by the animation,
|
||||||
|
/// are set to the setup pose and the track is cleared.
|
||||||
|
///
|
||||||
|
/// It may be desired to use AnimationState.addEmptyAnimation(int, float, float) to mix the properties back to the
|
||||||
|
/// setup pose over time, rather than have it happen instantly.
|
||||||
|
float getTrackEnd();
|
||||||
|
void setTrackEnd(float inValue);
|
||||||
|
|
||||||
|
/// Seconds when this animation starts, both initially and after looping. Defaults to 0.
|
||||||
|
///
|
||||||
|
/// When changing the animation start time, it often makes sense to set TrackEntry.AnimationLast to the same value to
|
||||||
|
/// prevent timeline keys before the start time from triggering.
|
||||||
|
float getAnimationStart();
|
||||||
|
void setAnimationStart(float inValue);
|
||||||
|
|
||||||
|
/// Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will
|
||||||
|
/// loop back to TrackEntry.AnimationStart at this time. Defaults to the animation duration.
|
||||||
|
float getAnimationEnd();
|
||||||
|
void setAnimationEnd(float inValue);
|
||||||
|
|
||||||
|
/// The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this
|
||||||
|
/// animation is applied, event timelines will fire all events between the animation last time (exclusive) and animation time
|
||||||
|
/// (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation is applied.
|
||||||
|
float getAnimationLast();
|
||||||
|
void setAnimationLast(float inValue);
|
||||||
|
|
||||||
|
/// Uses TrackEntry.TrackTime to compute the animation time between TrackEntry.AnimationStart. and
|
||||||
|
/// TrackEntry.AnimationEnd. When the track time is 0, the animation time is equal to the animation start time.
|
||||||
|
float getAnimationTime();
|
||||||
|
|
||||||
|
/// Multiplier for the delta time when the animation state is updated, causing time for this animation to play slower or
|
||||||
|
/// faster. Defaults to 1.
|
||||||
|
float getTimeScale();
|
||||||
|
void setTimeScale(float inValue);
|
||||||
|
|
||||||
|
/// Values less than 1 mix this animation with the last skeleton pose. Defaults to 1, which overwrites the last skeleton pose with
|
||||||
|
/// this animation.
|
||||||
|
///
|
||||||
|
/// Typically track 0 is used to completely pose the skeleton, then alpha can be used on higher tracks. It doesn't make sense
|
||||||
|
/// to use alpha on track 0 if the skeleton pose is from the last frame render.
|
||||||
|
float getAlpha();
|
||||||
|
void setAlpha(float inValue);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// When the mix percentage (mix time / mix duration) is less than the event threshold, event timelines for the animation
|
||||||
|
/// being mixed out will be applied. Defaults to 0, so event timelines are not applied for an animation being mixed out.
|
||||||
|
float getEventThreshold();
|
||||||
|
void setEventThreshold(float inValue);
|
||||||
|
|
||||||
|
/// When the mix percentage (mix time / mix duration) is less than the attachment threshold, attachment timelines for the
|
||||||
|
/// animation being mixed out will be applied. Defaults to 0, so attachment timelines are not applied for an animation being
|
||||||
|
/// mixed out.
|
||||||
|
float getAttachmentThreshold();
|
||||||
|
void setAttachmentThreshold(float inValue);
|
||||||
|
|
||||||
|
/// When the mix percentage (mix time / mix duration) is less than the draw order threshold, draw order timelines for the
|
||||||
|
/// animation being mixed out will be applied. Defaults to 0, so draw order timelines are not applied for an animation being
|
||||||
|
/// mixed out.
|
||||||
|
float getDrawOrderThreshold();
|
||||||
|
void setDrawOrderThreshold(float inValue);
|
||||||
|
|
||||||
|
/// The animation queued to start after this animation, or NULL.
|
||||||
|
TrackEntry* getNext();
|
||||||
|
|
||||||
|
/// Returns true if at least one loop has been completed.
|
||||||
|
bool isComplete();
|
||||||
|
|
||||||
|
/// Seconds from 0 to the mix duration when mixing from the previous animation to this animation. May be slightly more than
|
||||||
|
/// TrackEntry.MixDuration when the mix is complete.
|
||||||
|
float getMixTime();
|
||||||
|
void setMixTime(float inValue);
|
||||||
|
|
||||||
|
/// Seconds for mixing from the previous animation to this animation. Defaults to the value provided by
|
||||||
|
/// AnimationStateData based on the animation before this animation (if any).
|
||||||
|
///
|
||||||
|
/// The mix duration can be set manually rather than use the value from AnimationStateData.GetMix.
|
||||||
|
/// In that case, the mixDuration must be set before AnimationState.update(float) is next called.
|
||||||
|
///
|
||||||
|
/// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay
|
||||||
|
/// less than or equal to 0, note the Delay is set using the mix duration from the AnimationStateData
|
||||||
|
float getMixDuration();
|
||||||
|
void setMixDuration(float inValue);
|
||||||
|
|
||||||
|
MixBlend getMixBlend();
|
||||||
|
void setMixBlend(MixBlend blend);
|
||||||
|
|
||||||
|
/// The track entry for the previous animation when mixing from the previous animation to this animation, or NULL if no
|
||||||
|
/// mixing is currently occuring. When mixing from multiple animations, MixingFrom makes up a double linked list with MixingTo.
|
||||||
|
TrackEntry* getMixingFrom();
|
||||||
|
|
||||||
|
/// The track entry for the next animation when mixing from this animation, or NULL if no mixing is currently occuring.
|
||||||
|
/// When mixing from multiple animations, MixingTo makes up a double linked list with MixingFrom.
|
||||||
|
TrackEntry* getMixingTo();
|
||||||
|
|
||||||
|
/// Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the
|
||||||
|
/// long way around when using alpha and starting animations on other tracks.
|
||||||
|
///
|
||||||
|
/// Mixing involves finding a rotation between two others, which has two possible solutions: the short way or the long way around.
|
||||||
|
/// The two rotations likely change over time, so which direction is the short or long way also changes.
|
||||||
|
/// If the short way was always chosen, bones would flip to the other side when that direction became the long way.
|
||||||
|
/// TrackEntry chooses the short way the first time it is applied and remembers that direction.
|
||||||
|
void resetRotationDirections();
|
||||||
|
|
||||||
|
void setListener(AnimationStateListener listener);
|
||||||
|
|
||||||
|
void setListener(AnimationStateListenerObject* listener);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Animation* _animation;
|
||||||
|
|
||||||
|
TrackEntry* _next;
|
||||||
|
TrackEntry* _mixingFrom;
|
||||||
|
TrackEntry* _mixingTo;
|
||||||
|
int _trackIndex;
|
||||||
|
|
||||||
|
bool _loop, _holdPrevious;
|
||||||
|
float _eventThreshold, _attachmentThreshold, _drawOrderThreshold;
|
||||||
|
float _animationStart, _animationEnd, _animationLast, _nextAnimationLast;
|
||||||
|
float _delay, _trackTime, _trackLast, _nextTrackLast, _trackEnd, _timeScale;
|
||||||
|
float _alpha, _mixTime, _mixDuration, _interruptAlpha, _totalAlpha;
|
||||||
|
MixBlend _mixBlend;
|
||||||
|
Vector<int> _timelineMode;
|
||||||
|
Vector<TrackEntry*> _timelineHoldMix;
|
||||||
|
Vector<float> _timelinesRotation;
|
||||||
|
AnimationStateListener _listener;
|
||||||
|
AnimationStateListenerObject* _listenerObject;
|
||||||
|
|
||||||
|
void reset();
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API EventQueueEntry : public SpineObject {
|
||||||
|
friend class EventQueue;
|
||||||
|
|
||||||
|
public:
|
||||||
|
EventType _type;
|
||||||
|
TrackEntry* _entry;
|
||||||
|
Event* _event;
|
||||||
|
|
||||||
|
EventQueueEntry(EventType eventType, TrackEntry* trackEntry, Event* event = NULL);
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API EventQueue : public SpineObject {
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<EventQueueEntry> _eventQueueEntries;
|
||||||
|
AnimationState& _state;
|
||||||
|
Pool<TrackEntry>& _trackEntryPool;
|
||||||
|
bool _drainDisabled;
|
||||||
|
|
||||||
|
static EventQueue* newEventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
|
||||||
|
|
||||||
|
static EventQueueEntry newEventQueueEntry(EventType eventType, TrackEntry* entry, Event* event = NULL);
|
||||||
|
|
||||||
|
EventQueue(AnimationState& state, Pool<TrackEntry>& trackEntryPool);
|
||||||
|
|
||||||
|
~EventQueue();
|
||||||
|
|
||||||
|
void start(TrackEntry* entry);
|
||||||
|
|
||||||
|
void interrupt(TrackEntry* entry);
|
||||||
|
|
||||||
|
void end(TrackEntry* entry);
|
||||||
|
|
||||||
|
void dispose(TrackEntry* entry);
|
||||||
|
|
||||||
|
void complete(TrackEntry* entry);
|
||||||
|
|
||||||
|
void event(TrackEntry* entry, Event* event);
|
||||||
|
|
||||||
|
/// Raises all events in the queue and drains the queue.
|
||||||
|
void drain();
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API AnimationState : public SpineObject, public HasRendererObject {
|
||||||
|
friend class TrackEntry;
|
||||||
|
friend class EventQueue;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AnimationState(AnimationStateData* data);
|
||||||
|
|
||||||
|
~AnimationState();
|
||||||
|
|
||||||
|
/// Increments the track entry times, setting queued animations as current if needed
|
||||||
|
/// @param delta delta time
|
||||||
|
void update(float delta);
|
||||||
|
|
||||||
|
/// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the
|
||||||
|
/// animation state can be applied to multiple skeletons to pose them identically.
|
||||||
|
bool apply(Skeleton& skeleton);
|
||||||
|
|
||||||
|
/// Removes all animations from all tracks, leaving skeletons in their previous pose.
|
||||||
|
/// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
|
||||||
|
/// rather than leaving them in their previous pose.
|
||||||
|
void clearTracks();
|
||||||
|
|
||||||
|
/// Removes all animations from the tracks, leaving skeletons in their previous pose.
|
||||||
|
/// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose,
|
||||||
|
/// rather than leaving them in their previous pose.
|
||||||
|
void clearTrack(size_t trackIndex);
|
||||||
|
|
||||||
|
/// Sets an animation by name. setAnimation(int, Animation, bool)
|
||||||
|
TrackEntry* setAnimation(size_t trackIndex, const String& animationName, bool loop);
|
||||||
|
|
||||||
|
/// Sets the current animation for a track, discarding any queued animations.
|
||||||
|
/// @param loop If true, the animation will repeat.
|
||||||
|
/// If false, it will not, instead its last frame is applied if played beyond its duration.
|
||||||
|
/// In either case TrackEntry.TrackEnd determines when the track is cleared.
|
||||||
|
/// @return
|
||||||
|
/// A track entry to allow further customization of animation playback. References to the track entry must not be kept
|
||||||
|
/// after AnimationState.Dispose.
|
||||||
|
TrackEntry* setAnimation(size_t trackIndex, Animation* animation, bool loop);
|
||||||
|
|
||||||
|
/// Queues an animation by name.
|
||||||
|
/// addAnimation(int, Animation, bool, float)
|
||||||
|
TrackEntry* addAnimation(size_t trackIndex, const String& animationName, bool loop, float delay);
|
||||||
|
|
||||||
|
/// Adds an animation to be played delay seconds after the current or last queued animation
|
||||||
|
/// for a track. If the track is empty, it is equivalent to calling setAnimation.
|
||||||
|
/// @param delay
|
||||||
|
/// Seconds to begin this animation after the start of the previous animation. May be <= 0 to use the animation
|
||||||
|
/// duration of the previous track minus any mix duration plus the negative delay.
|
||||||
|
///
|
||||||
|
/// @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
|
||||||
|
/// after AnimationState.Dispose
|
||||||
|
TrackEntry* addAnimation(size_t trackIndex, Animation* animation, bool loop, float delay);
|
||||||
|
|
||||||
|
/// Sets an empty animation for a track, discarding any queued animations, and mixes to it over the specified mix duration.
|
||||||
|
TrackEntry* setEmptyAnimation(size_t trackIndex, float mixDuration);
|
||||||
|
|
||||||
|
/// Adds an empty animation to be played after the current or last queued animation for a track, and mixes to it over the
|
||||||
|
/// specified mix duration.
|
||||||
|
/// @return
|
||||||
|
/// A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
|
||||||
|
///
|
||||||
|
/// @param trackIndex Track number.
|
||||||
|
/// @param mixDuration Mix duration.
|
||||||
|
/// @param delay Seconds to begin this animation after the start of the previous animation. May be <= 0 to use the animation
|
||||||
|
/// duration of the previous track minus any mix duration plus the negative delay.
|
||||||
|
TrackEntry* addEmptyAnimation(size_t trackIndex, float mixDuration, float delay);
|
||||||
|
|
||||||
|
/// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration.
|
||||||
|
void setEmptyAnimations(float mixDuration);
|
||||||
|
|
||||||
|
/// @return The track entry for the animation currently playing on the track, or NULL if no animation is currently playing.
|
||||||
|
TrackEntry* getCurrent(size_t trackIndex);
|
||||||
|
|
||||||
|
AnimationStateData* getData();
|
||||||
|
|
||||||
|
/// A list of tracks that have animations, which may contain NULLs.
|
||||||
|
Vector<TrackEntry*> &getTracks();
|
||||||
|
|
||||||
|
float getTimeScale();
|
||||||
|
void setTimeScale(float inValue);
|
||||||
|
|
||||||
|
void setListener(AnimationStateListener listener);
|
||||||
|
void setListener(AnimationStateListenerObject* listener);
|
||||||
|
|
||||||
|
void disableQueue();
|
||||||
|
void enableQueue();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const int Subsequent = 0;
|
||||||
|
static const int First = 1;
|
||||||
|
static const int HoldSubsequent = 2;
|
||||||
|
static const int HoldFirst = 3;
|
||||||
|
static const int HoldMix = 4;
|
||||||
|
|
||||||
|
static const int Setup = 1;
|
||||||
|
static const int Current = 2;
|
||||||
|
|
||||||
|
AnimationStateData* _data;
|
||||||
|
|
||||||
|
Pool<TrackEntry> _trackEntryPool;
|
||||||
|
Vector<TrackEntry*> _tracks;
|
||||||
|
Vector<Event*> _events;
|
||||||
|
EventQueue* _queue;
|
||||||
|
|
||||||
|
HashMap<int, bool> _propertyIDs;
|
||||||
|
bool _animationsChanged;
|
||||||
|
|
||||||
|
AnimationStateListener _listener;
|
||||||
|
AnimationStateListenerObject* _listenerObject;
|
||||||
|
|
||||||
|
int _unkeyedState;
|
||||||
|
|
||||||
|
float _timeScale;
|
||||||
|
|
||||||
|
static Animation* getEmptyAnimation();
|
||||||
|
|
||||||
|
static void applyRotateTimeline(RotateTimeline* rotateTimeline, Skeleton& skeleton, float time, float alpha, MixBlend pose, Vector<float>& timelinesRotation, size_t i, bool firstFrame);
|
||||||
|
void applyAttachmentTimeline(AttachmentTimeline* attachmentTimeline, Skeleton& skeleton, float animationTime, MixBlend pose, bool firstFrame);
|
||||||
|
|
||||||
|
/// Returns true when all mixing from entries are complete.
|
||||||
|
bool updateMixingFrom(TrackEntry* to, float delta);
|
||||||
|
|
||||||
|
float applyMixingFrom(TrackEntry* to, Skeleton& skeleton, MixBlend currentPose);
|
||||||
|
|
||||||
|
void queueEvents(TrackEntry* entry, float animationTime);
|
||||||
|
|
||||||
|
/// Sets the active TrackEntry for a given track number.
|
||||||
|
void setCurrent(size_t index, TrackEntry *current, bool interrupt);
|
||||||
|
|
||||||
|
TrackEntry* expandToIndex(size_t index);
|
||||||
|
|
||||||
|
/// Object-pooling version of new TrackEntry. Obtain an unused TrackEntry from the pool and clear/initialize its values.
|
||||||
|
/// @param last May be NULL.
|
||||||
|
TrackEntry* newTrackEntry(size_t trackIndex, Animation *animation, bool loop, TrackEntry *last);
|
||||||
|
|
||||||
|
/// Dispose all track entries queued after the given TrackEntry.
|
||||||
|
void disposeNext(TrackEntry* entry);
|
||||||
|
|
||||||
|
void animationsChanged();
|
||||||
|
|
||||||
|
void computeHold(TrackEntry *entry);
|
||||||
|
|
||||||
|
void setAttachment(Skeleton &skeleton, spine::Slot &slot, const String &attachmentName, bool attachments);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_AnimationState_h */
|
||||||
Vendored
+85
@@ -0,0 +1,85 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_AnimationStateData_h
|
||||||
|
#define Spine_AnimationStateData_h
|
||||||
|
|
||||||
|
#include <spine/HashMap.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SkeletonData;
|
||||||
|
class Animation;
|
||||||
|
|
||||||
|
/// Stores mix (crossfade) durations to be applied when AnimationState animations are changed.
|
||||||
|
class SP_API AnimationStateData : public SpineObject {
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AnimationStateData(SkeletonData* skeletonData);
|
||||||
|
|
||||||
|
/// The SkeletonData to look up animations when they are specified by name.
|
||||||
|
SkeletonData* getSkeletonData();
|
||||||
|
|
||||||
|
/// The mix duration to use when no mix duration has been specifically defined between two animations.
|
||||||
|
float getDefaultMix();
|
||||||
|
void setDefaultMix(float inValue);
|
||||||
|
|
||||||
|
/// Sets a mix duration by animation names.
|
||||||
|
void setMix(const String& fromName, const String& toName, float duration);
|
||||||
|
|
||||||
|
/// Sets a mix duration when changing from the specified animation to the other.
|
||||||
|
/// See TrackEntry.MixDuration.
|
||||||
|
void setMix(Animation* from, Animation* to, float duration);
|
||||||
|
|
||||||
|
/// The mix duration to use when changing from the specified animation to the other,
|
||||||
|
/// or the DefaultMix if no mix duration has been set.
|
||||||
|
float getMix(Animation* from, Animation* to);
|
||||||
|
|
||||||
|
private:
|
||||||
|
class AnimationPair : public SpineObject {
|
||||||
|
public:
|
||||||
|
Animation* _a1;
|
||||||
|
Animation* _a2;
|
||||||
|
|
||||||
|
explicit AnimationPair(Animation* a1 = NULL, Animation* a2 = NULL);
|
||||||
|
|
||||||
|
bool operator==(const AnimationPair &other) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
SkeletonData* _skeletonData;
|
||||||
|
float _defaultMix;
|
||||||
|
HashMap<AnimationPair, float> _animationToMixTime;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_AnimationStateData_h */
|
||||||
+157
@@ -0,0 +1,157 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Atlas_h
|
||||||
|
#define Spine_Atlas_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/Extension.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/HasRendererObject.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum Format {
|
||||||
|
Format_Alpha,
|
||||||
|
Format_Intensity,
|
||||||
|
Format_LuminanceAlpha,
|
||||||
|
Format_RGB565,
|
||||||
|
Format_RGBA4444,
|
||||||
|
Format_RGB888,
|
||||||
|
Format_RGBA8888
|
||||||
|
};
|
||||||
|
|
||||||
|
enum TextureFilter {
|
||||||
|
TextureFilter_Unknown,
|
||||||
|
TextureFilter_Nearest,
|
||||||
|
TextureFilter_Linear,
|
||||||
|
TextureFilter_MipMap,
|
||||||
|
TextureFilter_MipMapNearestNearest,
|
||||||
|
TextureFilter_MipMapLinearNearest,
|
||||||
|
TextureFilter_MipMapNearestLinear,
|
||||||
|
TextureFilter_MipMapLinearLinear
|
||||||
|
};
|
||||||
|
|
||||||
|
enum TextureWrap {
|
||||||
|
TextureWrap_MirroredRepeat,
|
||||||
|
TextureWrap_ClampToEdge,
|
||||||
|
TextureWrap_Repeat
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API AtlasPage : public SpineObject, public HasRendererObject {
|
||||||
|
public:
|
||||||
|
String name;
|
||||||
|
String texturePath;
|
||||||
|
Format format;
|
||||||
|
TextureFilter minFilter;
|
||||||
|
TextureFilter magFilter;
|
||||||
|
TextureWrap uWrap;
|
||||||
|
TextureWrap vWrap;
|
||||||
|
int width, height;
|
||||||
|
|
||||||
|
explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest),
|
||||||
|
magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge),
|
||||||
|
vWrap(TextureWrap_ClampToEdge), width(0), height(0) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API AtlasRegion : public SpineObject {
|
||||||
|
public:
|
||||||
|
AtlasPage *page;
|
||||||
|
String name;
|
||||||
|
int x, y, width, height;
|
||||||
|
float u, v, u2, v2;
|
||||||
|
float offsetX, offsetY;
|
||||||
|
int originalWidth, originalHeight;
|
||||||
|
int index;
|
||||||
|
bool rotate;
|
||||||
|
int degrees;
|
||||||
|
Vector<int> splits;
|
||||||
|
Vector<int> pads;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TextureLoader;
|
||||||
|
|
||||||
|
class SP_API Atlas : public SpineObject {
|
||||||
|
public:
|
||||||
|
Atlas(const String &path, TextureLoader *textureLoader, bool createTexture = true);
|
||||||
|
|
||||||
|
Atlas(const char *data, int length, const char *dir, TextureLoader *textureLoader, bool createTexture = true);
|
||||||
|
|
||||||
|
~Atlas();
|
||||||
|
|
||||||
|
void flipV();
|
||||||
|
|
||||||
|
/// Returns the first region found with the specified name. This method uses String comparison to find the region, so the result
|
||||||
|
/// should be cached rather than calling this method multiple times.
|
||||||
|
/// @return The region, or NULL.
|
||||||
|
AtlasRegion *findRegion(const String &name);
|
||||||
|
|
||||||
|
Vector<AtlasPage*> &getPages();
|
||||||
|
|
||||||
|
Vector<AtlasRegion*> &getRegions();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<AtlasPage *> _pages;
|
||||||
|
Vector<AtlasRegion *> _regions;
|
||||||
|
TextureLoader *_textureLoader;
|
||||||
|
|
||||||
|
void load(const char *begin, int length, const char *dir, bool createTexture);
|
||||||
|
|
||||||
|
class Str {
|
||||||
|
public:
|
||||||
|
const char *begin;
|
||||||
|
const char *end;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void trim(Str *str);
|
||||||
|
|
||||||
|
/// Tokenize string without modification. Returns 0 on failure
|
||||||
|
static int readLine(const char **begin, const char *end, Str *str);
|
||||||
|
|
||||||
|
/// Moves str->begin past the first occurence of c. Returns 0 on failure
|
||||||
|
static int beginPast(Str *str, char c);
|
||||||
|
|
||||||
|
/// Returns 0 on failure
|
||||||
|
static int readValue(const char **begin, const char *end, Str *str);
|
||||||
|
|
||||||
|
/// Returns the number of tuple values read (1, 2, 4, or 0 for failure)
|
||||||
|
static int readTuple(const char **begin, const char *end, Str tuple[]);
|
||||||
|
|
||||||
|
static char *mallocString(Str *str);
|
||||||
|
|
||||||
|
static int indexOf(const char **array, int count, Str *str);
|
||||||
|
|
||||||
|
static int equals(Str *str, const char *other);
|
||||||
|
|
||||||
|
static int toInt(Str *str);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Atlas_h */
|
||||||
DateToSpine/third_party/spine-runtimes/3.8/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h
Vendored
+71
@@ -0,0 +1,71 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_AtlasAttachmentLoader_h
|
||||||
|
#define Spine_AtlasAttachmentLoader_h
|
||||||
|
|
||||||
|
#include <spine/AttachmentLoader.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Atlas;
|
||||||
|
class AtlasRegion;
|
||||||
|
|
||||||
|
/// An AttachmentLoader that configures attachments using texture regions from an Atlas.
|
||||||
|
/// See http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data about Loading Skeleton Data in the Spine Runtimes Guide.
|
||||||
|
class SP_API AtlasAttachmentLoader : public AttachmentLoader {
|
||||||
|
public:
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
explicit AtlasAttachmentLoader(Atlas* atlas);
|
||||||
|
|
||||||
|
virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path);
|
||||||
|
|
||||||
|
virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path);
|
||||||
|
|
||||||
|
virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name);
|
||||||
|
|
||||||
|
virtual PathAttachment* newPathAttachment(Skin& skin, const String& name);
|
||||||
|
|
||||||
|
virtual PointAttachment* newPointAttachment(Skin& skin, const String& name);
|
||||||
|
|
||||||
|
virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name);
|
||||||
|
|
||||||
|
virtual void configureAttachment(Attachment* attachment);
|
||||||
|
|
||||||
|
AtlasRegion* findRegion(const String& name);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Atlas* _atlas;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_AtlasAttachmentLoader_h */
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Attachment_h
|
||||||
|
#define Spine_Attachment_h
|
||||||
|
|
||||||
|
#include <spine/RTTI.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API Attachment : public SpineObject {
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit Attachment(const String &name);
|
||||||
|
|
||||||
|
virtual ~Attachment();
|
||||||
|
|
||||||
|
const String &getName() const;
|
||||||
|
|
||||||
|
virtual Attachment* copy() = 0;
|
||||||
|
|
||||||
|
int getRefCount();
|
||||||
|
void reference();
|
||||||
|
void dereference();
|
||||||
|
|
||||||
|
private:
|
||||||
|
const String _name;
|
||||||
|
int _refCount;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Attachment_h */
|
||||||
Vendored
+75
@@ -0,0 +1,75 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_AttachmentLoader_h
|
||||||
|
#define Spine_AttachmentLoader_h
|
||||||
|
|
||||||
|
#include <spine/RTTI.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Skin;
|
||||||
|
class Attachment;
|
||||||
|
class RegionAttachment;
|
||||||
|
class MeshAttachment;
|
||||||
|
class BoundingBoxAttachment;
|
||||||
|
class PathAttachment;
|
||||||
|
class PointAttachment;
|
||||||
|
class ClippingAttachment;
|
||||||
|
|
||||||
|
class SP_API AttachmentLoader : public SpineObject {
|
||||||
|
public:
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
AttachmentLoader();
|
||||||
|
|
||||||
|
virtual ~AttachmentLoader();
|
||||||
|
|
||||||
|
/// @return May be NULL to not load any attachment.
|
||||||
|
virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path) = 0;
|
||||||
|
|
||||||
|
/// @return May be NULL to not load any attachment.
|
||||||
|
virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path) = 0;
|
||||||
|
|
||||||
|
/// @return May be NULL to not load any attachment.
|
||||||
|
virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name) = 0;
|
||||||
|
|
||||||
|
/// @return May be NULL to not load any attachment
|
||||||
|
virtual PathAttachment* newPathAttachment(Skin& skin, const String& name) = 0;
|
||||||
|
|
||||||
|
virtual PointAttachment* newPointAttachment(Skin& skin, const String& name) = 0;
|
||||||
|
|
||||||
|
virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name) = 0;
|
||||||
|
|
||||||
|
virtual void configureAttachment(Attachment* attachment) = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_AttachmentLoader_h */
|
||||||
Vendored
+76
@@ -0,0 +1,76 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_AttachmentTimeline_h
|
||||||
|
#define Spine_AttachmentTimeline_h
|
||||||
|
|
||||||
|
#include <spine/Timeline.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/MixBlend.h>
|
||||||
|
#include <spine/MixDirection.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
|
||||||
|
class Skeleton;
|
||||||
|
class Slot;
|
||||||
|
class Event;
|
||||||
|
|
||||||
|
class SP_API AttachmentTimeline : public Timeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit AttachmentTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time and value of the specified keyframe.
|
||||||
|
void setFrame(int frameIndex, float time, const String& attachmentName);
|
||||||
|
|
||||||
|
size_t getSlotIndex();
|
||||||
|
void setSlotIndex(size_t inValue);
|
||||||
|
Vector<float>& getFrames();
|
||||||
|
Vector<String>& getAttachmentNames();
|
||||||
|
size_t getFrameCount();
|
||||||
|
private:
|
||||||
|
size_t _slotIndex;
|
||||||
|
Vector<float> _frames;
|
||||||
|
Vector<String> _attachmentNames;
|
||||||
|
|
||||||
|
void setAttachment(Skeleton& skeleton, Slot& slot, String* attachmentName);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_AttachmentTimeline_h */
|
||||||
Vendored
+45
@@ -0,0 +1,45 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_AttachmentType_h
|
||||||
|
#define Spine_AttachmentType_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum AttachmentType {
|
||||||
|
AttachmentType_Region,
|
||||||
|
AttachmentType_Boundingbox,
|
||||||
|
AttachmentType_Mesh,
|
||||||
|
AttachmentType_Linkedmesh,
|
||||||
|
AttachmentType_Path,
|
||||||
|
AttachmentType_Point,
|
||||||
|
AttachmentType_Clipping
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_AttachmentType_h */
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_BlendMode_h
|
||||||
|
#define Spine_BlendMode_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum BlendMode {
|
||||||
|
BlendMode_Normal = 0,
|
||||||
|
BlendMode_Additive,
|
||||||
|
BlendMode_Multiply,
|
||||||
|
BlendMode_Screen
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_BlendMode_h */
|
||||||
+251
@@ -0,0 +1,251 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Bone_h
|
||||||
|
#define Spine_Bone_h
|
||||||
|
|
||||||
|
#include <spine/Updatable.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class BoneData;
|
||||||
|
|
||||||
|
class Skeleton;
|
||||||
|
|
||||||
|
/// Stores a bone's current pose.
|
||||||
|
///
|
||||||
|
/// A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
|
||||||
|
/// local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
|
||||||
|
/// constraint or application code modifies the world transform after it was computed from the local transform.
|
||||||
|
class SP_API Bone : public Updatable {
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
friend class RotateTimeline;
|
||||||
|
|
||||||
|
friend class IkConstraint;
|
||||||
|
|
||||||
|
friend class TransformConstraint;
|
||||||
|
|
||||||
|
friend class VertexAttachment;
|
||||||
|
|
||||||
|
friend class PathConstraint;
|
||||||
|
|
||||||
|
friend class Skeleton;
|
||||||
|
|
||||||
|
friend class RegionAttachment;
|
||||||
|
|
||||||
|
friend class PointAttachment;
|
||||||
|
|
||||||
|
friend class ScaleTimeline;
|
||||||
|
|
||||||
|
friend class ShearTimeline;
|
||||||
|
|
||||||
|
friend class TranslateTimeline;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void setYDown(bool inValue);
|
||||||
|
|
||||||
|
static bool isYDown();
|
||||||
|
|
||||||
|
/// @param parent May be NULL.
|
||||||
|
Bone(BoneData &data, Skeleton &skeleton, Bone *parent = NULL);
|
||||||
|
|
||||||
|
/// Same as updateWorldTransform. This method exists for Bone to implement Spine::Updatable.
|
||||||
|
virtual void update();
|
||||||
|
|
||||||
|
/// Computes the world transform using the parent bone and this bone's local transform.
|
||||||
|
void updateWorldTransform();
|
||||||
|
|
||||||
|
/// Computes the world transform using the parent bone and the specified local transform.
|
||||||
|
void updateWorldTransform(float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY);
|
||||||
|
|
||||||
|
void setToSetupPose();
|
||||||
|
|
||||||
|
void worldToLocal(float worldX, float worldY, float &outLocalX, float &outLocalY);
|
||||||
|
|
||||||
|
void localToWorld(float localX, float localY, float &outWorldX, float &outWorldY);
|
||||||
|
|
||||||
|
float worldToLocalRotation(float worldRotation);
|
||||||
|
|
||||||
|
float localToWorldRotation(float localRotation);
|
||||||
|
|
||||||
|
/// Rotates the world transform the specified amount and sets isAppliedValid to false.
|
||||||
|
/// @param degrees Degrees.
|
||||||
|
void rotateWorld(float degrees);
|
||||||
|
|
||||||
|
float getWorldToLocalRotationX();
|
||||||
|
|
||||||
|
float getWorldToLocalRotationY();
|
||||||
|
|
||||||
|
BoneData &getData();
|
||||||
|
|
||||||
|
Skeleton &getSkeleton();
|
||||||
|
|
||||||
|
Bone *getParent();
|
||||||
|
|
||||||
|
Vector<Bone *> &getChildren();
|
||||||
|
|
||||||
|
/// The local X translation.
|
||||||
|
float getX();
|
||||||
|
|
||||||
|
void setX(float inValue);
|
||||||
|
|
||||||
|
/// The local Y translation.
|
||||||
|
float getY();
|
||||||
|
|
||||||
|
void setY(float inValue);
|
||||||
|
|
||||||
|
/// The local rotation.
|
||||||
|
float getRotation();
|
||||||
|
|
||||||
|
void setRotation(float inValue);
|
||||||
|
|
||||||
|
/// The local scaleX.
|
||||||
|
float getScaleX();
|
||||||
|
|
||||||
|
void setScaleX(float inValue);
|
||||||
|
|
||||||
|
/// The local scaleY.
|
||||||
|
float getScaleY();
|
||||||
|
|
||||||
|
void setScaleY(float inValue);
|
||||||
|
|
||||||
|
/// The local shearX.
|
||||||
|
float getShearX();
|
||||||
|
|
||||||
|
void setShearX(float inValue);
|
||||||
|
|
||||||
|
/// The local shearY.
|
||||||
|
float getShearY();
|
||||||
|
|
||||||
|
void setShearY(float inValue);
|
||||||
|
|
||||||
|
/// The rotation, as calculated by any constraints.
|
||||||
|
float getAppliedRotation();
|
||||||
|
|
||||||
|
void setAppliedRotation(float inValue);
|
||||||
|
|
||||||
|
/// The applied local x translation.
|
||||||
|
float getAX();
|
||||||
|
|
||||||
|
void setAX(float inValue);
|
||||||
|
|
||||||
|
/// The applied local y translation.
|
||||||
|
float getAY();
|
||||||
|
|
||||||
|
void setAY(float inValue);
|
||||||
|
|
||||||
|
/// The applied local scaleX.
|
||||||
|
float getAScaleX();
|
||||||
|
|
||||||
|
void setAScaleX(float inValue);
|
||||||
|
|
||||||
|
/// The applied local scaleY.
|
||||||
|
float getAScaleY();
|
||||||
|
|
||||||
|
void setAScaleY(float inValue);
|
||||||
|
|
||||||
|
/// The applied local shearX.
|
||||||
|
float getAShearX();
|
||||||
|
|
||||||
|
void setAShearX(float inValue);
|
||||||
|
|
||||||
|
/// The applied local shearY.
|
||||||
|
float getAShearY();
|
||||||
|
|
||||||
|
void setAShearY(float inValue);
|
||||||
|
|
||||||
|
float getA();
|
||||||
|
|
||||||
|
void setA(float inValue);
|
||||||
|
|
||||||
|
float getB();
|
||||||
|
|
||||||
|
void setB(float inValue);
|
||||||
|
|
||||||
|
float getC();
|
||||||
|
|
||||||
|
void setC(float inValue);
|
||||||
|
|
||||||
|
float getD();
|
||||||
|
|
||||||
|
void setD(float inValue);
|
||||||
|
|
||||||
|
float getWorldX();
|
||||||
|
|
||||||
|
void setWorldX(float inValue);
|
||||||
|
|
||||||
|
float getWorldY();
|
||||||
|
|
||||||
|
void setWorldY(float inValue);
|
||||||
|
|
||||||
|
float getWorldRotationX();
|
||||||
|
|
||||||
|
float getWorldRotationY();
|
||||||
|
|
||||||
|
/// Returns the magnitide (always positive) of the world scale X.
|
||||||
|
float getWorldScaleX();
|
||||||
|
|
||||||
|
/// Returns the magnitide (always positive) of the world scale Y.
|
||||||
|
float getWorldScaleY();
|
||||||
|
|
||||||
|
bool isAppliedValid();
|
||||||
|
void setAppliedValid(bool valid);
|
||||||
|
|
||||||
|
bool isActive();
|
||||||
|
|
||||||
|
void setActive(bool inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static bool yDown;
|
||||||
|
|
||||||
|
BoneData &_data;
|
||||||
|
Skeleton &_skeleton;
|
||||||
|
Bone *_parent;
|
||||||
|
Vector<Bone *> _children;
|
||||||
|
float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY;
|
||||||
|
float _ax, _ay, _arotation, _ascaleX, _ascaleY, _ashearX, _ashearY;
|
||||||
|
bool _appliedValid;
|
||||||
|
float _a, _b, _worldX;
|
||||||
|
float _c, _d, _worldY;
|
||||||
|
bool _sorted;
|
||||||
|
bool _active;
|
||||||
|
|
||||||
|
/// Computes the individual applied transform values from the world transform. This can be useful to perform processing using
|
||||||
|
/// the applied transform after the world transform has been modified directly (eg, by a constraint)..
|
||||||
|
///
|
||||||
|
/// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation.
|
||||||
|
void updateAppliedTransform();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Bone_h */
|
||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_BoneData_h
|
||||||
|
#define Spine_BoneData_h
|
||||||
|
|
||||||
|
#include <spine/TransformMode.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API BoneData : public SpineObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
friend class RotateTimeline;
|
||||||
|
|
||||||
|
friend class ScaleTimeline;
|
||||||
|
|
||||||
|
friend class ShearTimeline;
|
||||||
|
|
||||||
|
friend class TranslateTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
BoneData(int index, const String &name, BoneData *parent = NULL);
|
||||||
|
|
||||||
|
/// The index of the bone in Skeleton.Bones
|
||||||
|
int getIndex();
|
||||||
|
|
||||||
|
/// The name of the bone, which is unique within the skeleton.
|
||||||
|
const String &getName();
|
||||||
|
|
||||||
|
/// May be NULL.
|
||||||
|
BoneData *getParent();
|
||||||
|
|
||||||
|
float getLength();
|
||||||
|
|
||||||
|
void setLength(float inValue);
|
||||||
|
|
||||||
|
/// Local X translation.
|
||||||
|
float getX();
|
||||||
|
|
||||||
|
void setX(float inValue);
|
||||||
|
|
||||||
|
/// Local Y translation.
|
||||||
|
float getY();
|
||||||
|
|
||||||
|
void setY(float inValue);
|
||||||
|
|
||||||
|
/// Local rotation.
|
||||||
|
float getRotation();
|
||||||
|
|
||||||
|
void setRotation(float inValue);
|
||||||
|
|
||||||
|
/// Local scaleX.
|
||||||
|
float getScaleX();
|
||||||
|
|
||||||
|
void setScaleX(float inValue);
|
||||||
|
|
||||||
|
/// Local scaleY.
|
||||||
|
float getScaleY();
|
||||||
|
|
||||||
|
void setScaleY(float inValue);
|
||||||
|
|
||||||
|
/// Local shearX.
|
||||||
|
float getShearX();
|
||||||
|
|
||||||
|
void setShearX(float inValue);
|
||||||
|
|
||||||
|
/// Local shearY.
|
||||||
|
float getShearY();
|
||||||
|
|
||||||
|
void setShearY(float inValue);
|
||||||
|
|
||||||
|
/// The transform mode for how parent world transforms affect this bone.
|
||||||
|
TransformMode getTransformMode();
|
||||||
|
|
||||||
|
void setTransformMode(TransformMode inValue);
|
||||||
|
|
||||||
|
bool isSkinRequired();
|
||||||
|
void setSkinRequired(bool inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
const int _index;
|
||||||
|
const String _name;
|
||||||
|
BoneData *_parent;
|
||||||
|
float _length;
|
||||||
|
float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY;
|
||||||
|
TransformMode _transformMode;
|
||||||
|
bool _skinRequired;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_BoneData_h */
|
||||||
DateToSpine/third_party/spine-runtimes/3.8/spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h
Vendored
+47
@@ -0,0 +1,47 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_BoundingBoxAttachment_h
|
||||||
|
#define Spine_BoundingBoxAttachment_h
|
||||||
|
|
||||||
|
#include <spine/VertexAttachment.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
/// Attachment that has a polygon for bounds checking.
|
||||||
|
class SP_API BoundingBoxAttachment : public VertexAttachment {
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
explicit BoundingBoxAttachment(const String& name);
|
||||||
|
|
||||||
|
virtual Attachment* copy();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_BoundingBoxAttachment_h */
|
||||||
Vendored
+59
@@ -0,0 +1,59 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_ClippingAttachment_h
|
||||||
|
#define Spine_ClippingAttachment_h
|
||||||
|
|
||||||
|
#include <spine/VertexAttachment.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SlotData;
|
||||||
|
|
||||||
|
class SP_API ClippingAttachment : public VertexAttachment {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class SkeletonClipping;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ClippingAttachment(const String& name);
|
||||||
|
|
||||||
|
SlotData* getEndSlot();
|
||||||
|
void setEndSlot(SlotData* inValue);
|
||||||
|
|
||||||
|
virtual Attachment* copy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
SlotData* _endSlot;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_ClippingAttachment_h */
|
||||||
+94
@@ -0,0 +1,94 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef SPINE_COLOR_H
|
||||||
|
#define SPINE_COLOR_H
|
||||||
|
|
||||||
|
#include <spine/MathUtil.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API Color : public SpineObject {
|
||||||
|
public:
|
||||||
|
Color() : r(0), g(0), b(0), a(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Color(float r, float g, float b, float a) : r(r), g(g), b(b), a(a) {
|
||||||
|
clamp();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Color &set(float _r, float _g, float _b, float _a) {
|
||||||
|
this->r = _r;
|
||||||
|
this->g = _g;
|
||||||
|
this->b = _b;
|
||||||
|
this->a = _a;
|
||||||
|
clamp();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Color &set(const Color &other) {
|
||||||
|
r = other.r;
|
||||||
|
g = other.g;
|
||||||
|
b = other.b;
|
||||||
|
a = other.a;
|
||||||
|
clamp();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Color &add(float _r, float _g, float _b, float _a) {
|
||||||
|
this->r += _r;
|
||||||
|
this->g += _g;
|
||||||
|
this->b += _b;
|
||||||
|
this->a += _a;
|
||||||
|
clamp();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Color &add(const Color &other) {
|
||||||
|
r += other.r;
|
||||||
|
g += other.g;
|
||||||
|
b += other.b;
|
||||||
|
a += other.a;
|
||||||
|
clamp();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Color &clamp() {
|
||||||
|
r = MathUtil::clamp(this->r, 0, 1);
|
||||||
|
g = MathUtil::clamp(this->g, 0, 1);
|
||||||
|
b = MathUtil::clamp(this->b, 0, 1);
|
||||||
|
a = MathUtil::clamp(this->a, 0, 1);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
float r, g, b, a;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif //SPINE_COLOR_H
|
||||||
Vendored
+80
@@ -0,0 +1,80 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_ColorTimeline_h
|
||||||
|
#define Spine_ColorTimeline_h
|
||||||
|
|
||||||
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API ColorTimeline : public CurveTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const int ENTRIES;
|
||||||
|
|
||||||
|
explicit ColorTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha, MixBlend blend,
|
||||||
|
MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time and value of the specified keyframe.
|
||||||
|
void setFrame(int frameIndex, float time, float r, float g, float b, float a);
|
||||||
|
|
||||||
|
int getSlotIndex();
|
||||||
|
|
||||||
|
void setSlotIndex(int inValue);
|
||||||
|
|
||||||
|
Vector<float> &getFrames();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static const int PREV_TIME;
|
||||||
|
static const int PREV_R;
|
||||||
|
static const int PREV_G;
|
||||||
|
static const int PREV_B;
|
||||||
|
static const int PREV_A;
|
||||||
|
static const int R;
|
||||||
|
static const int G;
|
||||||
|
static const int B;
|
||||||
|
static const int A;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int _slotIndex;
|
||||||
|
Vector<float> _frames;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_ColorTimeline_h */
|
||||||
Vendored
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Constraint_h
|
||||||
|
#define Spine_Constraint_h
|
||||||
|
|
||||||
|
#include <spine/Updatable.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
/// The interface for all constraints.
|
||||||
|
class SP_API ConstraintData : public SpineObject {
|
||||||
|
|
||||||
|
public:
|
||||||
|
ConstraintData(const String& name);
|
||||||
|
|
||||||
|
virtual ~ConstraintData();
|
||||||
|
|
||||||
|
/// The IK constraint's name, which is unique within the skeleton.
|
||||||
|
const String& getName();
|
||||||
|
|
||||||
|
/// The ordinal for the order a skeleton's constraints will be applied.
|
||||||
|
size_t getOrder();
|
||||||
|
void setOrder(size_t inValue);
|
||||||
|
|
||||||
|
/// Whether the constraint is only active for a specific skin.
|
||||||
|
bool isSkinRequired();
|
||||||
|
void setSkinRequired(bool inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
const String _name;
|
||||||
|
size_t _order;
|
||||||
|
bool _skinRequired;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Constraint_h */
|
||||||
Vendored
+127
@@ -0,0 +1,127 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_ContainerUtil_h
|
||||||
|
#define Spine_ContainerUtil_h
|
||||||
|
|
||||||
|
#include <spine/Extension.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/HashMap.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API ContainerUtil : public SpineObject {
|
||||||
|
public:
|
||||||
|
/// Finds an item by comparing each item's name.
|
||||||
|
/// It is more efficient to cache the results of this method than to call it multiple times.
|
||||||
|
/// @return May be NULL.
|
||||||
|
template<typename T>
|
||||||
|
static T* findWithName(Vector<T*>& items, const String& name) {
|
||||||
|
assert(name.length() > 0);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < items.size(); ++i) {
|
||||||
|
T* item = items[i];
|
||||||
|
if (item->getName() == name) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @return -1 if the item was not found.
|
||||||
|
template<typename T>
|
||||||
|
static int findIndexWithName(Vector<T*>& items, const String& name) {
|
||||||
|
assert(name.length() > 0);
|
||||||
|
|
||||||
|
for (size_t i = 0, len = items.size(); i < len; ++i) {
|
||||||
|
T* item = items[i];
|
||||||
|
if (item->getName() == name) {
|
||||||
|
return static_cast<int>(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Finds an item by comparing each item's name.
|
||||||
|
/// It is more efficient to cache the results of this method than to call it multiple times.
|
||||||
|
/// @return May be NULL.
|
||||||
|
template<typename T>
|
||||||
|
static T* findWithDataName(Vector<T*>& items, const String& name) {
|
||||||
|
assert(name.length() > 0);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < items.size(); ++i) {
|
||||||
|
T* item = items[i];
|
||||||
|
if (item->getData().getName() == name) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @return -1 if the item was not found.
|
||||||
|
template<typename T>
|
||||||
|
static int findIndexWithDataName(Vector<T*>& items, const String& name) {
|
||||||
|
assert(name.length() > 0);
|
||||||
|
|
||||||
|
for (size_t i = 0, len = items.size(); i < len; ++i) {
|
||||||
|
T* item = items[i];
|
||||||
|
if (item->getData().getName() == name) {
|
||||||
|
return static_cast<int>(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static void cleanUpVectorOfPointers(Vector<T*>& items) {
|
||||||
|
for (int i = (int)items.size() - 1; i >= 0; i--) {
|
||||||
|
T* item = items[i];
|
||||||
|
|
||||||
|
delete item;
|
||||||
|
|
||||||
|
items.removeAt(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// ctor, copy ctor, and assignment should be private in a Singleton
|
||||||
|
ContainerUtil();
|
||||||
|
ContainerUtil(const ContainerUtil&);
|
||||||
|
ContainerUtil& operator=(const ContainerUtil&);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_ContainerUtil_h */
|
||||||
Vendored
+76
@@ -0,0 +1,76 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_CurveTimeline_h
|
||||||
|
#define Spine_CurveTimeline_h
|
||||||
|
|
||||||
|
#include <spine/Timeline.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
/// Base class for frames that use an interpolation bezier curve.
|
||||||
|
class SP_API CurveTimeline : public Timeline {
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit CurveTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual ~CurveTimeline();
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction) = 0;
|
||||||
|
|
||||||
|
virtual int getPropertyId() = 0;
|
||||||
|
|
||||||
|
size_t getFrameCount();
|
||||||
|
|
||||||
|
void setLinear(size_t frameIndex);
|
||||||
|
|
||||||
|
void setStepped(size_t frameIndex);
|
||||||
|
|
||||||
|
/// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.
|
||||||
|
/// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of
|
||||||
|
/// the difference between the keyframe's values.
|
||||||
|
void setCurve(size_t frameIndex, float cx1, float cy1, float cx2, float cy2);
|
||||||
|
|
||||||
|
float getCurvePercent(size_t frameIndex, float percent);
|
||||||
|
|
||||||
|
float getCurveType(size_t frameIndex);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static const float LINEAR;
|
||||||
|
static const float STEPPED;
|
||||||
|
static const float BEZIER;
|
||||||
|
static const int BEZIER_SIZE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<float> _curves; // type, x, y, ...
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_CurveTimeline_h */
|
||||||
+127
@@ -0,0 +1,127 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef SPINE_DEBUG_H
|
||||||
|
#define SPINE_DEBUG_H
|
||||||
|
|
||||||
|
#include <spine/Extension.h>
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API DebugExtension : public SpineExtension {
|
||||||
|
struct Allocation {
|
||||||
|
void *address;
|
||||||
|
size_t size;
|
||||||
|
const char *fileName;
|
||||||
|
int line;
|
||||||
|
|
||||||
|
Allocation() : address(NULL), size(0), fileName(NULL), line(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Allocation(void *a, size_t s, const char *f, int l) : address(a), size(s), fileName(f), line(l) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
DebugExtension(SpineExtension* extension): _extension(extension), _allocations(0), _reallocations(0), _frees(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void reportLeaks() {
|
||||||
|
for (std::map<void*, Allocation>::iterator it = _allocated.begin(); it != _allocated.end(); it++) {
|
||||||
|
printf("\"%s:%i (%zu bytes at %p)\n", it->second.fileName, it->second.line, it->second.size, it->second.address);
|
||||||
|
}
|
||||||
|
printf("allocations: %zu, reallocations: %zu, frees: %zu\n", _allocations, _reallocations, _frees);
|
||||||
|
if (_allocated.empty()) printf("No leaks detected");
|
||||||
|
}
|
||||||
|
|
||||||
|
void clearAllocations() {
|
||||||
|
_allocated.clear();
|
||||||
|
_usedMemory = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void *_alloc(size_t size, const char *file, int line) {
|
||||||
|
void *result = _extension->_alloc(size, file, line);
|
||||||
|
_allocated[result] = Allocation(result, size, file, line);
|
||||||
|
_allocations++;
|
||||||
|
_usedMemory += size;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void *_calloc(size_t size, const char *file, int line) {
|
||||||
|
void *result = _extension->_calloc(size, file, line);
|
||||||
|
_allocated[result] = Allocation(result, size, file, line);
|
||||||
|
_allocations++;
|
||||||
|
_usedMemory += size;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void *_realloc(void *ptr, size_t size, const char *file, int line) {
|
||||||
|
if (_allocated.count(ptr)) _usedMemory -= _allocated[ptr].size;
|
||||||
|
_allocated.erase(ptr);
|
||||||
|
void *result = _extension->_realloc(ptr, size, file, line);
|
||||||
|
_reallocations++;
|
||||||
|
_allocated[result] = Allocation(result, size, file, line);
|
||||||
|
_usedMemory += size;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void _free(void *mem, const char *file, int line) {
|
||||||
|
if (_allocated.count(mem)) {
|
||||||
|
_extension->_free(mem, file, line);
|
||||||
|
_frees++;
|
||||||
|
_usedMemory -= _allocated[mem].size;
|
||||||
|
_allocated.erase(mem);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%s:%i (address %p): Double free or not allocated through SpineExtension\n", file, line, mem);
|
||||||
|
_extension->_free(mem, file, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual char *_readFile(const String &path, int *length) {
|
||||||
|
return _extension->_readFile(path, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t getUsedMemory() {
|
||||||
|
return _usedMemory;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
SpineExtension* _extension;
|
||||||
|
std::map<void*, Allocation> _allocated;
|
||||||
|
size_t _allocations;
|
||||||
|
size_t _reallocations;
|
||||||
|
size_t _frees;
|
||||||
|
size_t _usedMemory;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif //SPINE_DEBUG_H
|
||||||
Vendored
+69
@@ -0,0 +1,69 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_DeformTimeline_h
|
||||||
|
#define Spine_DeformTimeline_h
|
||||||
|
|
||||||
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class VertexAttachment;
|
||||||
|
|
||||||
|
class SP_API DeformTimeline : public CurveTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DeformTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time and value of the specified keyframe.
|
||||||
|
void setFrame(int frameIndex, float time, Vector<float>& vertices);
|
||||||
|
|
||||||
|
int getSlotIndex();
|
||||||
|
void setSlotIndex(int inValue);
|
||||||
|
Vector<float>& getFrames();
|
||||||
|
Vector< Vector<float> >& getVertices();
|
||||||
|
VertexAttachment* getAttachment();
|
||||||
|
void setAttachment(VertexAttachment* inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int _slotIndex;
|
||||||
|
Vector<float> _frames;
|
||||||
|
Vector< Vector<float> > _frameVertices;
|
||||||
|
VertexAttachment* _attachment;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_DeformTimeline_h */
|
||||||
Vendored
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_DrawOrderTimeline_h
|
||||||
|
#define Spine_DrawOrderTimeline_h
|
||||||
|
|
||||||
|
#include <spine/Timeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API DrawOrderTimeline : public Timeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit DrawOrderTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time and value of the specified keyframe.
|
||||||
|
/// @param drawOrder May be NULL to use bind pose draw order
|
||||||
|
void setFrame(size_t frameIndex, float time, Vector<int>& drawOrder);
|
||||||
|
|
||||||
|
Vector<float>& getFrames();
|
||||||
|
Vector< Vector<int> >& getDrawOrders();
|
||||||
|
size_t getFrameCount();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<float> _frames;
|
||||||
|
Vector< Vector<int> > _drawOrders;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_DrawOrderTimeline_h */
|
||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Event_h
|
||||||
|
#define Spine_Event_h
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class EventData;
|
||||||
|
|
||||||
|
/// Stores the current pose values for an Event.
|
||||||
|
class SP_API Event : public SpineObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Event(float time, const EventData &data);
|
||||||
|
|
||||||
|
const EventData &getData();
|
||||||
|
|
||||||
|
/// The animation time this event was keyed.
|
||||||
|
float getTime();
|
||||||
|
|
||||||
|
int getIntValue();
|
||||||
|
|
||||||
|
void setIntValue(int inValue);
|
||||||
|
|
||||||
|
float getFloatValue();
|
||||||
|
|
||||||
|
void setFloatValue(float inValue);
|
||||||
|
|
||||||
|
const String &getStringValue();
|
||||||
|
|
||||||
|
void setStringValue(const String &inValue);
|
||||||
|
|
||||||
|
float getVolume();
|
||||||
|
|
||||||
|
void setVolume(float inValue);
|
||||||
|
|
||||||
|
float getBalance();
|
||||||
|
|
||||||
|
void setBalance(float inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
const EventData &_data;
|
||||||
|
const float _time;
|
||||||
|
int _intValue;
|
||||||
|
float _floatValue;
|
||||||
|
String _stringValue;
|
||||||
|
float _volume;
|
||||||
|
float _balance;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Event_h */
|
||||||
+86
@@ -0,0 +1,86 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_EventData_h
|
||||||
|
#define Spine_EventData_h
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
/// Stores the setup pose values for an Event.
|
||||||
|
class SP_API EventData : public SpineObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class Event;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit EventData(const String &name);
|
||||||
|
|
||||||
|
/// The name of the event, which is unique within the skeleton.
|
||||||
|
const String &getName() const;
|
||||||
|
|
||||||
|
int getIntValue() const;
|
||||||
|
|
||||||
|
void setIntValue(int inValue);
|
||||||
|
|
||||||
|
float getFloatValue() const;
|
||||||
|
|
||||||
|
void setFloatValue(float inValue);
|
||||||
|
|
||||||
|
const String &getStringValue() const;
|
||||||
|
|
||||||
|
void setStringValue(const String &inValue);
|
||||||
|
|
||||||
|
const String &getAudioPath() const;
|
||||||
|
|
||||||
|
void setAudioPath(const String &inValue);
|
||||||
|
|
||||||
|
float getVolume() const;
|
||||||
|
|
||||||
|
void setVolume(float inValue);
|
||||||
|
|
||||||
|
float getBalance() const;
|
||||||
|
|
||||||
|
void setBalance(float inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
const String _name;
|
||||||
|
int _intValue;
|
||||||
|
float _floatValue;
|
||||||
|
String _stringValue;
|
||||||
|
String _audioPath;
|
||||||
|
float _volume;
|
||||||
|
float _balance;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_EventData_h */
|
||||||
Vendored
+64
@@ -0,0 +1,64 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_EventTimeline_h
|
||||||
|
#define Spine_EventTimeline_h
|
||||||
|
|
||||||
|
#include <spine/Timeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API EventTimeline : public Timeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit EventTimeline(int frameCount);
|
||||||
|
|
||||||
|
~EventTimeline();
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time and value of the specified keyframe.
|
||||||
|
void setFrame(size_t frameIndex, Event* event);
|
||||||
|
|
||||||
|
const Vector<float>& getFrames();
|
||||||
|
Vector<Event*>& getEvents();
|
||||||
|
size_t getFrameCount();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<float> _frames;
|
||||||
|
Vector<Event*> _events;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_EventTimeline_h */
|
||||||
+125
@@ -0,0 +1,125 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Extension_h
|
||||||
|
#define Spine_Extension_h
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <spine/dll.h>
|
||||||
|
|
||||||
|
#define SP_UNUSED(x) (void)(x)
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class String;
|
||||||
|
|
||||||
|
class SP_API SpineExtension {
|
||||||
|
public:
|
||||||
|
template<typename T>
|
||||||
|
static T *alloc(size_t num, const char *file, int line) {
|
||||||
|
return (T *) getInstance()->_alloc(sizeof(T) * num, file, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static T *calloc(size_t num, const char *file, int line) {
|
||||||
|
return (T *) getInstance()->_calloc(sizeof(T) * num, file, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static T *realloc(T *ptr, size_t num, const char *file, int line) {
|
||||||
|
return (T *) getInstance()->_realloc(ptr, sizeof(T) * num, file, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static void free(T *ptr, const char *file, int line) {
|
||||||
|
getInstance()->_free((void *) ptr, file, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static void beforeFree(T *ptr) {
|
||||||
|
getInstance()->_beforeFree((void *) ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *readFile(const String &path, int *length) {
|
||||||
|
return getInstance()->_readFile(path, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setInstance(SpineExtension *inSpineExtension);
|
||||||
|
|
||||||
|
static SpineExtension *getInstance();
|
||||||
|
|
||||||
|
virtual ~SpineExtension();
|
||||||
|
|
||||||
|
/// Implement this function to use your own memory allocator
|
||||||
|
virtual void *_alloc(size_t size, const char *file, int line) = 0;
|
||||||
|
|
||||||
|
virtual void *_calloc(size_t size, const char *file, int line) = 0;
|
||||||
|
|
||||||
|
virtual void *_realloc(void *ptr, size_t size, const char *file, int line) = 0;
|
||||||
|
|
||||||
|
/// If you provide a spineAllocFunc, you should also provide a spineFreeFunc
|
||||||
|
virtual void _free(void *mem, const char *file, int line) = 0;
|
||||||
|
|
||||||
|
virtual char *_readFile(const String &path, int *length) = 0;
|
||||||
|
|
||||||
|
virtual void _beforeFree(void *ptr) { SP_UNUSED(ptr); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
SpineExtension();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static SpineExtension *_instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API DefaultSpineExtension : public SpineExtension {
|
||||||
|
public:
|
||||||
|
DefaultSpineExtension();
|
||||||
|
|
||||||
|
virtual ~DefaultSpineExtension();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void *_alloc(size_t size, const char *file, int line);
|
||||||
|
|
||||||
|
virtual void *_calloc(size_t size, const char *file, int line);
|
||||||
|
|
||||||
|
virtual void *_realloc(void *ptr, size_t size, const char *file, int line);
|
||||||
|
|
||||||
|
virtual void _free(void *mem, const char *file, int line);
|
||||||
|
|
||||||
|
virtual char *_readFile(const String &path, int *length);
|
||||||
|
};
|
||||||
|
|
||||||
|
// This function is to be implemented by engine specific runtimes to provide
|
||||||
|
// the default extension for that engine. It is called the first time
|
||||||
|
// SpineExtension::getInstance() is called, when no instance has been set
|
||||||
|
// yet.
|
||||||
|
extern SpineExtension *getDefaultExtension();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Extension_h */
|
||||||
Vendored
+61
@@ -0,0 +1,61 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_HasRendererObject_h
|
||||||
|
#define Spine_HasRendererObject_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
|
||||||
|
typedef void (*DisposeRendererObject) (void* rendererObject);
|
||||||
|
|
||||||
|
class SP_API HasRendererObject {
|
||||||
|
public:
|
||||||
|
explicit HasRendererObject() : _rendererObject(NULL), _dispose(NULL) {};
|
||||||
|
|
||||||
|
virtual ~HasRendererObject() {
|
||||||
|
if (_dispose && _rendererObject)
|
||||||
|
_dispose(_rendererObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* getRendererObject() { return _rendererObject; }
|
||||||
|
void setRendererObject(void* rendererObject, DisposeRendererObject dispose = NULL) {
|
||||||
|
if (_dispose && _rendererObject && _rendererObject != rendererObject)
|
||||||
|
_dispose(_rendererObject);
|
||||||
|
|
||||||
|
_rendererObject = rendererObject;
|
||||||
|
_dispose = dispose;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
void *_rendererObject;
|
||||||
|
DisposeRendererObject _dispose;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
Vendored
Executable
+190
@@ -0,0 +1,190 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_HashMap_h
|
||||||
|
#define Spine_HashMap_h
|
||||||
|
|
||||||
|
#include <spine/Extension.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
// Required for new with line number and file name in MSVC
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4291)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
template<typename K, typename V>
|
||||||
|
class SP_API HashMap : public SpineObject {
|
||||||
|
private:
|
||||||
|
class Entry;
|
||||||
|
|
||||||
|
public:
|
||||||
|
class SP_API Pair {
|
||||||
|
public:
|
||||||
|
explicit Pair(K &k, V &v) : key(k), value(v) {}
|
||||||
|
|
||||||
|
K &key;
|
||||||
|
V &value;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API Entries {
|
||||||
|
public:
|
||||||
|
friend class HashMap;
|
||||||
|
|
||||||
|
explicit Entries(Entry *entry) : _entry(NULL), _hasChecked(false) {
|
||||||
|
_start.next = entry;
|
||||||
|
_entry = &_start;
|
||||||
|
}
|
||||||
|
|
||||||
|
Pair next() {
|
||||||
|
assert(_entry);
|
||||||
|
assert(_hasChecked);
|
||||||
|
_entry = _entry->next;
|
||||||
|
Pair pair(_entry->_key, _entry->_value);
|
||||||
|
_hasChecked = false;
|
||||||
|
return pair;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool hasNext() {
|
||||||
|
_hasChecked = true;
|
||||||
|
return _entry->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool _hasChecked;
|
||||||
|
Entry _start;
|
||||||
|
Entry *_entry;
|
||||||
|
};
|
||||||
|
|
||||||
|
HashMap() :
|
||||||
|
_head(NULL),
|
||||||
|
_size(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
~HashMap() {
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear() {
|
||||||
|
for (Entry *entry = _head; entry != NULL;) {
|
||||||
|
Entry* next = entry->next;
|
||||||
|
delete entry;
|
||||||
|
entry = next;
|
||||||
|
}
|
||||||
|
_head = NULL;
|
||||||
|
_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t size() {
|
||||||
|
return _size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void put(const K &key, const V &value) {
|
||||||
|
Entry *entry = find(key);
|
||||||
|
if (entry) {
|
||||||
|
entry->_key = key;
|
||||||
|
entry->_value = value;
|
||||||
|
} else {
|
||||||
|
entry = new(__FILE__, __LINE__) Entry();
|
||||||
|
entry->_key = key;
|
||||||
|
entry->_value = value;
|
||||||
|
|
||||||
|
Entry *oldHead = _head;
|
||||||
|
|
||||||
|
if (oldHead) {
|
||||||
|
_head = entry;
|
||||||
|
oldHead->prev = entry;
|
||||||
|
entry->next = oldHead;
|
||||||
|
} else {
|
||||||
|
_head = entry;
|
||||||
|
}
|
||||||
|
_size++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool containsKey(const K &key) {
|
||||||
|
return find(key) != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool remove(const K &key) {
|
||||||
|
Entry *entry = find(key);
|
||||||
|
if (!entry) return false;
|
||||||
|
|
||||||
|
Entry *prev = entry->prev;
|
||||||
|
Entry *next = entry->next;
|
||||||
|
|
||||||
|
if (prev) prev->next = next;
|
||||||
|
else _head = next;
|
||||||
|
if (next) next->prev = entry->prev;
|
||||||
|
|
||||||
|
delete entry;
|
||||||
|
_size--;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
V operator[](const K &key) {
|
||||||
|
Entry *entry = find(key);
|
||||||
|
if (entry) return entry->_value;
|
||||||
|
else {
|
||||||
|
assert(false);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Entries getEntries() const {
|
||||||
|
return Entries(_head);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Entry *find(const K &key) {
|
||||||
|
for (Entry *entry = _head; entry != NULL; entry = entry->next) {
|
||||||
|
if (entry->_key == key)
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SP_API Entry : public SpineObject {
|
||||||
|
public:
|
||||||
|
K _key;
|
||||||
|
V _value;
|
||||||
|
Entry *next;
|
||||||
|
Entry *prev;
|
||||||
|
|
||||||
|
Entry() : next(NULL), prev(NULL) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
Entry *_head;
|
||||||
|
size_t _size;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_HashMap_h */
|
||||||
Vendored
+115
@@ -0,0 +1,115 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_IkConstraint_h
|
||||||
|
#define Spine_IkConstraint_h
|
||||||
|
|
||||||
|
#include <spine/ConstraintData.h>
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class IkConstraintData;
|
||||||
|
|
||||||
|
class Skeleton;
|
||||||
|
|
||||||
|
class Bone;
|
||||||
|
|
||||||
|
class SP_API IkConstraint : public Updatable {
|
||||||
|
friend class Skeleton;
|
||||||
|
|
||||||
|
friend class IkConstraintTimeline;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified
|
||||||
|
/// in the world coordinate system.
|
||||||
|
static void apply(Bone &bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float alpha);
|
||||||
|
|
||||||
|
/// Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as
|
||||||
|
/// possible. The target is specified in the world coordinate system.
|
||||||
|
/// @param child A direct descendant of the parent bone.
|
||||||
|
static void apply(Bone &parent, Bone &child, float targetX, float targetY, int bendDir, bool stretch, float softness, float alpha);
|
||||||
|
|
||||||
|
IkConstraint(IkConstraintData &data, Skeleton &skeleton);
|
||||||
|
|
||||||
|
/// Applies the constraint to the constrained bones.
|
||||||
|
void apply();
|
||||||
|
|
||||||
|
virtual void update();
|
||||||
|
|
||||||
|
virtual int getOrder();
|
||||||
|
|
||||||
|
IkConstraintData &getData();
|
||||||
|
|
||||||
|
Vector<Bone *> &getBones();
|
||||||
|
|
||||||
|
Bone *getTarget();
|
||||||
|
|
||||||
|
void setTarget(Bone *inValue);
|
||||||
|
|
||||||
|
int getBendDirection();
|
||||||
|
|
||||||
|
void setBendDirection(int inValue);
|
||||||
|
|
||||||
|
bool getCompress();
|
||||||
|
|
||||||
|
void setCompress(bool inValue);
|
||||||
|
|
||||||
|
bool getStretch();
|
||||||
|
|
||||||
|
void setStretch(bool inValue);
|
||||||
|
|
||||||
|
float getMix();
|
||||||
|
|
||||||
|
void setMix(float inValue);
|
||||||
|
|
||||||
|
float getSoftness();
|
||||||
|
|
||||||
|
void setSoftness(float inValue);
|
||||||
|
|
||||||
|
bool isActive();
|
||||||
|
|
||||||
|
void setActive(bool inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
IkConstraintData &_data;
|
||||||
|
Vector<Bone *> _bones;
|
||||||
|
int _bendDirection;
|
||||||
|
bool _compress;
|
||||||
|
bool _stretch;
|
||||||
|
float _mix;
|
||||||
|
float _softness;
|
||||||
|
Bone *_target;
|
||||||
|
bool _active;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_IkConstraint_h */
|
||||||
Vendored
+89
@@ -0,0 +1,89 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_IkConstraintData_h
|
||||||
|
#define Spine_IkConstraintData_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/ConstraintData.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class BoneData;
|
||||||
|
|
||||||
|
class SP_API IkConstraintData : public ConstraintData {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
friend class IkConstraint;
|
||||||
|
friend class Skeleton;
|
||||||
|
friend class IkConstraintTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit IkConstraintData(const String& name);
|
||||||
|
|
||||||
|
/// The bones that are constrained by this IK Constraint.
|
||||||
|
Vector<BoneData*>& getBones();
|
||||||
|
|
||||||
|
/// The bone that is the IK target.
|
||||||
|
BoneData* getTarget();
|
||||||
|
void setTarget(BoneData* inValue);
|
||||||
|
|
||||||
|
/// Controls the bend direction of the IK bones, either 1 or -1.
|
||||||
|
int getBendDirection();
|
||||||
|
void setBendDirection(int inValue);
|
||||||
|
|
||||||
|
bool getCompress();
|
||||||
|
void setCompress(bool inValue);
|
||||||
|
|
||||||
|
bool getStretch();
|
||||||
|
void setStretch(bool inValue);
|
||||||
|
|
||||||
|
bool getUniform();
|
||||||
|
void setUniform(bool inValue);
|
||||||
|
|
||||||
|
float getMix();
|
||||||
|
void setMix(float inValue);
|
||||||
|
|
||||||
|
float getSoftness();
|
||||||
|
void setSoftness(float inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<BoneData*> _bones;
|
||||||
|
BoneData* _target;
|
||||||
|
int _bendDirection;
|
||||||
|
bool _compress;
|
||||||
|
bool _stretch;
|
||||||
|
bool _uniform;
|
||||||
|
float _mix;
|
||||||
|
float _softness;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_IkConstraintData_h */
|
||||||
Vendored
+73
@@ -0,0 +1,73 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_IkConstraintTimeline_h
|
||||||
|
#define Spine_IkConstraintTimeline_h
|
||||||
|
|
||||||
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
|
||||||
|
class SP_API IkConstraintTimeline : public CurveTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const int ENTRIES;
|
||||||
|
|
||||||
|
explicit IkConstraintTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time, mix and bend direction of the specified keyframe.
|
||||||
|
void setFrame (int frameIndex, float time, float mix, float softness, int bendDirection, bool compress, bool stretch);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const int PREV_TIME;
|
||||||
|
static const int PREV_MIX;
|
||||||
|
static const int PREV_SOFTNESS;
|
||||||
|
static const int PREV_BEND_DIRECTION;
|
||||||
|
static const int PREV_COMPRESS;
|
||||||
|
static const int PREV_STRETCH;
|
||||||
|
static const int MIX;
|
||||||
|
static const int SOFTNESS;
|
||||||
|
static const int BEND_DIRECTION;
|
||||||
|
static const int COMPRESS;
|
||||||
|
static const int STRETCH;
|
||||||
|
|
||||||
|
Vector<float> _frames;
|
||||||
|
int _ikConstraintIndex;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_IkConstraintTimeline_h */
|
||||||
+115
@@ -0,0 +1,115 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Json_h
|
||||||
|
#define Spine_Json_h
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
#ifndef SPINE_JSON_HAVE_PREV
|
||||||
|
/* spine doesn't use the "prev" link in the Json sibling lists. */
|
||||||
|
#define SPINE_JSON_HAVE_PREV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API Json : public SpineObject {
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/* Json Types: */
|
||||||
|
static const int JSON_FALSE;
|
||||||
|
static const int JSON_TRUE;
|
||||||
|
static const int JSON_NULL;
|
||||||
|
static const int JSON_NUMBER;
|
||||||
|
static const int JSON_STRING;
|
||||||
|
static const int JSON_ARRAY;
|
||||||
|
static const int JSON_OBJECT;
|
||||||
|
|
||||||
|
/* Get item "string" from object. Case insensitive. */
|
||||||
|
static Json *getItem(Json *object, const char *string);
|
||||||
|
|
||||||
|
static const char *getString(Json *object, const char *name, const char *defaultValue);
|
||||||
|
|
||||||
|
static float getFloat(Json *object, const char *name, float defaultValue);
|
||||||
|
|
||||||
|
static int getInt(Json *object, const char *name, int defaultValue);
|
||||||
|
|
||||||
|
static bool getBoolean(Json *object, const char *name, bool defaultValue);
|
||||||
|
|
||||||
|
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */
|
||||||
|
static const char *getError();
|
||||||
|
|
||||||
|
/* Supply a block of JSON, and this returns a Json object you can interrogate. Call Json_dispose when finished. */
|
||||||
|
explicit Json(const char *value);
|
||||||
|
|
||||||
|
~Json();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const char *_error;
|
||||||
|
|
||||||
|
Json *_next;
|
||||||
|
#if SPINE_JSON_HAVE_PREV
|
||||||
|
Json* _prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */
|
||||||
|
#endif
|
||||||
|
Json *_child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
|
||||||
|
|
||||||
|
int _type; /* The type of the item, as above. */
|
||||||
|
int _size; /* The number of children. */
|
||||||
|
|
||||||
|
const char *_valueString; /* The item's string, if type==JSON_STRING */
|
||||||
|
int _valueInt; /* The item's number, if type==JSON_NUMBER */
|
||||||
|
float _valueFloat; /* The item's number, if type==JSON_NUMBER */
|
||||||
|
|
||||||
|
const char *_name; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
|
||||||
|
|
||||||
|
/* Utility to jump whitespace and cr/lf */
|
||||||
|
static const char *skip(const char *inValue);
|
||||||
|
|
||||||
|
/* Parser core - when encountering text, process appropriately. */
|
||||||
|
static const char *parseValue(Json *item, const char *value);
|
||||||
|
|
||||||
|
/* Parse the input text into an unescaped cstring, and populate item. */
|
||||||
|
static const char *parseString(Json *item, const char *str);
|
||||||
|
|
||||||
|
/* Parse the input text to generate a number, and populate the result into item. */
|
||||||
|
static const char *parseNumber(Json *item, const char *num);
|
||||||
|
|
||||||
|
/* Build an array from input text. */
|
||||||
|
static const char *parseArray(Json *item, const char *value);
|
||||||
|
|
||||||
|
/* Build an object from the text. */
|
||||||
|
static const char *parseObject(Json *item, const char *value);
|
||||||
|
|
||||||
|
static int json_strcasecmp(const char *s1, const char *s2);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Json_h */
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_LinkedMesh_h
|
||||||
|
#define Spine_LinkedMesh_h
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class MeshAttachment;
|
||||||
|
|
||||||
|
class SP_API LinkedMesh : public SpineObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
public:
|
||||||
|
LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent, bool inheritDeform);
|
||||||
|
|
||||||
|
private:
|
||||||
|
MeshAttachment *_mesh;
|
||||||
|
String _skin;
|
||||||
|
size_t _slotIndex;
|
||||||
|
String _parent;
|
||||||
|
bool _inheritDeform;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_LinkedMesh_h */
|
||||||
+129
@@ -0,0 +1,129 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_MathUtil_h
|
||||||
|
#define Spine_MathUtil_h
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
|
||||||
|
class SP_API MathUtil : public SpineObject {
|
||||||
|
private:
|
||||||
|
MathUtil();
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const float Pi;
|
||||||
|
static const float Pi_2;
|
||||||
|
static const float Deg_Rad;
|
||||||
|
static const float Rad_Deg;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static inline T min(T a, T b) { return a < b ? a : b; }
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static inline T max(T a, T b) { return a > b ? a : b; }
|
||||||
|
|
||||||
|
static float sign(float val);
|
||||||
|
|
||||||
|
static float clamp(float x, float lower, float upper);
|
||||||
|
|
||||||
|
static float abs(float v);
|
||||||
|
|
||||||
|
/// Returns the sine in radians from a lookup table.
|
||||||
|
static float sin(float radians);
|
||||||
|
|
||||||
|
/// Returns the cosine in radians from a lookup table.
|
||||||
|
static float cos(float radians);
|
||||||
|
|
||||||
|
/// Returns the sine in radians from a lookup table.
|
||||||
|
static float sinDeg(float degrees);
|
||||||
|
|
||||||
|
/// Returns the cosine in radians from a lookup table.
|
||||||
|
static float cosDeg(float degrees);
|
||||||
|
|
||||||
|
/// Returns atan2 in radians, faster but less accurate than Math.Atan2. Average error of 0.00231 radians (0.1323
|
||||||
|
/// degrees), largest error of 0.00488 radians (0.2796 degrees).
|
||||||
|
static float atan2(float y, float x);
|
||||||
|
|
||||||
|
static float acos(float v);
|
||||||
|
|
||||||
|
static float sqrt(float v);
|
||||||
|
|
||||||
|
static float fmod(float a, float b);
|
||||||
|
|
||||||
|
static bool isNan(float v);
|
||||||
|
|
||||||
|
static float random();
|
||||||
|
|
||||||
|
static float randomTriangular(float min, float max);
|
||||||
|
|
||||||
|
static float randomTriangular(float min, float max, float mode);
|
||||||
|
|
||||||
|
static float pow(float a, float b);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SP_API Interpolation {
|
||||||
|
virtual float apply(float a) = 0;
|
||||||
|
|
||||||
|
virtual float interpolate(float start, float end, float a) {
|
||||||
|
return start + (end - start) * apply(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~Interpolation() {};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SP_API PowInterpolation: public Interpolation {
|
||||||
|
PowInterpolation(int power): power(power) {
|
||||||
|
}
|
||||||
|
|
||||||
|
float apply(float a) {
|
||||||
|
if (a <= 0.5f) return MathUtil::pow(a * 2.0f, (float)power) / 2.0f;
|
||||||
|
return MathUtil::pow((a - 1.0f) * 2.0f, (float)power) / (power % 2 == 0 ? -2.0f : 2.0f) + 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
int power;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SP_API PowOutInterpolation: public Interpolation {
|
||||||
|
PowOutInterpolation(int power): power(power) {
|
||||||
|
}
|
||||||
|
|
||||||
|
float apply(float a) {
|
||||||
|
return MathUtil::pow(a - 1, (float)power) * (power % 2 == 0 ? -1.0f : 1.0f) + 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
int power;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_MathUtil_h */
|
||||||
Vendored
+143
@@ -0,0 +1,143 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_MeshAttachment_h
|
||||||
|
#define Spine_MeshAttachment_h
|
||||||
|
|
||||||
|
#include <spine/VertexAttachment.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/Color.h>
|
||||||
|
#include <spine/HasRendererObject.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
/// Attachment that displays a texture region using a mesh.
|
||||||
|
class SP_API MeshAttachment : public VertexAttachment, public HasRendererObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
friend class AtlasAttachmentLoader;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MeshAttachment(const String& name);
|
||||||
|
|
||||||
|
virtual ~MeshAttachment();
|
||||||
|
|
||||||
|
void updateUVs();
|
||||||
|
|
||||||
|
int getHullLength();
|
||||||
|
void setHullLength(int inValue);
|
||||||
|
|
||||||
|
Vector<float>& getRegionUVs();
|
||||||
|
|
||||||
|
/// The UV pair for each vertex, normalized within the entire texture. See also MeshAttachment::updateUVs
|
||||||
|
Vector<float>& getUVs();
|
||||||
|
|
||||||
|
Vector<unsigned short>& getTriangles();
|
||||||
|
|
||||||
|
Color& getColor();
|
||||||
|
|
||||||
|
const String& getPath();
|
||||||
|
void setPath(const String& inValue);
|
||||||
|
|
||||||
|
float getRegionU();
|
||||||
|
void setRegionU(float inValue);
|
||||||
|
|
||||||
|
float getRegionV();
|
||||||
|
void setRegionV(float inValue);
|
||||||
|
|
||||||
|
float getRegionU2();
|
||||||
|
void setRegionU2(float inValue);
|
||||||
|
|
||||||
|
float getRegionV2();
|
||||||
|
void setRegionV2(float inValue);
|
||||||
|
|
||||||
|
bool getRegionRotate();
|
||||||
|
void setRegionRotate(bool inValue);
|
||||||
|
|
||||||
|
int getRegionDegrees();
|
||||||
|
void setRegionDegrees(int inValue);
|
||||||
|
|
||||||
|
float getRegionOffsetX();
|
||||||
|
void setRegionOffsetX(float inValue);
|
||||||
|
|
||||||
|
// Pixels stripped from the bottom left, unrotated.
|
||||||
|
float getRegionOffsetY();
|
||||||
|
void setRegionOffsetY(float inValue);
|
||||||
|
|
||||||
|
float getRegionWidth();
|
||||||
|
void setRegionWidth(float inValue);
|
||||||
|
|
||||||
|
// Unrotated, stripped size.
|
||||||
|
float getRegionHeight();
|
||||||
|
void setRegionHeight(float inValue);
|
||||||
|
|
||||||
|
float getRegionOriginalWidth();
|
||||||
|
void setRegionOriginalWidth(float inValue);
|
||||||
|
|
||||||
|
// Unrotated, unstripped size.
|
||||||
|
float getRegionOriginalHeight();
|
||||||
|
void setRegionOriginalHeight(float inValue);
|
||||||
|
|
||||||
|
MeshAttachment* getParentMesh();
|
||||||
|
void setParentMesh(MeshAttachment* inValue);
|
||||||
|
|
||||||
|
// Nonessential.
|
||||||
|
Vector<unsigned short>& getEdges();
|
||||||
|
float getWidth();
|
||||||
|
void setWidth(float inValue);
|
||||||
|
float getHeight();
|
||||||
|
void setHeight(float inValue);
|
||||||
|
|
||||||
|
virtual Attachment* copy();
|
||||||
|
|
||||||
|
MeshAttachment* newLinkedMesh();
|
||||||
|
|
||||||
|
private:
|
||||||
|
float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
|
||||||
|
MeshAttachment* _parentMesh;
|
||||||
|
Vector<float> _uvs;
|
||||||
|
Vector<float> _regionUVs;
|
||||||
|
Vector<unsigned short> _triangles;
|
||||||
|
Vector<unsigned short> _edges;
|
||||||
|
String _path;
|
||||||
|
float _regionU;
|
||||||
|
float _regionV;
|
||||||
|
float _regionU2;
|
||||||
|
float _regionV2;
|
||||||
|
float _width;
|
||||||
|
float _height;
|
||||||
|
Color _color;
|
||||||
|
int _hullLength;
|
||||||
|
bool _regionRotate;
|
||||||
|
int _regionDegrees;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_MeshAttachment_h */
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_MixPose_h
|
||||||
|
#define Spine_MixPose_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
|
||||||
|
/// Controls how a timeline is mixed with the setup or current pose.
|
||||||
|
/// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection)
|
||||||
|
enum MixBlend {
|
||||||
|
MixBlend_Setup = 0,
|
||||||
|
MixBlend_First,
|
||||||
|
MixBlend_Replace,
|
||||||
|
MixBlend_Add
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_MixPose_h */
|
||||||
Vendored
+44
@@ -0,0 +1,44 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_MixDirection_h
|
||||||
|
#define Spine_MixDirection_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
|
||||||
|
/// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose) or mixing in toward 1 (the timeline's pose).
|
||||||
|
/// See also Timeline::apply(Skeleton&, float, float, Vector&, float, MixPose, MixDirection)
|
||||||
|
enum MixDirection {
|
||||||
|
MixDirection_In = 0,
|
||||||
|
MixDirection_Out
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_MixDirection_h */
|
||||||
Vendored
+60
@@ -0,0 +1,60 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PathAttachment_h
|
||||||
|
#define Spine_PathAttachment_h
|
||||||
|
|
||||||
|
#include <spine/VertexAttachment.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API PathAttachment : public VertexAttachment {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PathAttachment(const String& name);
|
||||||
|
|
||||||
|
/// The length in the setup pose from the start of the path to the end of each curve.
|
||||||
|
Vector<float>& getLengths();
|
||||||
|
bool isClosed();
|
||||||
|
void setClosed(bool inValue);
|
||||||
|
bool isConstantSpeed();
|
||||||
|
void setConstantSpeed(bool inValue);
|
||||||
|
|
||||||
|
virtual Attachment* copy();
|
||||||
|
private:
|
||||||
|
Vector<float> _lengths;
|
||||||
|
bool _closed;
|
||||||
|
bool _constantSpeed;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PathAttachment_h */
|
||||||
Vendored
+115
@@ -0,0 +1,115 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PathConstraint_h
|
||||||
|
#define Spine_PathConstraint_h
|
||||||
|
|
||||||
|
#include <spine/ConstraintData.h>
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class PathConstraintData;
|
||||||
|
class Skeleton;
|
||||||
|
class PathAttachment;
|
||||||
|
class Bone;
|
||||||
|
class Slot;
|
||||||
|
|
||||||
|
class SP_API PathConstraint : public Updatable {
|
||||||
|
friend class Skeleton;
|
||||||
|
friend class PathConstraintMixTimeline;
|
||||||
|
friend class PathConstraintPositionTimeline;
|
||||||
|
friend class PathConstraintSpacingTimeline;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
PathConstraint(PathConstraintData& data, Skeleton& skeleton);
|
||||||
|
|
||||||
|
/// Applies the constraint to the constrained bones.
|
||||||
|
void apply();
|
||||||
|
|
||||||
|
virtual void update();
|
||||||
|
|
||||||
|
virtual int getOrder();
|
||||||
|
|
||||||
|
float getPosition();
|
||||||
|
void setPosition(float inValue);
|
||||||
|
|
||||||
|
float getSpacing();
|
||||||
|
void setSpacing(float inValue);
|
||||||
|
|
||||||
|
float getRotateMix();
|
||||||
|
void setRotateMix(float inValue);
|
||||||
|
|
||||||
|
float getTranslateMix();
|
||||||
|
void setTranslateMix(float inValue);
|
||||||
|
|
||||||
|
Vector<Bone*>& getBones();
|
||||||
|
|
||||||
|
Slot* getTarget();
|
||||||
|
void setTarget(Slot* inValue);
|
||||||
|
|
||||||
|
PathConstraintData& getData();
|
||||||
|
|
||||||
|
bool isActive();
|
||||||
|
|
||||||
|
void setActive(bool inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const float EPSILON;
|
||||||
|
static const int NONE;
|
||||||
|
static const int BEFORE;
|
||||||
|
static const int AFTER;
|
||||||
|
|
||||||
|
PathConstraintData& _data;
|
||||||
|
Vector<Bone*> _bones;
|
||||||
|
Slot* _target;
|
||||||
|
float _position, _spacing, _rotateMix, _translateMix;
|
||||||
|
|
||||||
|
Vector<float> _spaces;
|
||||||
|
Vector<float> _positions;
|
||||||
|
Vector<float> _world;
|
||||||
|
Vector<float> _curves;
|
||||||
|
Vector<float> _lengths;
|
||||||
|
Vector<float> _segments;
|
||||||
|
|
||||||
|
bool _active;
|
||||||
|
|
||||||
|
Vector<float>& computeWorldPositions(PathAttachment& path, int spacesCount, bool tangents, bool percentPosition, bool percentSpacing);
|
||||||
|
|
||||||
|
static void addBeforePosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
|
||||||
|
|
||||||
|
static void addAfterPosition(float p, Vector<float>& temp, int i, Vector<float>& output, int o);
|
||||||
|
|
||||||
|
static void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, Vector<float>& output, int o, bool tangents);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PathConstraint_h */
|
||||||
Vendored
+98
@@ -0,0 +1,98 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PathConstraintData_h
|
||||||
|
#define Spine_PathConstraintData_h
|
||||||
|
|
||||||
|
#include <spine/PositionMode.h>
|
||||||
|
#include <spine/SpacingMode.h>
|
||||||
|
#include <spine/RotateMode.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/ConstraintData.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class BoneData;
|
||||||
|
class SlotData;
|
||||||
|
|
||||||
|
class SP_API PathConstraintData : public ConstraintData {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class PathConstraint;
|
||||||
|
friend class Skeleton;
|
||||||
|
friend class PathConstraintMixTimeline;
|
||||||
|
friend class PathConstraintPositionTimeline;
|
||||||
|
friend class PathConstraintSpacingTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PathConstraintData(const String& name);
|
||||||
|
|
||||||
|
Vector<BoneData*>& getBones();
|
||||||
|
|
||||||
|
SlotData* getTarget();
|
||||||
|
void setTarget(SlotData* inValue);
|
||||||
|
|
||||||
|
PositionMode getPositionMode();
|
||||||
|
void setPositionMode(PositionMode inValue);
|
||||||
|
|
||||||
|
SpacingMode getSpacingMode();
|
||||||
|
void setSpacingMode(SpacingMode inValue);
|
||||||
|
|
||||||
|
RotateMode getRotateMode();
|
||||||
|
void setRotateMode(RotateMode inValue);
|
||||||
|
|
||||||
|
float getOffsetRotation();
|
||||||
|
void setOffsetRotation(float inValue);
|
||||||
|
|
||||||
|
float getPosition();
|
||||||
|
void setPosition(float inValue);
|
||||||
|
|
||||||
|
float getSpacing();
|
||||||
|
void setSpacing(float inValue);
|
||||||
|
|
||||||
|
float getRotateMix();
|
||||||
|
void setRotateMix(float inValue);
|
||||||
|
|
||||||
|
float getTranslateMix();
|
||||||
|
void setTranslateMix(float inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<BoneData*> _bones;
|
||||||
|
SlotData* _target;
|
||||||
|
PositionMode _positionMode;
|
||||||
|
SpacingMode _spacingMode;
|
||||||
|
RotateMode _rotateMode;
|
||||||
|
float _offsetRotation;
|
||||||
|
float _position, _spacing, _rotateMix, _translateMix;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PathConstraintData_h */
|
||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PathConstraintMixTimeline_h
|
||||||
|
#define Spine_PathConstraintMixTimeline_h
|
||||||
|
|
||||||
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
#define SP_PATHCONSTRAINTMIXTIMELINE_ENTRIES 5
|
||||||
|
|
||||||
|
class SP_API PathConstraintMixTimeline : public CurveTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const int ENTRIES;
|
||||||
|
|
||||||
|
explicit PathConstraintMixTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const int PREV_TIME;
|
||||||
|
static const int PREV_ROTATE;
|
||||||
|
static const int PREV_TRANSLATE;
|
||||||
|
static const int ROTATE;
|
||||||
|
static const int TRANSLATE;
|
||||||
|
|
||||||
|
Vector<float> _frames;
|
||||||
|
int _pathConstraintIndex;
|
||||||
|
|
||||||
|
/// Sets the time and mixes of the specified keyframe.
|
||||||
|
void setFrame(int frameIndex, float time, float rotateMix, float translateMix);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PathConstraintMixTimeline_h */
|
||||||
+67
@@ -0,0 +1,67 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PathConstraintPositionTimeline_h
|
||||||
|
#define Spine_PathConstraintPositionTimeline_h
|
||||||
|
|
||||||
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
|
||||||
|
class SP_API PathConstraintPositionTimeline : public CurveTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const int ENTRIES;
|
||||||
|
|
||||||
|
explicit PathConstraintPositionTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual ~PathConstraintPositionTimeline();
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time and value of the specified keyframe.
|
||||||
|
void setFrame(int frameIndex, float time, float value);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static const int PREV_TIME;
|
||||||
|
static const int PREV_VALUE;
|
||||||
|
static const int VALUE;
|
||||||
|
|
||||||
|
Vector<float> _frames;
|
||||||
|
int _pathConstraintIndex;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PathConstraintPositionTimeline_h */
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PathConstraintSpacingTimeline_h
|
||||||
|
#define Spine_PathConstraintSpacingTimeline_h
|
||||||
|
|
||||||
|
#include <spine/PathConstraintPositionTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API PathConstraintSpacingTimeline : public PathConstraintPositionTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PathConstraintSpacingTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PathConstraintSpacingTimeline_h */
|
||||||
Vendored
+73
@@ -0,0 +1,73 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PointAttachment_h
|
||||||
|
#define Spine_PointAttachment_h
|
||||||
|
|
||||||
|
#include <spine/Attachment.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Bone;
|
||||||
|
|
||||||
|
/// An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
|
||||||
|
/// used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
|
||||||
|
/// skin.
|
||||||
|
///
|
||||||
|
/// See http://esotericsoftware.com/spine-point-attachments for Point Attachments in the Spine User Guide.
|
||||||
|
///
|
||||||
|
class SP_API PointAttachment : public Attachment {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit PointAttachment(const String& name);
|
||||||
|
|
||||||
|
void computeWorldPosition(Bone& bone, float& ox, float& oy);
|
||||||
|
|
||||||
|
float computeWorldRotation(Bone& bone);
|
||||||
|
|
||||||
|
float getX();
|
||||||
|
void setX(float inValue);
|
||||||
|
|
||||||
|
float getY();
|
||||||
|
void setY(float inValue);
|
||||||
|
|
||||||
|
float getRotation();
|
||||||
|
void setRotation(float inValue);
|
||||||
|
|
||||||
|
virtual Attachment* copy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
float _x, _y, _rotation;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PointAttachment_h */
|
||||||
+74
@@ -0,0 +1,74 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Pool_h
|
||||||
|
#define Spine_Pool_h
|
||||||
|
|
||||||
|
#include <spine/Extension.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/ContainerUtil.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
template<typename T>
|
||||||
|
class SP_API Pool : public SpineObject {
|
||||||
|
public:
|
||||||
|
Pool() {
|
||||||
|
}
|
||||||
|
|
||||||
|
~Pool() {
|
||||||
|
ContainerUtil::cleanUpVectorOfPointers(_objects);
|
||||||
|
}
|
||||||
|
|
||||||
|
T *obtain() {
|
||||||
|
if (_objects.size() > 0) {
|
||||||
|
T **object = &_objects[_objects.size() - 1];
|
||||||
|
T *ret = *object;
|
||||||
|
_objects.removeAt(_objects.size() - 1);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
} else {
|
||||||
|
T *ret = new(__FILE__, __LINE__) T();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void free(T *object) {
|
||||||
|
if (!_objects.contains(object)) {
|
||||||
|
_objects.add(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<T *> _objects;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Pool_h */
|
||||||
Vendored
+40
@@ -0,0 +1,40 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_PositionMode_h
|
||||||
|
#define Spine_PositionMode_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum PositionMode {
|
||||||
|
PositionMode_Fixed = 0,
|
||||||
|
PositionMode_Percent
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_PositionMode_h */
|
||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_RTTI_h
|
||||||
|
#define Spine_RTTI_h
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API RTTI : public SpineObject {
|
||||||
|
public:
|
||||||
|
explicit RTTI(const char *className);
|
||||||
|
|
||||||
|
RTTI(const char *className, const RTTI &baseRTTI);
|
||||||
|
|
||||||
|
const char *getClassName() const;
|
||||||
|
|
||||||
|
bool isExactly(const RTTI &rtti) const;
|
||||||
|
|
||||||
|
bool instanceOf(const RTTI &rtti) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Prevent copying
|
||||||
|
RTTI(const RTTI &obj);
|
||||||
|
|
||||||
|
RTTI &operator=(const RTTI &obj);
|
||||||
|
|
||||||
|
const char* _className;
|
||||||
|
const RTTI *_pBaseRTTI;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#define RTTI_DECL \
|
||||||
|
public: \
|
||||||
|
static const spine::RTTI rtti; \
|
||||||
|
virtual const spine::RTTI& getRTTI() const;
|
||||||
|
|
||||||
|
#define RTTI_IMPL_NOPARENT(name) \
|
||||||
|
const spine::RTTI name::rtti(#name); \
|
||||||
|
const spine::RTTI& name::getRTTI() const { return rtti; }
|
||||||
|
|
||||||
|
#define RTTI_IMPL(name, parent) \
|
||||||
|
const spine::RTTI name::rtti(#name, parent::rtti); \
|
||||||
|
const spine::RTTI& name::getRTTI() const { return rtti; }
|
||||||
|
|
||||||
|
#endif /* Spine_RTTI_h */
|
||||||
Vendored
+133
@@ -0,0 +1,133 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_RegionAttachment_h
|
||||||
|
#define Spine_RegionAttachment_h
|
||||||
|
|
||||||
|
#include <spine/Attachment.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/Color.h>
|
||||||
|
|
||||||
|
#include <spine/HasRendererObject.h>
|
||||||
|
|
||||||
|
#define NUM_UVS 8
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Bone;
|
||||||
|
|
||||||
|
/// Attachment that displays a texture region.
|
||||||
|
class SP_API RegionAttachment : public Attachment, public HasRendererObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
friend class AtlasAttachmentLoader;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit RegionAttachment(const String& name);
|
||||||
|
|
||||||
|
void updateOffset();
|
||||||
|
|
||||||
|
void setUVs(float u, float v, float u2, float v2, bool rotate);
|
||||||
|
|
||||||
|
/// Transforms the attachment's four vertices to world coordinates.
|
||||||
|
/// @param bone The parent bone.
|
||||||
|
/// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8.
|
||||||
|
/// @param offset The worldVertices index to begin writing values.
|
||||||
|
/// @param stride The number of worldVertices entries between the value pairs written.
|
||||||
|
void computeWorldVertices(Bone& bone, float *worldVertices, size_t offset, size_t stride = 2);
|
||||||
|
void computeWorldVertices(Bone& bone, Vector<float>& worldVertices, size_t offset, size_t stride = 2);
|
||||||
|
|
||||||
|
float getX();
|
||||||
|
void setX(float inValue);
|
||||||
|
float getY();
|
||||||
|
void setY(float inValue);
|
||||||
|
float getRotation();
|
||||||
|
void setRotation(float inValue);
|
||||||
|
float getScaleX();
|
||||||
|
void setScaleX(float inValue);
|
||||||
|
float getScaleY();
|
||||||
|
void setScaleY(float inValue);
|
||||||
|
float getWidth();
|
||||||
|
void setWidth(float inValue);
|
||||||
|
float getHeight();
|
||||||
|
void setHeight(float inValue);
|
||||||
|
|
||||||
|
Color& getColor();
|
||||||
|
|
||||||
|
const String& getPath();
|
||||||
|
void setPath(const String& inValue);
|
||||||
|
|
||||||
|
float getRegionOffsetX();
|
||||||
|
void setRegionOffsetX(float inValue);
|
||||||
|
|
||||||
|
float getRegionOffsetY();
|
||||||
|
void setRegionOffsetY(float inValue);
|
||||||
|
|
||||||
|
float getRegionWidth();
|
||||||
|
void setRegionWidth(float inValue);
|
||||||
|
|
||||||
|
float getRegionHeight();
|
||||||
|
void setRegionHeight(float inValue);
|
||||||
|
|
||||||
|
float getRegionOriginalWidth();
|
||||||
|
void setRegionOriginalWidth(float inValue);
|
||||||
|
|
||||||
|
float getRegionOriginalHeight();
|
||||||
|
void setRegionOriginalHeight(float inValue);
|
||||||
|
|
||||||
|
Vector<float>& getOffset();
|
||||||
|
Vector<float>& getUVs();
|
||||||
|
|
||||||
|
virtual Attachment* copy();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const int BLX;
|
||||||
|
static const int BLY;
|
||||||
|
static const int ULX;
|
||||||
|
static const int ULY;
|
||||||
|
static const int URX;
|
||||||
|
static const int URY;
|
||||||
|
static const int BRX;
|
||||||
|
static const int BRY;
|
||||||
|
|
||||||
|
float _x, _y, _rotation, _scaleX, _scaleY, _width, _height;
|
||||||
|
float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
|
||||||
|
Vector<float> _vertexOffset;
|
||||||
|
Vector<float> _uvs;
|
||||||
|
String _path;
|
||||||
|
float _regionU;
|
||||||
|
float _regionV;
|
||||||
|
float _regionU2;
|
||||||
|
float _regionV2;
|
||||||
|
Color _color;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_RegionAttachment_h */
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_RotateMode_h
|
||||||
|
#define Spine_RotateMode_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum RotateMode {
|
||||||
|
RotateMode_Tangent = 0,
|
||||||
|
RotateMode_Chain,
|
||||||
|
RotateMode_ChainScale
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_RotateMode_h */
|
||||||
Vendored
+70
@@ -0,0 +1,70 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_RotateTimeline_h
|
||||||
|
#define Spine_RotateTimeline_h
|
||||||
|
|
||||||
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API RotateTimeline : public CurveTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
static const int ENTRIES = 2;
|
||||||
|
|
||||||
|
explicit RotateTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
|
||||||
|
/// Sets the time and value of the specified keyframe.
|
||||||
|
void setFrame(int frameIndex, float time, float degrees);
|
||||||
|
|
||||||
|
int getBoneIndex();
|
||||||
|
void setBoneIndex(int inValue);
|
||||||
|
|
||||||
|
Vector<float>& getFrames();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static const int PREV_TIME = -2;
|
||||||
|
static const int PREV_ROTATION = -1;
|
||||||
|
static const int ROTATION = 1;
|
||||||
|
|
||||||
|
int _boneIndex;
|
||||||
|
Vector<float> _frames; // time, angle, ...
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_RotateTimeline_h */
|
||||||
Vendored
+51
@@ -0,0 +1,51 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_ScaleTimeline_h
|
||||||
|
#define Spine_ScaleTimeline_h
|
||||||
|
|
||||||
|
#include <spine/TranslateTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API ScaleTimeline : public TranslateTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ScaleTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_ScaleTimeline_h */
|
||||||
Vendored
+51
@@ -0,0 +1,51 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_ShearTimeline_h
|
||||||
|
#define Spine_ShearTimeline_h
|
||||||
|
|
||||||
|
#include <spine/TranslateTimeline.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API ShearTimeline : public TranslateTimeline {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ShearTimeline(int frameCount);
|
||||||
|
|
||||||
|
virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector<Event*>* pEvents, float alpha, MixBlend blend, MixDirection direction);
|
||||||
|
|
||||||
|
virtual int getPropertyId();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_ShearTimeline_h */
|
||||||
+243
@@ -0,0 +1,243 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Skeleton_h
|
||||||
|
#define Spine_Skeleton_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/MathUtil.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/Color.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SkeletonData;
|
||||||
|
|
||||||
|
class Bone;
|
||||||
|
|
||||||
|
class Updatable;
|
||||||
|
|
||||||
|
class Slot;
|
||||||
|
|
||||||
|
class IkConstraint;
|
||||||
|
|
||||||
|
class PathConstraint;
|
||||||
|
|
||||||
|
class TransformConstraint;
|
||||||
|
|
||||||
|
class Skin;
|
||||||
|
|
||||||
|
class Attachment;
|
||||||
|
|
||||||
|
class SP_API Skeleton : public SpineObject {
|
||||||
|
friend class AnimationState;
|
||||||
|
|
||||||
|
friend class SkeletonBounds;
|
||||||
|
|
||||||
|
friend class SkeletonClipping;
|
||||||
|
|
||||||
|
friend class AttachmentTimeline;
|
||||||
|
|
||||||
|
friend class ColorTimeline;
|
||||||
|
|
||||||
|
friend class DeformTimeline;
|
||||||
|
|
||||||
|
friend class DrawOrderTimeline;
|
||||||
|
|
||||||
|
friend class EventTimeline;
|
||||||
|
|
||||||
|
friend class IkConstraintTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintMixTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintPositionTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintSpacingTimeline;
|
||||||
|
|
||||||
|
friend class ScaleTimeline;
|
||||||
|
|
||||||
|
friend class ShearTimeline;
|
||||||
|
|
||||||
|
friend class TransformConstraintTimeline;
|
||||||
|
|
||||||
|
friend class TranslateTimeline;
|
||||||
|
|
||||||
|
friend class TwoColorTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit Skeleton(SkeletonData *skeletonData);
|
||||||
|
|
||||||
|
~Skeleton();
|
||||||
|
|
||||||
|
/// Caches information about bones and constraints. Must be called if bones, constraints or weighted path attachments are added
|
||||||
|
/// or removed.
|
||||||
|
void updateCache();
|
||||||
|
|
||||||
|
void printUpdateCache();
|
||||||
|
|
||||||
|
/// Updates the world transform for each bone and applies constraints.
|
||||||
|
void updateWorldTransform();
|
||||||
|
|
||||||
|
/// Sets the bones, constraints, and slots to their setup pose values.
|
||||||
|
void setToSetupPose();
|
||||||
|
|
||||||
|
/// Sets the bones and constraints to their setup pose values.
|
||||||
|
void setBonesToSetupPose();
|
||||||
|
|
||||||
|
void setSlotsToSetupPose();
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
Bone *findBone(const String &boneName);
|
||||||
|
|
||||||
|
/// @return -1 if the bone was not found.
|
||||||
|
int findBoneIndex(const String &boneName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
Slot *findSlot(const String &slotName);
|
||||||
|
|
||||||
|
/// @return -1 if the bone was not found.
|
||||||
|
int findSlotIndex(const String &slotName);
|
||||||
|
|
||||||
|
/// Sets a skin by name (see setSkin).
|
||||||
|
void setSkin(const String &skinName);
|
||||||
|
|
||||||
|
/// Attachments from the new skin are attached if the corresponding attachment from the old skin was attached.
|
||||||
|
/// If there was no old skin, each slot's setup mode attachment is attached from the new skin.
|
||||||
|
/// After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling
|
||||||
|
/// See Skeleton::setSlotsToSetupPose()
|
||||||
|
/// Also, often AnimationState::apply(Skeleton&) is called before the next time the
|
||||||
|
/// skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.
|
||||||
|
/// @param newSkin May be NULL.
|
||||||
|
void setSkin(Skin *newSkin);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
Attachment *getAttachment(const String &slotName, const String &attachmentName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
Attachment *getAttachment(int slotIndex, const String &attachmentName);
|
||||||
|
|
||||||
|
/// @param attachmentName May be empty.
|
||||||
|
void setAttachment(const String &slotName, const String &attachmentName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
IkConstraint *findIkConstraint(const String &constraintName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
TransformConstraint *findTransformConstraint(const String &constraintName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
PathConstraint *findPathConstraint(const String &constraintName);
|
||||||
|
|
||||||
|
void update(float delta);
|
||||||
|
|
||||||
|
/// Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
|
||||||
|
/// @param outX The horizontal distance between the skeleton origin and the left side of the AABB.
|
||||||
|
/// @param outY The vertical distance between the skeleton origin and the bottom side of the AABB.
|
||||||
|
/// @param outWidth The width of the AABB
|
||||||
|
/// @param outHeight The height of the AABB.
|
||||||
|
/// @param outVertexBuffer Reference to hold a Vector of floats. This method will assign it with new floats as needed.
|
||||||
|
void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector<float> &outVertexBuffer);
|
||||||
|
|
||||||
|
Bone *getRootBone();
|
||||||
|
|
||||||
|
SkeletonData *getData();
|
||||||
|
|
||||||
|
Vector<Bone *> &getBones();
|
||||||
|
|
||||||
|
Vector<Updatable *> &getUpdateCacheList();
|
||||||
|
|
||||||
|
Vector<Slot *> &getSlots();
|
||||||
|
|
||||||
|
Vector<Slot *> &getDrawOrder();
|
||||||
|
|
||||||
|
Vector<IkConstraint *> &getIkConstraints();
|
||||||
|
|
||||||
|
Vector<PathConstraint *> &getPathConstraints();
|
||||||
|
|
||||||
|
Vector<TransformConstraint *> &getTransformConstraints();
|
||||||
|
|
||||||
|
Skin *getSkin();
|
||||||
|
|
||||||
|
Color &getColor();
|
||||||
|
|
||||||
|
float getTime();
|
||||||
|
|
||||||
|
void setTime(float inValue);
|
||||||
|
|
||||||
|
void setPosition(float x, float y);
|
||||||
|
|
||||||
|
float getX();
|
||||||
|
|
||||||
|
void setX(float inValue);
|
||||||
|
|
||||||
|
float getY();
|
||||||
|
|
||||||
|
void setY(float inValue);
|
||||||
|
|
||||||
|
float getScaleX();
|
||||||
|
|
||||||
|
void setScaleX(float inValue);
|
||||||
|
|
||||||
|
float getScaleY();
|
||||||
|
|
||||||
|
void setScaleY(float inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
SkeletonData *_data;
|
||||||
|
Vector<Bone *> _bones;
|
||||||
|
Vector<Slot *> _slots;
|
||||||
|
Vector<Slot *> _drawOrder;
|
||||||
|
Vector<IkConstraint *> _ikConstraints;
|
||||||
|
Vector<TransformConstraint *> _transformConstraints;
|
||||||
|
Vector<PathConstraint *> _pathConstraints;
|
||||||
|
Vector<Updatable *> _updateCache;
|
||||||
|
Vector<Bone *> _updateCacheReset;
|
||||||
|
Skin *_skin;
|
||||||
|
Color _color;
|
||||||
|
float _time;
|
||||||
|
float _scaleX, _scaleY;
|
||||||
|
float _x, _y;
|
||||||
|
|
||||||
|
void sortIkConstraint(IkConstraint *constraint);
|
||||||
|
|
||||||
|
void sortPathConstraint(PathConstraint *constraint);
|
||||||
|
|
||||||
|
void sortTransformConstraint(TransformConstraint *constraint);
|
||||||
|
|
||||||
|
void sortPathConstraintAttachment(Skin *skin, size_t slotIndex, Bone &slotBone);
|
||||||
|
|
||||||
|
void sortPathConstraintAttachment(Attachment *attachment, Bone &slotBone);
|
||||||
|
|
||||||
|
void sortBone(Bone *bone);
|
||||||
|
|
||||||
|
static void sortReset(Vector<Bone *> &bones);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Skeleton_h */
|
||||||
Vendored
+131
@@ -0,0 +1,131 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_SkeletonBinary_h
|
||||||
|
#define Spine_SkeletonBinary_h
|
||||||
|
|
||||||
|
#include <spine/TransformMode.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/Color.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SkeletonData;
|
||||||
|
class Atlas;
|
||||||
|
class AttachmentLoader;
|
||||||
|
class LinkedMesh;
|
||||||
|
class Skin;
|
||||||
|
class Attachment;
|
||||||
|
class VertexAttachment;
|
||||||
|
class Animation;
|
||||||
|
class CurveTimeline;
|
||||||
|
|
||||||
|
class SP_API SkeletonBinary : public SpineObject {
|
||||||
|
public:
|
||||||
|
static const int BONE_ROTATE;
|
||||||
|
static const int BONE_TRANSLATE;
|
||||||
|
static const int BONE_SCALE;
|
||||||
|
static const int BONE_SHEAR;
|
||||||
|
|
||||||
|
static const int SLOT_ATTACHMENT;
|
||||||
|
static const int SLOT_COLOR;
|
||||||
|
static const int SLOT_TWO_COLOR;
|
||||||
|
|
||||||
|
static const int PATH_POSITION;
|
||||||
|
static const int PATH_SPACING;
|
||||||
|
static const int PATH_MIX;
|
||||||
|
|
||||||
|
static const int CURVE_LINEAR;
|
||||||
|
static const int CURVE_STEPPED;
|
||||||
|
static const int CURVE_BEZIER;
|
||||||
|
|
||||||
|
explicit SkeletonBinary(Atlas* atlasArray);
|
||||||
|
|
||||||
|
explicit SkeletonBinary(AttachmentLoader* attachmentLoader, bool ownsLoader = false);
|
||||||
|
|
||||||
|
~SkeletonBinary();
|
||||||
|
|
||||||
|
SkeletonData* readSkeletonData(const unsigned char* binary, int length);
|
||||||
|
|
||||||
|
SkeletonData* readSkeletonDataFile(const String& path);
|
||||||
|
|
||||||
|
void setScale(float scale) { _scale = scale; }
|
||||||
|
|
||||||
|
String& getError() { return _error; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
struct DataInput : public SpineObject {
|
||||||
|
const unsigned char* cursor;
|
||||||
|
const unsigned char* end;
|
||||||
|
};
|
||||||
|
|
||||||
|
AttachmentLoader* _attachmentLoader;
|
||||||
|
Vector<LinkedMesh*> _linkedMeshes;
|
||||||
|
String _error;
|
||||||
|
float _scale;
|
||||||
|
const bool _ownsLoader;
|
||||||
|
|
||||||
|
void setError(const char* value1, const char* value2);
|
||||||
|
|
||||||
|
char* readString(DataInput* input);
|
||||||
|
|
||||||
|
char* readStringRef(DataInput* input, SkeletonData* skeletonData);
|
||||||
|
|
||||||
|
float readFloat(DataInput* input);
|
||||||
|
|
||||||
|
unsigned char readByte(DataInput* input);
|
||||||
|
|
||||||
|
signed char readSByte(DataInput* input);
|
||||||
|
|
||||||
|
bool readBoolean(DataInput* input);
|
||||||
|
|
||||||
|
int readInt(DataInput* input);
|
||||||
|
|
||||||
|
void readColor(DataInput* input, Color& color);
|
||||||
|
|
||||||
|
int readVarint(DataInput* input, bool optimizePositive);
|
||||||
|
|
||||||
|
Skin* readSkin(DataInput* input, bool defaultSkin, SkeletonData* skeletonData, bool nonessential);
|
||||||
|
|
||||||
|
Attachment* readAttachment(DataInput* input, Skin* skin, int slotIndex, const String& attachmentName, SkeletonData* skeletonData, bool nonessential);
|
||||||
|
|
||||||
|
void readVertices(DataInput* input, VertexAttachment* attachment, int vertexCount);
|
||||||
|
|
||||||
|
void readFloatArray(DataInput *input, int n, float scale, Vector<float>& array);
|
||||||
|
|
||||||
|
void readShortArray(DataInput *input, Vector<unsigned short>& array);
|
||||||
|
|
||||||
|
Animation* readAnimation(const String& name, DataInput* input, SkeletonData *skeletonData);
|
||||||
|
|
||||||
|
void readCurve(DataInput* input, int frameIndex, CurveTimeline* timeline);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_SkeletonBinary_h */
|
||||||
Vendored
+106
@@ -0,0 +1,106 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_SkeletonBounds_h
|
||||||
|
#define Spine_SkeletonBounds_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/Pool.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Skeleton;
|
||||||
|
class BoundingBoxAttachment;
|
||||||
|
class Polygon;
|
||||||
|
|
||||||
|
/// Collects each BoundingBoxAttachment that is visible and computes the world vertices for its polygon.
|
||||||
|
/// The polygon vertices are provided along with convenience methods for doing hit detection.
|
||||||
|
class SP_API SkeletonBounds : public SpineObject {
|
||||||
|
public:
|
||||||
|
SkeletonBounds();
|
||||||
|
~SkeletonBounds();
|
||||||
|
|
||||||
|
/// Clears any previous polygons, finds all visible bounding box attachments,
|
||||||
|
/// and computes the world vertices for each bounding box's polygon.
|
||||||
|
/// @param skeleton The skeleton.
|
||||||
|
/// @param updateAabb
|
||||||
|
/// If true, the axis aligned bounding box containing all the polygons is computed.
|
||||||
|
/// If false, the SkeletonBounds AABB methods will always return true.
|
||||||
|
///
|
||||||
|
void update(Skeleton& skeleton, bool updateAabb);
|
||||||
|
|
||||||
|
/// Returns true if the axis aligned bounding box contains the point.
|
||||||
|
bool aabbcontainsPoint(float x, float y);
|
||||||
|
|
||||||
|
/// Returns true if the axis aligned bounding box intersects the line segment.
|
||||||
|
bool aabbintersectsSegment(float x1, float y1, float x2, float y2);
|
||||||
|
|
||||||
|
/// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.
|
||||||
|
bool aabbIntersectsSkeleton(SkeletonBounds bounds);
|
||||||
|
|
||||||
|
/// Returns true if the polygon contains the point.
|
||||||
|
bool containsPoint(Polygon* polygon, float x, float y);
|
||||||
|
|
||||||
|
/// Returns the first bounding box attachment that contains the point, or NULL. When doing many checks, it is usually more
|
||||||
|
/// efficient to only call this method if {@link #aabbcontainsPoint(float, float)} returns true.
|
||||||
|
BoundingBoxAttachment* containsPoint(float x, float y);
|
||||||
|
|
||||||
|
/// Returns the first bounding box attachment that contains the line segment, or NULL. When doing many checks, it is usually
|
||||||
|
/// more efficient to only call this method if {@link #aabbintersectsSegment(float, float, float, float)} returns true.
|
||||||
|
BoundingBoxAttachment* intersectsSegment(float x1, float y1, float x2, float y2);
|
||||||
|
|
||||||
|
/// Returns true if the polygon contains the line segment.
|
||||||
|
bool intersectsSegment(Polygon* polygon, float x1, float y1, float x2, float y2);
|
||||||
|
|
||||||
|
Polygon* getPolygon(BoundingBoxAttachment* attachment);
|
||||||
|
|
||||||
|
float getWidth();
|
||||||
|
float getHeight();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Pool<Polygon> _polygonPool;
|
||||||
|
Vector<BoundingBoxAttachment*> _boundingBoxes;
|
||||||
|
Vector<Polygon*> _polygons;
|
||||||
|
float _minX, _minY, _maxX, _maxY;
|
||||||
|
|
||||||
|
void aabbCompute();
|
||||||
|
};
|
||||||
|
|
||||||
|
class Polygon : public SpineObject {
|
||||||
|
public:
|
||||||
|
Vector<float> _vertices;
|
||||||
|
int _count;
|
||||||
|
|
||||||
|
Polygon() : _count(0) {
|
||||||
|
_vertices.ensureCapacity(16);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_SkeletonBounds_h */
|
||||||
Vendored
+79
@@ -0,0 +1,79 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_SkeletonClipping_h
|
||||||
|
#define Spine_SkeletonClipping_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/Triangulator.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Slot;
|
||||||
|
class ClippingAttachment;
|
||||||
|
|
||||||
|
class SP_API SkeletonClipping : public SpineObject {
|
||||||
|
public:
|
||||||
|
SkeletonClipping();
|
||||||
|
|
||||||
|
size_t clipStart(Slot& slot, ClippingAttachment* clip);
|
||||||
|
|
||||||
|
void clipEnd(Slot& slot);
|
||||||
|
|
||||||
|
void clipEnd();
|
||||||
|
|
||||||
|
void clipTriangles(float* vertices, unsigned short* triangles, size_t trianglesLength, float* uvs, size_t stride);
|
||||||
|
|
||||||
|
void clipTriangles(Vector<float>& vertices, Vector<unsigned short>& triangles, Vector<float>& uvs, size_t stride);
|
||||||
|
|
||||||
|
bool isClipping();
|
||||||
|
|
||||||
|
Vector<float>& getClippedVertices();
|
||||||
|
Vector<unsigned short>& getClippedTriangles();
|
||||||
|
Vector<float>& getClippedUVs();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Triangulator _triangulator;
|
||||||
|
Vector<float> _clippingPolygon;
|
||||||
|
Vector<float> _clipOutput;
|
||||||
|
Vector<float> _clippedVertices;
|
||||||
|
Vector<unsigned short> _clippedTriangles;
|
||||||
|
Vector<float> _clippedUVs;
|
||||||
|
Vector<float> _scratch;
|
||||||
|
ClippingAttachment* _clipAttachment;
|
||||||
|
Vector< Vector<float>* > *_clippingPolygons;
|
||||||
|
|
||||||
|
/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
|
||||||
|
* area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */
|
||||||
|
bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector<float>* clippingArea, Vector<float>* output);
|
||||||
|
|
||||||
|
static void makeClockwise(Vector<float>& polygon);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_SkeletonClipping_h */
|
||||||
Vendored
+191
@@ -0,0 +1,191 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_SkeletonData_h
|
||||||
|
#define Spine_SkeletonData_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class BoneData;
|
||||||
|
|
||||||
|
class SlotData;
|
||||||
|
|
||||||
|
class Skin;
|
||||||
|
|
||||||
|
class EventData;
|
||||||
|
|
||||||
|
class Animation;
|
||||||
|
|
||||||
|
class IkConstraintData;
|
||||||
|
|
||||||
|
class TransformConstraintData;
|
||||||
|
|
||||||
|
class PathConstraintData;
|
||||||
|
|
||||||
|
/// Stores the setup pose and all of the stateless data for a skeleton.
|
||||||
|
class SP_API SkeletonData : public SpineObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class Skeleton;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SkeletonData();
|
||||||
|
|
||||||
|
~SkeletonData();
|
||||||
|
|
||||||
|
/// Finds a bone by comparing each bone's name.
|
||||||
|
/// It is more efficient to cache the results of this method than to call it multiple times.
|
||||||
|
/// @return May be NULL.
|
||||||
|
BoneData *findBone(const String &boneName);
|
||||||
|
|
||||||
|
/// @return -1 if the bone was not found.
|
||||||
|
int findBoneIndex(const String &boneName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
SlotData *findSlot(const String &slotName);
|
||||||
|
|
||||||
|
/// @return -1 if the slot was not found.
|
||||||
|
int findSlotIndex(const String &slotName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
Skin *findSkin(const String &skinName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
spine::EventData *findEvent(const String &eventDataName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
Animation *findAnimation(const String &animationName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
IkConstraintData *findIkConstraint(const String &constraintName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
TransformConstraintData *findTransformConstraint(const String &constraintName);
|
||||||
|
|
||||||
|
/// @return May be NULL.
|
||||||
|
PathConstraintData *findPathConstraint(const String &constraintName);
|
||||||
|
|
||||||
|
/// @return -1 if the path constraint was not found.
|
||||||
|
int findPathConstraintIndex(const String &pathConstraintName);
|
||||||
|
|
||||||
|
const String &getName();
|
||||||
|
|
||||||
|
void setName(const String &inValue);
|
||||||
|
|
||||||
|
/// The skeleton's bones, sorted parent first. The root bone is always the first bone.
|
||||||
|
Vector<BoneData *> &getBones();
|
||||||
|
|
||||||
|
Vector<SlotData *> &getSlots();
|
||||||
|
|
||||||
|
/// All skins, including the default skin.
|
||||||
|
Vector<Skin *> &getSkins();
|
||||||
|
|
||||||
|
/// The skeleton's default skin.
|
||||||
|
/// By default this skin contains all attachments that were not in a skin in Spine.
|
||||||
|
/// @return May be NULL.
|
||||||
|
Skin *getDefaultSkin();
|
||||||
|
|
||||||
|
void setDefaultSkin(Skin *inValue);
|
||||||
|
|
||||||
|
Vector<spine::EventData *> &getEvents();
|
||||||
|
|
||||||
|
Vector<Animation *> &getAnimations();
|
||||||
|
|
||||||
|
Vector<IkConstraintData *> &getIkConstraints();
|
||||||
|
|
||||||
|
Vector<TransformConstraintData *> &getTransformConstraints();
|
||||||
|
|
||||||
|
Vector<PathConstraintData *> &getPathConstraints();
|
||||||
|
|
||||||
|
float getX();
|
||||||
|
|
||||||
|
void setX(float inValue);
|
||||||
|
|
||||||
|
float getY();
|
||||||
|
|
||||||
|
void setY(float inValue);
|
||||||
|
|
||||||
|
float getWidth();
|
||||||
|
|
||||||
|
void setWidth(float inValue);
|
||||||
|
|
||||||
|
float getHeight();
|
||||||
|
|
||||||
|
void setHeight(float inValue);
|
||||||
|
|
||||||
|
/// The Spine version used to export this data, or NULL.
|
||||||
|
const String &getVersion();
|
||||||
|
|
||||||
|
void setVersion(const String &inValue);
|
||||||
|
|
||||||
|
const String &getHash();
|
||||||
|
|
||||||
|
void setHash(const String &inValue);
|
||||||
|
|
||||||
|
const String &getImagesPath();
|
||||||
|
|
||||||
|
void setImagesPath(const String &inValue);
|
||||||
|
|
||||||
|
const String &getAudioPath();
|
||||||
|
|
||||||
|
void setAudioPath(const String &inValue);
|
||||||
|
|
||||||
|
/// The dopesheet FPS in Spine. Available only when nonessential data was exported.
|
||||||
|
float getFps();
|
||||||
|
|
||||||
|
void setFps(float inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
String _name;
|
||||||
|
Vector<BoneData *> _bones; // Ordered parents first
|
||||||
|
Vector<SlotData *> _slots; // Setup pose draw order.
|
||||||
|
Vector<Skin *> _skins;
|
||||||
|
Skin *_defaultSkin;
|
||||||
|
Vector<EventData *> _events;
|
||||||
|
Vector<Animation *> _animations;
|
||||||
|
Vector<IkConstraintData *> _ikConstraints;
|
||||||
|
Vector<TransformConstraintData *> _transformConstraints;
|
||||||
|
Vector<PathConstraintData *> _pathConstraints;
|
||||||
|
float _x, _y, _width, _height;
|
||||||
|
String _version;
|
||||||
|
String _hash;
|
||||||
|
Vector<char*> _strings;
|
||||||
|
|
||||||
|
// Nonessential.
|
||||||
|
float _fps;
|
||||||
|
String _imagesPath;
|
||||||
|
String _audioPath;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_SkeletonData_h */
|
||||||
Vendored
+91
@@ -0,0 +1,91 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_SkeletonJson_h
|
||||||
|
#define Spine_SkeletonJson_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class CurveTimeline;
|
||||||
|
|
||||||
|
class VertexAttachment;
|
||||||
|
|
||||||
|
class Animation;
|
||||||
|
|
||||||
|
class Json;
|
||||||
|
|
||||||
|
class SkeletonData;
|
||||||
|
|
||||||
|
class Atlas;
|
||||||
|
|
||||||
|
class AttachmentLoader;
|
||||||
|
|
||||||
|
class LinkedMesh;
|
||||||
|
|
||||||
|
class String;
|
||||||
|
|
||||||
|
class SP_API SkeletonJson : public SpineObject {
|
||||||
|
public:
|
||||||
|
explicit SkeletonJson(Atlas *atlas);
|
||||||
|
|
||||||
|
explicit SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader = false);
|
||||||
|
|
||||||
|
~SkeletonJson();
|
||||||
|
|
||||||
|
SkeletonData *readSkeletonDataFile(const String &path);
|
||||||
|
|
||||||
|
SkeletonData *readSkeletonData(const char *json);
|
||||||
|
|
||||||
|
void setScale(float scale) { _scale = scale; }
|
||||||
|
|
||||||
|
String &getError() { return _error; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
AttachmentLoader *_attachmentLoader;
|
||||||
|
Vector<LinkedMesh *> _linkedMeshes;
|
||||||
|
float _scale;
|
||||||
|
const bool _ownsLoader;
|
||||||
|
String _error;
|
||||||
|
|
||||||
|
static float toColor(const char *value, size_t index);
|
||||||
|
|
||||||
|
static void readCurve(Json *frame, CurveTimeline *timeline, size_t frameIndex);
|
||||||
|
|
||||||
|
Animation *readAnimation(Json *root, SkeletonData *skeletonData);
|
||||||
|
|
||||||
|
void readVertices(Json *attachmentMap, VertexAttachment *attachment, size_t verticesLength);
|
||||||
|
|
||||||
|
void setError(Json *root, const String &value1, const String &value2);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_SkeletonJson_h */
|
||||||
+164
@@ -0,0 +1,164 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Skin_h
|
||||||
|
#define Spine_Skin_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Attachment;
|
||||||
|
|
||||||
|
class Skeleton;
|
||||||
|
class BoneData;
|
||||||
|
class ConstraintData;
|
||||||
|
|
||||||
|
/// Stores attachments by slot index and attachment name.
|
||||||
|
/// See SkeletonData::getDefaultSkin, Skeleton::getSkin, and
|
||||||
|
/// http://esotericsoftware.com/spine-runtime-skins in the Spine Runtimes Guide.
|
||||||
|
class SP_API Skin : public SpineObject {
|
||||||
|
friend class Skeleton;
|
||||||
|
|
||||||
|
public:
|
||||||
|
class SP_API AttachmentMap : public SpineObject {
|
||||||
|
friend class Skin;
|
||||||
|
|
||||||
|
public:
|
||||||
|
struct SP_API Entry {
|
||||||
|
size_t _slotIndex;
|
||||||
|
String _name;
|
||||||
|
Attachment *_attachment;
|
||||||
|
|
||||||
|
Entry(size_t slotIndex, const String &name, Attachment *attachment) :
|
||||||
|
_slotIndex(slotIndex),
|
||||||
|
_name(name),
|
||||||
|
_attachment(attachment) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class SP_API Entries {
|
||||||
|
friend class AttachmentMap;
|
||||||
|
|
||||||
|
public:
|
||||||
|
bool hasNext() {
|
||||||
|
while(true) {
|
||||||
|
if (_slotIndex >= _buckets.size()) return false;
|
||||||
|
if (_bucketIndex >= _buckets[_slotIndex].size()) {
|
||||||
|
_bucketIndex = 0;
|
||||||
|
++_slotIndex;
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Entry &next() {
|
||||||
|
Entry &result = _buckets[_slotIndex][_bucketIndex];
|
||||||
|
++_bucketIndex;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Entries(Vector< Vector<Entry> > &buckets) : _buckets(buckets), _slotIndex(0), _bucketIndex(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector< Vector<Entry> > &_buckets;
|
||||||
|
size_t _slotIndex;
|
||||||
|
size_t _bucketIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
void put(size_t slotIndex, const String &attachmentName, Attachment *attachment);
|
||||||
|
|
||||||
|
Attachment *get(size_t slotIndex, const String &attachmentName);
|
||||||
|
|
||||||
|
void remove(size_t slotIndex, const String &attachmentName);
|
||||||
|
|
||||||
|
Entries getEntries();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
AttachmentMap();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
int findInBucket(Vector <Entry> &, const String &attachmentName);
|
||||||
|
|
||||||
|
Vector <Vector<Entry> > _buckets;
|
||||||
|
};
|
||||||
|
|
||||||
|
explicit Skin(const String &name);
|
||||||
|
|
||||||
|
~Skin();
|
||||||
|
|
||||||
|
/// Adds an attachment to the skin for the specified slot index and name.
|
||||||
|
/// If the name already exists for the slot, the previous value is replaced.
|
||||||
|
void setAttachment(size_t slotIndex, const String &name, Attachment *attachment);
|
||||||
|
|
||||||
|
/// Returns the attachment for the specified slot index and name, or NULL.
|
||||||
|
Attachment *getAttachment(size_t slotIndex, const String &name);
|
||||||
|
|
||||||
|
// Removes the attachment from the skin.
|
||||||
|
void removeAttachment(size_t slotIndex, const String& name);
|
||||||
|
|
||||||
|
/// Finds the skin keys for a given slot. The results are added to the passed array of names.
|
||||||
|
/// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex
|
||||||
|
/// @param names Found skin key names will be added to this array.
|
||||||
|
void findNamesForSlot(size_t slotIndex, Vector <String> &names);
|
||||||
|
|
||||||
|
/// Finds the attachments for a given slot. The results are added to the passed array of Attachments.
|
||||||
|
/// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex
|
||||||
|
/// @param attachments Found Attachments will be added to this array.
|
||||||
|
void findAttachmentsForSlot(size_t slotIndex, Vector<Attachment *> &attachments);
|
||||||
|
|
||||||
|
const String &getName();
|
||||||
|
|
||||||
|
/// Adds all attachments, bones, and constraints from the specified skin to this skin.
|
||||||
|
void addSkin(Skin* other);
|
||||||
|
|
||||||
|
/// Adds all attachments, bones, and constraints from the specified skin to this skin. Attachments are deep copied.
|
||||||
|
void copySkin(Skin* other);
|
||||||
|
|
||||||
|
AttachmentMap::Entries getAttachments();
|
||||||
|
|
||||||
|
Vector<BoneData*>& getBones();
|
||||||
|
|
||||||
|
Vector<ConstraintData*>& getConstraints();
|
||||||
|
private:
|
||||||
|
const String _name;
|
||||||
|
AttachmentMap _attachments;
|
||||||
|
Vector<BoneData*> _bones;
|
||||||
|
Vector<ConstraintData*> _constraints;
|
||||||
|
|
||||||
|
/// Attach all attachments from this skin if the corresponding attachment from the old skin is currently attached.
|
||||||
|
void attachAll(Skeleton &skeleton, Skin &oldSkin);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Skin_h */
|
||||||
+129
@@ -0,0 +1,129 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Slot_h
|
||||||
|
#define Spine_Slot_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/Color.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SlotData;
|
||||||
|
|
||||||
|
class Bone;
|
||||||
|
|
||||||
|
class Skeleton;
|
||||||
|
|
||||||
|
class Attachment;
|
||||||
|
|
||||||
|
class SP_API Slot : public SpineObject {
|
||||||
|
friend class VertexAttachment;
|
||||||
|
|
||||||
|
friend class Skeleton;
|
||||||
|
|
||||||
|
friend class SkeletonBounds;
|
||||||
|
|
||||||
|
friend class SkeletonClipping;
|
||||||
|
|
||||||
|
friend class AttachmentTimeline;
|
||||||
|
|
||||||
|
friend class ColorTimeline;
|
||||||
|
|
||||||
|
friend class DeformTimeline;
|
||||||
|
|
||||||
|
friend class DrawOrderTimeline;
|
||||||
|
|
||||||
|
friend class EventTimeline;
|
||||||
|
|
||||||
|
friend class IkConstraintTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintMixTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintPositionTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintSpacingTimeline;
|
||||||
|
|
||||||
|
friend class ScaleTimeline;
|
||||||
|
|
||||||
|
friend class ShearTimeline;
|
||||||
|
|
||||||
|
friend class TransformConstraintTimeline;
|
||||||
|
|
||||||
|
friend class TranslateTimeline;
|
||||||
|
|
||||||
|
friend class TwoColorTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Slot(SlotData &data, Bone &bone);
|
||||||
|
|
||||||
|
void setToSetupPose();
|
||||||
|
|
||||||
|
SlotData &getData();
|
||||||
|
|
||||||
|
Bone &getBone();
|
||||||
|
|
||||||
|
Skeleton &getSkeleton();
|
||||||
|
|
||||||
|
Color &getColor();
|
||||||
|
|
||||||
|
Color &getDarkColor();
|
||||||
|
|
||||||
|
bool hasDarkColor();
|
||||||
|
|
||||||
|
/// May be NULL.
|
||||||
|
Attachment *getAttachment();
|
||||||
|
|
||||||
|
void setAttachment(Attachment *inValue);
|
||||||
|
|
||||||
|
int getAttachmentState();
|
||||||
|
|
||||||
|
void setAttachmentState(int state);
|
||||||
|
|
||||||
|
float getAttachmentTime();
|
||||||
|
|
||||||
|
void setAttachmentTime(float inValue);
|
||||||
|
|
||||||
|
Vector<float> &getDeform();
|
||||||
|
|
||||||
|
private:
|
||||||
|
SlotData &_data;
|
||||||
|
Bone &_bone;
|
||||||
|
Skeleton &_skeleton;
|
||||||
|
Color _color;
|
||||||
|
Color _darkColor;
|
||||||
|
bool _hasDarkColor;
|
||||||
|
Attachment *_attachment;
|
||||||
|
int _attachmentState;
|
||||||
|
float _attachmentTime;
|
||||||
|
Vector<float> _deform;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Slot_h */
|
||||||
+113
@@ -0,0 +1,113 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_SlotData_h
|
||||||
|
#define Spine_SlotData_h
|
||||||
|
|
||||||
|
#include <spine/BlendMode.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/Color.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class BoneData;
|
||||||
|
|
||||||
|
class SP_API SlotData : public SpineObject {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class AttachmentTimeline;
|
||||||
|
|
||||||
|
friend class ColorTimeline;
|
||||||
|
|
||||||
|
friend class DeformTimeline;
|
||||||
|
|
||||||
|
friend class DrawOrderTimeline;
|
||||||
|
|
||||||
|
friend class EventTimeline;
|
||||||
|
|
||||||
|
friend class IkConstraintTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintMixTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintPositionTimeline;
|
||||||
|
|
||||||
|
friend class PathConstraintSpacingTimeline;
|
||||||
|
|
||||||
|
friend class ScaleTimeline;
|
||||||
|
|
||||||
|
friend class ShearTimeline;
|
||||||
|
|
||||||
|
friend class TransformConstraintTimeline;
|
||||||
|
|
||||||
|
friend class TranslateTimeline;
|
||||||
|
|
||||||
|
friend class TwoColorTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
SlotData(int index, const String &name, BoneData &boneData);
|
||||||
|
|
||||||
|
int getIndex();
|
||||||
|
|
||||||
|
const String &getName();
|
||||||
|
|
||||||
|
BoneData &getBoneData();
|
||||||
|
|
||||||
|
Color &getColor();
|
||||||
|
|
||||||
|
Color &getDarkColor();
|
||||||
|
|
||||||
|
bool hasDarkColor();
|
||||||
|
|
||||||
|
void setHasDarkColor(bool inValue);
|
||||||
|
|
||||||
|
/// May be empty.
|
||||||
|
const String &getAttachmentName();
|
||||||
|
|
||||||
|
void setAttachmentName(const String &inValue);
|
||||||
|
|
||||||
|
BlendMode getBlendMode();
|
||||||
|
|
||||||
|
void setBlendMode(BlendMode inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
const int _index;
|
||||||
|
String _name;
|
||||||
|
BoneData &_boneData;
|
||||||
|
Color _color;
|
||||||
|
Color _darkColor;
|
||||||
|
|
||||||
|
bool _hasDarkColor;
|
||||||
|
String _attachmentName;
|
||||||
|
BlendMode _blendMode;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_SlotData_h */
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_SpacingMode_h
|
||||||
|
#define Spine_SpacingMode_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum SpacingMode {
|
||||||
|
SpacingMode_Length = 0,
|
||||||
|
SpacingMode_Fixed,
|
||||||
|
SpacingMode_Percent
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_SpacingMode_h */
|
||||||
+59
@@ -0,0 +1,59 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Object_h
|
||||||
|
#define Spine_Object_h
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include <spine/dll.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class String;
|
||||||
|
|
||||||
|
class SP_API SpineObject {
|
||||||
|
public:
|
||||||
|
void *operator new(size_t sz);
|
||||||
|
|
||||||
|
void *operator new(size_t sz, const char *file, int line);
|
||||||
|
|
||||||
|
void *operator new(size_t sz, void *ptr);
|
||||||
|
|
||||||
|
void operator delete(void *p, const char *file, int line);
|
||||||
|
|
||||||
|
void operator delete(void *p, void *mem);
|
||||||
|
|
||||||
|
void operator delete(void *p);
|
||||||
|
|
||||||
|
virtual ~SpineObject();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
+212
@@ -0,0 +1,212 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef SPINE_STRING_H
|
||||||
|
#define SPINE_STRING_H
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/Extension.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
// Required for sprintf on MSVC
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4996)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class SP_API String : public SpineObject {
|
||||||
|
public:
|
||||||
|
String() : _length(0), _buffer(NULL) {
|
||||||
|
}
|
||||||
|
|
||||||
|
String(const char *chars, bool own = false) {
|
||||||
|
if (!chars) {
|
||||||
|
_length = 0;
|
||||||
|
_buffer = NULL;
|
||||||
|
} else {
|
||||||
|
_length = strlen(chars);
|
||||||
|
if (!own) {
|
||||||
|
_buffer = SpineExtension::calloc<char>(_length + 1, __FILE__, __LINE__);
|
||||||
|
memcpy((void *) _buffer, chars, _length + 1);
|
||||||
|
} else {
|
||||||
|
_buffer = (char *) chars;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String(const String &other) {
|
||||||
|
if (!other._buffer) {
|
||||||
|
_length = 0;
|
||||||
|
_buffer = NULL;
|
||||||
|
} else {
|
||||||
|
_length = other._length;
|
||||||
|
_buffer = SpineExtension::calloc<char>(other._length + 1, __FILE__, __LINE__);
|
||||||
|
memcpy((void *) _buffer, other._buffer, other._length + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t length() const {
|
||||||
|
return _length;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isEmpty() const {
|
||||||
|
return _length == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *buffer() const {
|
||||||
|
return _buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void own(const String &other) {
|
||||||
|
if (this == &other) return;
|
||||||
|
if (_buffer) {
|
||||||
|
SpineExtension::free(_buffer, __FILE__, __LINE__);
|
||||||
|
}
|
||||||
|
_length = other._length;
|
||||||
|
_buffer = other._buffer;
|
||||||
|
other._length = 0;
|
||||||
|
other._buffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void own(const char *chars) {
|
||||||
|
if (_buffer == chars) return;
|
||||||
|
if (_buffer) {
|
||||||
|
SpineExtension::free(_buffer, __FILE__, __LINE__);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!chars) {
|
||||||
|
_length = 0;
|
||||||
|
_buffer = NULL;
|
||||||
|
} else {
|
||||||
|
_length = strlen(chars);
|
||||||
|
_buffer = (char *) chars;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void unown() {
|
||||||
|
_length = 0;
|
||||||
|
_buffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
String &operator=(const String &other) {
|
||||||
|
if (this == &other) return *this;
|
||||||
|
if (_buffer) {
|
||||||
|
SpineExtension::free(_buffer, __FILE__, __LINE__);
|
||||||
|
}
|
||||||
|
if (!other._buffer) {
|
||||||
|
_length = 0;
|
||||||
|
_buffer = NULL;
|
||||||
|
} else {
|
||||||
|
_length = other._length;
|
||||||
|
_buffer = SpineExtension::calloc<char>(other._length + 1, __FILE__, __LINE__);
|
||||||
|
memcpy((void *) _buffer, other._buffer, other._length + 1);
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
String &operator=(const char *chars) {
|
||||||
|
if (_buffer == chars) return *this;
|
||||||
|
if (_buffer) {
|
||||||
|
SpineExtension::free(_buffer, __FILE__, __LINE__);
|
||||||
|
}
|
||||||
|
if (!chars) {
|
||||||
|
_length = 0;
|
||||||
|
_buffer = NULL;
|
||||||
|
} else {
|
||||||
|
_length = strlen(chars);
|
||||||
|
_buffer = SpineExtension::calloc<char>(_length + 1, __FILE__, __LINE__);
|
||||||
|
memcpy((void *) _buffer, chars, _length + 1);
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
String &append(const char *chars) {
|
||||||
|
size_t len = strlen(chars);
|
||||||
|
size_t thisLen = _length;
|
||||||
|
_length = _length + len;
|
||||||
|
bool same = chars == _buffer;
|
||||||
|
_buffer = SpineExtension::realloc(_buffer, _length + 1, __FILE__, __LINE__);
|
||||||
|
memcpy((void *) (_buffer + thisLen), (void *) (same ? _buffer : chars), len + 1);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
String &append(const String &other) {
|
||||||
|
size_t len = other.length();
|
||||||
|
size_t thisLen = _length;
|
||||||
|
_length = _length + len;
|
||||||
|
bool same = other._buffer == _buffer;
|
||||||
|
_buffer = SpineExtension::realloc(_buffer, _length + 1, __FILE__, __LINE__);
|
||||||
|
memcpy((void *) (_buffer + thisLen), (void *) (same ? _buffer : other._buffer), len + 1);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
String &append(int other) {
|
||||||
|
char str[100];
|
||||||
|
sprintf(str, "%i", other);
|
||||||
|
append(str);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
String &append(float other) {
|
||||||
|
char str[100];
|
||||||
|
sprintf(str, "%f", other);
|
||||||
|
append(str);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
friend bool operator==(const String &a, const String &b) {
|
||||||
|
if (a._buffer == b._buffer) return true;
|
||||||
|
if (a._length != b._length) return false;
|
||||||
|
if (a._buffer && b._buffer) {
|
||||||
|
return strcmp(a._buffer, b._buffer) == 0;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
friend bool operator!=(const String &a, const String &b) {
|
||||||
|
return !(a == b);
|
||||||
|
}
|
||||||
|
|
||||||
|
~String() {
|
||||||
|
if (_buffer) {
|
||||||
|
SpineExtension::free(_buffer, __FILE__, __LINE__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
mutable size_t _length;
|
||||||
|
mutable char *_buffer;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif //SPINE_STRING_H
|
||||||
Vendored
+51
@@ -0,0 +1,51 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_TextureLoader_h
|
||||||
|
#define Spine_TextureLoader_h
|
||||||
|
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class AtlasPage;
|
||||||
|
|
||||||
|
class SP_API TextureLoader : public SpineObject {
|
||||||
|
public:
|
||||||
|
TextureLoader();
|
||||||
|
|
||||||
|
virtual ~TextureLoader();
|
||||||
|
|
||||||
|
virtual void load(AtlasPage& page, const String& path) = 0;
|
||||||
|
|
||||||
|
virtual void unload(void* texture) = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_TextureLoader_h */
|
||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_Timeline_h
|
||||||
|
#define Spine_Timeline_h
|
||||||
|
|
||||||
|
#include <spine/RTTI.h>
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/MixBlend.h>
|
||||||
|
#include <spine/MixDirection.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class Skeleton;
|
||||||
|
|
||||||
|
class Event;
|
||||||
|
|
||||||
|
class SP_API Timeline : public SpineObject {
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
Timeline();
|
||||||
|
|
||||||
|
virtual ~Timeline();
|
||||||
|
|
||||||
|
/// Sets the value(s) for the specified time.
|
||||||
|
/// @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change.
|
||||||
|
/// @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive).
|
||||||
|
/// @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys.
|
||||||
|
/// @param pEvents If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL.
|
||||||
|
/// @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline
|
||||||
|
/// value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting alpha over
|
||||||
|
/// time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layered).
|
||||||
|
/// @param blend Controls how mixing is applied when alpha is than 1.
|
||||||
|
/// @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
|
||||||
|
virtual void
|
||||||
|
apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha, MixBlend blend,
|
||||||
|
MixDirection direction) = 0;
|
||||||
|
|
||||||
|
virtual int getPropertyId() = 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_Timeline_h */
|
||||||
Vendored
+53
@@ -0,0 +1,53 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_TimelineType_h
|
||||||
|
#define Spine_TimelineType_h
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
enum TimelineType {
|
||||||
|
TimelineType_Rotate = 0,
|
||||||
|
TimelineType_Translate,
|
||||||
|
TimelineType_Scale,
|
||||||
|
TimelineType_Shear,
|
||||||
|
TimelineType_Attachment,
|
||||||
|
TimelineType_Color,
|
||||||
|
TimelineType_Deform,
|
||||||
|
TimelineType_Event,
|
||||||
|
TimelineType_DrawOrder,
|
||||||
|
TimelineType_IkConstraint,
|
||||||
|
TimelineType_TransformConstraint,
|
||||||
|
TimelineType_PathConstraintPosition,
|
||||||
|
TimelineType_PathConstraintSpacing,
|
||||||
|
TimelineType_PathConstraintMix,
|
||||||
|
TimelineType_TwoColor
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_TimelineType_h */
|
||||||
Vendored
+97
@@ -0,0 +1,97 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_TransformConstraint_h
|
||||||
|
#define Spine_TransformConstraint_h
|
||||||
|
|
||||||
|
#include <spine/ConstraintData.h>
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class TransformConstraintData;
|
||||||
|
class Skeleton;
|
||||||
|
class Bone;
|
||||||
|
|
||||||
|
class SP_API TransformConstraint : public Updatable {
|
||||||
|
friend class Skeleton;
|
||||||
|
friend class TransformConstraintTimeline;
|
||||||
|
|
||||||
|
RTTI_DECL
|
||||||
|
|
||||||
|
public:
|
||||||
|
TransformConstraint(TransformConstraintData& data, Skeleton& skeleton);
|
||||||
|
|
||||||
|
void apply();
|
||||||
|
|
||||||
|
virtual void update();
|
||||||
|
|
||||||
|
virtual int getOrder();
|
||||||
|
|
||||||
|
TransformConstraintData& getData();
|
||||||
|
|
||||||
|
Vector<Bone*>& getBones();
|
||||||
|
|
||||||
|
Bone* getTarget();
|
||||||
|
void setTarget(Bone* inValue);
|
||||||
|
|
||||||
|
float getRotateMix();
|
||||||
|
void setRotateMix(float inValue);
|
||||||
|
|
||||||
|
float getTranslateMix();
|
||||||
|
void setTranslateMix(float inValue);
|
||||||
|
|
||||||
|
float getScaleMix();
|
||||||
|
void setScaleMix(float inValue);
|
||||||
|
|
||||||
|
float getShearMix();
|
||||||
|
void setShearMix(float inValue);
|
||||||
|
|
||||||
|
bool isActive();
|
||||||
|
|
||||||
|
void setActive(bool inValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
TransformConstraintData& _data;
|
||||||
|
Vector<Bone*> _bones;
|
||||||
|
Bone* _target;
|
||||||
|
float _rotateMix, _translateMix, _scaleMix, _shearMix;
|
||||||
|
bool _active;
|
||||||
|
|
||||||
|
void applyAbsoluteWorld();
|
||||||
|
|
||||||
|
void applyRelativeWorld();
|
||||||
|
|
||||||
|
void applyAbsoluteLocal();
|
||||||
|
|
||||||
|
void applyRelativeLocal();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_TransformConstraint_h */
|
||||||
+78
@@ -0,0 +1,78 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* Spine Runtimes License Agreement
|
||||||
|
* Last updated January 1, 2020. Replaces all prior versions.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013-2020, 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.
|
||||||
|
*
|
||||||
|
* THE SPINE RUNTIMES ARE 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
|
||||||
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef Spine_TransformConstraintData_h
|
||||||
|
#define Spine_TransformConstraintData_h
|
||||||
|
|
||||||
|
#include <spine/Vector.h>
|
||||||
|
#include <spine/SpineObject.h>
|
||||||
|
#include <spine/SpineString.h>
|
||||||
|
#include <spine/ConstraintData.h>
|
||||||
|
|
||||||
|
namespace spine {
|
||||||
|
class BoneData;
|
||||||
|
|
||||||
|
class SP_API TransformConstraintData : public ConstraintData {
|
||||||
|
friend class SkeletonBinary;
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
|
friend class TransformConstraint;
|
||||||
|
friend class Skeleton;
|
||||||
|
friend class TransformConstraintTimeline;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit TransformConstraintData(const String& name);
|
||||||
|
|
||||||
|
Vector<BoneData*>& getBones();
|
||||||
|
BoneData* getTarget();
|
||||||
|
float getRotateMix();
|
||||||
|
float getTranslateMix();
|
||||||
|
float getScaleMix();
|
||||||
|
float getShearMix();
|
||||||
|
|
||||||
|
float getOffsetRotation();
|
||||||
|
float getOffsetX();
|
||||||
|
float getOffsetY();
|
||||||
|
float getOffsetScaleX();
|
||||||
|
float getOffsetScaleY();
|
||||||
|
float getOffsetShearY();
|
||||||
|
|
||||||
|
bool isRelative();
|
||||||
|
bool isLocal();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Vector<BoneData*> _bones;
|
||||||
|
BoneData* _target;
|
||||||
|
float _rotateMix, _translateMix, _scaleMix, _shearMix;
|
||||||
|
float _offsetRotation, _offsetX, _offsetY, _offsetScaleX, _offsetScaleY, _offsetShearY;
|
||||||
|
bool _relative, _local;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* Spine_TransformConstraintData_h */
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user