Compare commits

..
63 Commits
Author SHA1 Message Date
Yeomai 98f44890f8 Revert "编译windows版本连接器"
This reverts commit 97e6713cfd.
2026-11-07 22:52:01 +08:00
Yeomai 97e6713cfd 编译windows版本连接器 2026-11-07 22:49:13 +08:00
tianmo e626e685fc 修正 2026-11-07 15:12:13 +08:00
tianmo b3e9481fe5 开关设置 2026-11-05 18:04:57 +08:00
tianmo 98e5c435c8 更新版本记录 2026-11-05 17:39:39 +08:00
tianmo 8977463861 跟随导出效果 2026-11-04 17:45:21 +08:00
tianmo 517e92a00b 公告栏修正 2026-11-04 11:15:47 +08:00
tianmo 87d6561779 公告栏 2026-11-04 10:55:40 +08:00
tianmo 720e3e0ceb 俄语支持 2026-11-04 10:21:57 +08:00
tianmo 753e3b1e21 网页优化 2026-10-31 15:26:31 +08:00
tianmo ab32146e8d 新增欢迎页 2026-10-31 11:48:29 +08:00
tianmo a11d57f27f 默认序列帧修改 2026-10-30 19:27:27 +08:00
tianmo 5efee6d918 资源整理 2026-10-30 19:10:29 +08:00
tianmo 7062a60c73 显示修正 2026-10-29 18:49:55 +08:00
tianmo bae179eb93 功能修复 2026-10-29 18:43:11 +08:00
tianmo fed1015849 优化碰撞识别,加入暖场帧数 2026-10-29 17:20:05 +08:00
tianmo b8652acce0 增加报表 2026-10-28 16:13:18 +08:00
tianmo ca719ba1d4 加入追踪 2026-10-28 14:32:52 +08:00
tianmo 859c78173a 加入网站追踪 2026-10-28 14:26:04 +08:00
tianmo c93ec671da 混淆
使用 javascript-obfuscator 做标识符重命名、字符串数组编码和常量拆分。
在 vite build 后增加生产环境混淆步骤,开发环境保持源码可读。
关闭 sourcemap,避免直接暴露原始源码。
当前主包约 1.7 MB,建议先拆出第三方依赖,再只混淆应用自身代码,而不是整个 dist。
2026-10-27 16:40:33 +08:00
tianmo 5f7e30063b 位置修正 2026-10-27 16:06:22 +08:00
tianmo 67bf3921cc 收缩按钮 2026-10-27 16:02:18 +08:00
tianmo 0f578d29a4 独立显示修正 2026-10-26 10:26:17 +08:00
tianmo 7069b168de 面板布局更新 2026-10-24 19:30:32 +08:00
tianmo a417c9119d 悬浮导航 2026-10-24 18:52:25 +08:00
tianmo cffbd49eff 体积显示 2026-10-23 11:55:40 +08:00
tianmo 46083c8d2a 完善浏览器配置库与未保存提示
- 新增 IndexedDB 配置保存、加载、删除及批量导入导出

- 配置列表支持选中、双击加载和悬浮操作提示

- 新增未保存提示设置,默认关闭并持久化到浏览器

- 优化配置管理界面并同步九种语言文案

- 更新开发文档与生产构建产物
2026-10-23 11:48:21 +08:00
tianmo 8bd9154414 多语言调整 2026-10-22 18:51:26 +08:00
tianmo 04de5e5a8e 多国语言支持 2026-10-22 18:37:30 +08:00
tianmo b98c0333e6 中英双语 2026-10-22 18:13:43 +08:00
tianmo ea26af26ee 文档完善 2026-10-22 17:23:38 +08:00
tianmo 5d12bf895b 修复导出问题 2026-10-22 17:19:09 +08:00
tianmo d224939efd 子发射器 2026-10-22 16:49:53 +08:00
tianmo d4ebb18777 新编译 2026-10-22 14:14:43 +08:00
tianmo 2b8fd067b3 轴点功能修复 2026-10-22 12:04:29 +08:00
tianmo 4d54c87681 贴图轴点 2026-10-22 11:46:00 +08:00
tianmo c041503004 渲染顺序功能 2026-10-22 11:16:50 +08:00
tianmo aabf4ff693 修改粒子命名规则 2026-10-14 18:35:26 +08:00
tianmo 1ecbb6fc48 飞牛部署文档 2026-10-10 15:35:51 +08:00
tianmo 61b93f590c 新增飞牛 fpk 打包部署文档与 1.0.2 安装包
- Document/飞牛fpk打包与部署.md:记录 fnpack 准备、改版本号、npm run pack:fnos 打包、安装到 fnOS、装完必查项、常见排障与上架前待办;并记下入口形态从 CGI 改为端口服务的原因(CGI 入口在目标设备上桌面图标不注册、「打开」无反应)
- release/fnos/SpineParticle-1.0.2.fpk:端口服务形态安装包,service_port=27850、依赖 nodejs_v22,桌面图标与「打开」正常,包内自带 Windows/macOS 连接器下载物
- 打包用源码暂未入库,仅保留安装包与文档

影响面:飞牛端新增应用包与文档,网页端代码未改动。
2026-10-10 15:27:56 +08:00
tianmo 7745f0de1b Merge branch 'main' of http://gitlab.yeomai.site/Yeomai/SpineParticlesWeb 2026-10-09 17:23:01 +08:00
tianmo 2ba2b9c08a 时间轴交互与预览修正
- 界面文字全局禁止鼠标框选,输入类控件保留可选中
- 拖动时间轴立即暂停自动播放,避免与播放头抢时间轴
- 暂停时补齐未完成的帧缓存,拖动时间轴直接读取已烘焙帧,无需重新触发播放
- 循环持续的烘焙不再依赖从第 0 帧开始录制,避免整段缓存为空
2026-10-09 17:22:36 +08:00
tianmo 0f08224e1c Changes to be committed:
modified:   src/style.css
	modified:   src/views/Stage.vue
	modified:   src/views/Timeline.vue
2026-10-09 17:21:34 +08:00
tianmo d6232c9d66 修正时间轴末帧,导出补阶跃与循环段边界关键帧
- 时间轴:末帧按时长实际覆盖的整数帧计算,修掉 Spine 时长小数舍入多出的一帧,B 端与回放自动停在最后一帧
- 导出:粒子死亡、骨骼池复用、拖尾假死复活处统一写 curve: stepped 硬切,避免死区插值出滑动轨迹
- 导出:循环持续在开始/循环/结束段边界(如 30f/110f)对所有动画通道补关键帧,便于在 Spine 中直接拆分
- 精简器支持阶跃段,阶跃区间内不再补出过渡关键帧
- 补充 test:spine-json 回归用例:骨骼池复用阶跃边界、循环段边界
2026-10-09 17:05:53 +08:00
tianmo f249c019bc 资源整理 2026-09-22 17:30:38 +08:00
tianmo f54e90c21a 预设修改 2026-09-22 17:21:49 +08:00
tianmo abb4ac4acc 预设修改 2026-09-22 17:17:39 +08:00
tianmo 4f2c980bac 修改预设,力场形状显示开关 2026-09-22 16:58:44 +08:00
tianmo 5f3a4a33fe 增加涡流修改器 2026-09-22 15:58:28 +08:00
tianmo 3f2699a946 添加形状显示开关,修改默认参数 2026-09-22 14:42:21 +08:00
tianmo aadcf5cbcf 增加预设 2026-09-22 14:26:40 +08:00
tianmo bf78477a66 Merge branch 'main' of http://gitlab.yeomai.site/Yeomai/SpineParticlesWeb 2026-09-14 17:30:49 +08:00
tianmo d629443ac1 预设修改 2026-09-14 17:30:29 +08:00
Yeomai 32a594dd8a 帮助说明修改 2026-09-13 00:34:44 +08:00
tianmo 6de6e2cf5b 导出修正 2026-09-12 12:17:26 +08:00
tianmo ee72d09b23 代码拆分 2026-09-12 11:53:12 +08:00
tianmo 8bf16fe09f 通用架构安装包 2026-09-11 10:09:45 +08:00
tianmo 83890faaea 资源拆分 2026-09-11 10:00:38 +08:00
tianmo f810e712ec Merge branch 'main' of http://gitlab.yeomai.site/Yeomai/SpineParticlesWeb 2026-09-11 10:00:19 +08:00
tianmo 8ab3672c4e 粒子连接器修改 2026-09-11 10:00:16 +08:00
Yeomai 5efc608835 windows发行版 2026-09-08 00:09:17 +08:00
Yeomai bd0771747d 新增windows支持 2026-09-07 23:48:20 +08:00
tianmo 6837ecada9 加入5套spine官方运行时 2026-09-07 21:40:29 +08:00
1293 changed files with 202697 additions and 13120 deletions

No files matched your search

+14 -4
View File
@@ -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)
@@ -74,19 +76,27 @@ if(DTS_BUILD_GUI)
if(DTS_BUILD_RUNTIME_PLUGINS) if(DTS_BUILD_RUNTIME_PLUGINS)
add_dependencies(DateToSpine add_dependencies(DateToSpine
dts_runtime_38 dts_runtime_40 dts_runtime_41 dts_runtime_42 dts_runtime_43) dts_runtime_38 dts_runtime_40 dts_runtime_41 dts_runtime_42 dts_runtime_43)
# Runtime plugin destination differs by platform:
# - macOS: inside the .app bundle (Contents/PlugIns/runtimes)
# - Windows/other: alongside the executable
if(APPLE)
set(DTS_RUNTIME_PLUGIN_DIR "$<TARGET_BUNDLE_DIR:DateToSpine>/Contents/PlugIns/runtimes")
else()
set(DTS_RUNTIME_PLUGIN_DIR "$<TARGET_FILE_DIR:DateToSpine>/runtimes")
endif()
foreach(runtime_line IN ITEMS 38 40 41 42 43) foreach(runtime_line IN ITEMS 38 40 41 42 43)
add_custom_command(TARGET dts_runtime_${runtime_line} POST_BUILD add_custom_command(TARGET dts_runtime_${runtime_line} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory COMMAND ${CMAKE_COMMAND} -E make_directory
"$<TARGET_BUNDLE_DIR:DateToSpine>/Contents/PlugIns/runtimes" "${DTS_RUNTIME_PLUGIN_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:dts_runtime_${runtime_line}>" "$<TARGET_FILE:dts_runtime_${runtime_line}>"
"$<TARGET_BUNDLE_DIR:DateToSpine>/Contents/PlugIns/runtimes/") "${DTS_RUNTIME_PLUGIN_DIR}/")
add_custom_command(TARGET DateToSpine POST_BUILD add_custom_command(TARGET DateToSpine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory COMMAND ${CMAKE_COMMAND} -E make_directory
"$<TARGET_BUNDLE_DIR:DateToSpine>/Contents/PlugIns/runtimes" "${DTS_RUNTIME_PLUGIN_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:dts_runtime_${runtime_line}>" "$<TARGET_FILE:dts_runtime_${runtime_line}>"
"$<TARGET_BUNDLE_DIR:DateToSpine>/Contents/PlugIns/runtimes/") "${DTS_RUNTIME_PLUGIN_DIR}/")
endforeach() endforeach()
endif() endif()
endif() endif()
@@ -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")
+2
View File
@@ -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
+4 -3
View File
@@ -15,9 +15,10 @@ Spine Editor 是外部前置软件。DateToSpine 不控制 Editor 自身的授
## 2. 构建期与运行期网络 ## 2. 构建期与运行期网络
- 开发机可以联网取得依赖和官方测试资源。 - 五套正式 Spine Runtime 源码直接随主仓库提供,不使用 Submodule、FetchContent 或构建期下载。
- 正式依赖必须锁定版本和校验值。 - 内网环境克隆主仓库后即可取得完整 Runtime;若文件缺失,CMake 直接报错,不尝试联网补齐。
- 可复现构建应支持从内部或本地依赖缓存构建。 - Qt、CMake 和编译器属于预先安装的构建工具,不由本项目联网安装。
- 官方测试资源只存在于开发源码树,不进入最终安装包。
- 最终应用运行时不得使用网络。 - 最终应用运行时不得使用网络。
- CI 下载的官方测试资源不进入打包阶段的输入集合。 - CI 下载的官方测试资源不进入打包阶段的输入集合。
+1
View File
@@ -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 自动识别失败时请求路径。
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,26 @@
Spine Runtimes License Agreement
Last updated April 5, 2025. Replaces all prior versions.
Copyright (c) 2013-2025, 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:
https://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.
Binary file not shown.
+4 -2
View File
@@ -39,9 +39,11 @@ EditorProbeResult SpineOutputParser::parse(
static const std::regex launcher(R"(Spine Launcher\s+(\d+\.\d+(?:\.\d+)?))"); static const std::regex launcher(R"(Spine Launcher\s+(\d+\.\d+(?:\.\d+)?))");
static const std::regex launching( static const std::regex launching(
R"((?:Launching:|Starting:)\s*Spine\s+(\d+\.\d+(?:\.\d+)?)(?:\s+([^\r\n]+))?)"); R"((?:Launching:|Starting:)\s*Spine\s+(\d+\.\d+(?:\.\d+)?)(?:\s+([^\r\n]+))?)");
// MSVC's std::regex does not implement std::regex_constants::multiline,
// so instead of relying on the '^' line anchor with the multiline flag,
// search for "Spine <version>" anywhere (regex_search scans the whole text).
static const std::regex directEditor( static const std::regex directEditor(
R"(^Spine\s+(\d+\.\d+(?:\.\d+)?)(?:\s+([^\r\n]+))?)", R"(Spine\s+(\d+\.\d+(?:\.\d+)?)(?:\s+([^\r\n]+))?)");
std::regex_constants::multiline);
result.launcherVersion = firstVersion(process.output, launcher); result.launcherVersion = firstVersion(process.output, launcher);
result.editorVersion = firstVersion(process.output, launching, &result.edition); result.editorVersion = firstVersion(process.output, launching, &result.edition);
@@ -17,6 +17,10 @@ std::vector<fs::path> SpineVersionAvailability::defaultCacheRoots() const {
roots.emplace_back(fs::path(roaming) / "Spine/updates"); roots.emplace_back(fs::path(roaming) / "Spine/updates");
if (const char* local = std::getenv("LOCALAPPDATA")) if (const char* local = std::getenv("LOCALAPPDATA"))
roots.emplace_back(fs::path(local) / "Spine/updates"); roots.emplace_back(fs::path(local) / "Spine/updates");
// Spine Launcher also keeps its update cache directly under the user's
// profile directory (e.g. C:\Users\<name>\Spine\updates).
if (const char* userProfile = std::getenv("USERPROFILE"))
roots.emplace_back(fs::path(userProfile) / "Spine/updates");
#endif #endif
return roots; return roots;
} }
+123 -13
View File
@@ -3,7 +3,9 @@
#include "atlas/AtlasParser.hpp" #include "atlas/AtlasParser.hpp"
#include "conversion/ConversionJob.hpp" #include "conversion/ConversionJob.hpp"
#include "editor/SpineEditorLocator.hpp" #include "editor/SpineEditorLocator.hpp"
#include "editor/SpineProbe.hpp"
#include "editor/SpineVersionAvailability.hpp" #include "editor/SpineVersionAvailability.hpp"
#include "platform/ProcessRunner.hpp"
#include "scan/SpineDataVersionDetector.hpp" #include "scan/SpineDataVersionDetector.hpp"
#include "ui/SpinePreviewWidget.hpp" #include "ui/SpinePreviewWidget.hpp"
@@ -23,6 +25,7 @@
#include <QPushButton> #include <QPushButton>
#include <QSettings> #include <QSettings>
#include <QTimer> #include <QTimer>
#include <QtConcurrent/QtConcurrent>
#include <QUrl> #include <QUrl>
#include <QVBoxLayout> #include <QVBoxLayout>
@@ -134,38 +137,69 @@ void MainWindow::setupUi() {
connect(convertButton_, &QPushButton::clicked, this, &MainWindow::convertCurrent); connect(convertButton_, &QPushButton::clicked, this, &MainWindow::convertCurrent);
previewTimer_ = new QTimer(this); previewTimer_ = new QTimer(this);
previewTimer_->setInterval(16); previewTimer_->setInterval(16);
previewTimer_->setTimerType(Qt::PreciseTimer);
connect(previewTimer_, &QTimer::timeout, this, &MainWindow::advancePreview); connect(previewTimer_, &QTimer::timeout, this, &MainWindow::advancePreview);
editorProbeWatcher_ = new QFutureWatcher<QPair<int, QString>>(this);
connect(editorProbeWatcher_,
&QFutureWatcher<QPair<int, QString>>::finished,
this, &MainWindow::onEditorProbeFinished);
} }
void MainWindow::showEmptyState() { void MainWindow::showEmptyState() {
previewWidget_->resetViewport(); previewWidget_->resetViewport();
previewWidget_->setMessage( previewWidget_->setMessage(
tr("把 .json / .skel、.atlas 和图片拖到这里\n\n也可以拖入整个资源文件夹")); tr("把 .json / .skel / .skel.bytes、.atlas / .atlas.txt 和图片拖到这里\n\n也可以拖入整个资源文件夹"));
statusLabel_->clear(); statusLabel_->clear();
} }
void MainWindow::chooseResources() { void MainWindow::chooseResources() {
const auto paths = QFileDialog::getOpenFileNames(this, tr("选择导出资源"), {}, const auto paths = QFileDialog::getOpenFileNames(this, tr("选择导出资源"), {},
tr("Spine 资源 (*.json *.skel *.atlas *.png *.jpg *.jpeg *.webp);;所有文件 (*)")); tr("Spine 资源 (*.json *.skel *.skel.bytes *.atlas *.atlas.txt *.png *.jpg *.jpeg *.webp);;所有文件 (*)"));
for (const auto& path : paths) addInput(path); for (const auto& path : paths) addInput(path);
} }
void MainWindow::addInput(const QString& path) { void MainWindow::addInput(const QString& path) {
const QFileInfo info(path); const QFileInfo info(path);
const auto scanDirectory = [this](const QString& directory, bool recursive) { const auto scanDirectory = [this](const QString& directory, bool recursive, bool warnUnsupported) {
QDirIterator iterator(directory, {"*.json", "*.skel"}, QDir::Files, QDirIterator iterator(directory, {"*.json", "*.skel", "*.skel.bytes"}, QDir::Files,
recursive ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags); recursive ? QDirIterator::Subdirectories : QDirIterator::NoIteratorFlags);
while (iterator.hasNext()) addSkeleton(iterator.next()); while (iterator.hasNext()) addSkeleton(iterator.next(), warnUnsupported);
}; };
if (info.isDir()) scanDirectory(path, true); // Only the primary skeleton data (.json / .skel / .skel.bytes) carries a
// Spine version and should trigger the "unsupported version" warning.
// Companion files (.atlas / .atlas.txt / images) have no version of their
// own, so they must not cause a version check when scanned for a skeleton.
if (info.isDir()) scanDirectory(path, true, true);
else if (info.suffix().compare("json", Qt::CaseInsensitive) == 0 else if (info.suffix().compare("json", Qt::CaseInsensitive) == 0
|| info.suffix().compare("skel", Qt::CaseInsensitive) == 0) addSkeleton(path); || info.suffix().compare("skel", Qt::CaseInsensitive) == 0
else scanDirectory(info.absolutePath(), false); || info.completeSuffix().compare("skel.bytes", Qt::CaseInsensitive) == 0) addSkeleton(path, true);
else scanDirectory(info.absolutePath(), false, false);
scheduleAvailabilityCheck(); scheduleAvailabilityCheck();
} }
void MainWindow::addSkeleton(const QString& path) { void MainWindow::addSkeleton(const QString& path, bool warnInvalid) {
const auto result = SpineDataVersionDetector{}.inspect(localPath(path)); const auto result = SpineDataVersionDetector{}.inspect(localPath(path));
if (result.status == VersionDetectionStatus::UnsupportedVersion) {
if (warnInvalid) {
const auto version = result.version
? QString::fromStdString(result.version->toString()) : tr("未知");
pendingVersionWarnings_.append(
tr("%1(版本 %2)").arg(QFileInfo(path).fileName(), version));
// Defer to the event loop so multiple unsupported files in a single
// import are collected and reported with one dialog.
QTimer::singleShot(0, this, &MainWindow::showUnsupportedVersionWarning);
}
return;
}
if (result.status == VersionDetectionStatus::InvalidData
|| result.status == VersionDetectionStatus::FileMissing) {
if (warnInvalid) {
pendingInvalidAssets_.append(QFileInfo(path).fileName());
QTimer::singleShot(0, this, &MainWindow::showInvalidAssetWarning);
}
return;
}
if (result.status != VersionDetectionStatus::Detected || skeletonPaths_.contains(path)) return; if (result.status != VersionDetectionStatus::Detected || skeletonPaths_.contains(path)) return;
skeletonPaths_.append(path); skeletonPaths_.append(path);
resourceCombo_->addItem(QFileInfo(path).completeBaseName(), path); resourceCombo_->addItem(QFileInfo(path).completeBaseName(), path);
@@ -173,6 +207,32 @@ void MainWindow::addSkeleton(const QString& path) {
resourceCombo_->setCurrentIndex(resourceCombo_->count() - 1); resourceCombo_->setCurrentIndex(resourceCombo_->count() - 1);
} }
void MainWindow::showUnsupportedVersionWarning() {
if (pendingVersionWarnings_.isEmpty()) return;
// Deduplicate so the same resource reported multiple times (e.g. repeated
// drag-and-drop events) is only listed once.
QStringList unique;
for (const auto& item : pendingVersionWarnings_)
if (!unique.contains(item)) unique.append(item);
pendingVersionWarnings_.clear();
const auto details = unique.join(QLatin1String("\n"));
QMessageBox::warning(this, tr("版本过低"),
tr("以下资源的 Spine 版本不在支持的范围内(支持的版本:3.8、4.0、4.1、4.2、4.3):\n\n%1")
.arg(details));
}
void MainWindow::showInvalidAssetWarning() {
if (pendingInvalidAssets_.isEmpty()) return;
// Deduplicate so the same file reported multiple times is only listed once.
QStringList unique;
for (const auto& item : pendingInvalidAssets_)
if (!unique.contains(item)) unique.append(item);
pendingInvalidAssets_.clear();
const auto details = unique.join(QLatin1String("\n"));
QMessageBox::warning(this, tr("未识别到正确的 Spine 资产"),
tr("以下文件未能识别为有效的 Spine 资产:\n\n%1").arg(details));
}
QString MainWindow::findAtlas(const QString& skeletonPath) const { QString MainWindow::findAtlas(const QString& skeletonPath) const {
const QFileInfo skeleton(skeletonPath); const QFileInfo skeleton(skeletonPath);
QDir directory(skeleton.absolutePath()); QDir directory(skeleton.absolutePath());
@@ -256,13 +316,18 @@ void MainWindow::animationChanged(const QString& name) {
statusLabel_->setText(QString::fromStdString(error)); statusLabel_->setText(QString::fromStdString(error));
return; return;
} }
previewClock_.restart();
advancePreview(); advancePreview();
previewTimer_->start(); previewTimer_->start();
} }
void MainWindow::advancePreview() { void MainWindow::advancePreview() {
std::string error; std::string error;
auto frame = runtime_.updatePreview(0.016F, error); // Use the real elapsed wall-clock time as the frame delta so the animation
// matches the actual playback speed even if the timer interval drifts
// (Windows timers are not exact). Falls back to 16ms on the first frame.
const float delta = previewClock_.isValid() ? previewClock_.restart() / 1000.0F : 0.016F;
auto frame = runtime_.updatePreview(delta, error);
if (!frame) { if (!frame) {
previewTimer_->stop(); previewTimer_->stop();
previewWidget_->setMessage(tr("动画预览暂时不可用")); previewWidget_->setMessage(tr("动画预览暂时不可用"));
@@ -351,9 +416,13 @@ void MainWindow::refreshAvailability() {
} }
currentEditorVersion_ = availableVersions_.value(line); currentEditorVersion_ = availableVersions_.value(line);
if (currentEditorVersion_.isEmpty()) { if (currentEditorVersion_.isEmpty()) {
showAvailability(tr("缺少 Spine %1").arg(line), QStringLiteral("#ef6b73")); // Run the version check (cache scan + editor probe) in the background
convertButton_->setText(tr("指定 Spine %1 路径").arg(line)); // (bounded by the probe timeout) so the UI does not block. If no
convertButton_->setEnabled(true); // matching version is found, the user is warned with a dialog.
showAvailability(tr("正在检查 Editor ..."), QStringLiteral("#f2b84b"));
convertButton_->setText(tr("检查中..."));
convertButton_->setEnabled(false);
startEditorProbe(line);
return; return;
} }
showAvailability(tr("可转换 · Spine %1").arg(currentEditorVersion_), showAvailability(tr("可转换 · Spine %1").arg(currentEditorVersion_),
@@ -362,6 +431,47 @@ void MainWindow::refreshAvailability() {
convertButton_->setEnabled(true); convertButton_->setEnabled(true);
} }
void MainWindow::startEditorProbe(const QString& line) {
const std::string lineStr = line.toStdString();
const auto editorPath = localPath(editorPath_);
const int generation = ++editorProbeGeneration_;
auto future = QtConcurrent::run([lineStr, editorPath, generation]() -> QPair<int, QString> {
// Scan the Spine update cache first; if no matching release is cached,
// probe the explicitly selected Editor executable (bounded timeout).
SpineVersionAvailability availability;
if (const auto cached = availability.newestForLine(lineStr))
return {generation, QString::fromStdString(cached->toString())};
const auto runner = createDefaultProcessRunner();
const SpineProbe probe(*runner);
const auto result = probe.inspect(editorPath, std::chrono::seconds(3));
if (result.editorVersion && result.editorVersion->line() == lineStr)
return {generation, QString::fromStdString(result.editorVersion->toString())};
return {generation, QString{}};
});
editorProbeWatcher_->setFuture(future);
}
void MainWindow::onEditorProbeFinished() {
if (!editorProbeWatcher_ || !editorProbeWatcher_->isFinished()) return;
const auto outcome = editorProbeWatcher_->result();
if (outcome.first != editorProbeGeneration_) return;
const QString version = outcome.second;
if (version.isEmpty()) {
showAvailability(tr("未找到对应版本"), QStringLiteral("#ef6b73"));
convertButton_->setText(tr("指定 Spine 路径"));
convertButton_->setEnabled(true);
// Warn the user one second after the scan when no matching version is found.
QTimer::singleShot(1000, this, [this] {
QMessageBox::warning(this, tr("未找到对应版本"), tr("未找到对应版本"));
});
} else {
currentEditorVersion_ = version;
showAvailability(tr("可转换 · Spine %1").arg(version), QStringLiteral("#55d68b"));
convertButton_->setText(tr("一键转换为 .spine"));
convertButton_->setEnabled(true);
}
}
bool MainWindow::chooseEditorPath() { bool MainWindow::chooseEditorPath() {
const auto selected = QFileDialog::getOpenFileName(this, const auto selected = QFileDialog::getOpenFileName(this,
tr("指定 Spine 程序"), {}, tr("所有文件 (*)")); tr("指定 Spine 程序"), {}, tr("所有文件 (*)"));
+13 -1
View File
@@ -5,6 +5,9 @@
#include <QMainWindow> #include <QMainWindow>
#include <QHash> #include <QHash>
#include <QStringList> #include <QStringList>
#include <QElapsedTimer>
#include <QFutureWatcher>
#include <QPair>
class QComboBox; class QComboBox;
class QCheckBox; class QCheckBox;
@@ -36,11 +39,12 @@ private slots:
const QString& error); const QString& error);
void animationChanged(const QString& name); void animationChanged(const QString& name);
void advancePreview(); void advancePreview();
void onEditorProbeFinished();
private: private:
void setupUi(); void setupUi();
void addInput(const QString& path); void addInput(const QString& path);
void addSkeleton(const QString& path); void addSkeleton(const QString& path, bool warnInvalid = true);
void loadCurrentPreview(); void loadCurrentPreview();
QString findAtlas(const QString& skeletonPath) const; QString findAtlas(const QString& skeletonPath) const;
QString runtimeLibrary(const QString& versionLine) const; QString runtimeLibrary(const QString& versionLine) const;
@@ -51,6 +55,9 @@ private:
void showAvailability(const QString& text, const QString& color); void showAvailability(const QString& text, const QString& color);
void showEmptyState(); void showEmptyState();
void setBusy(bool busy); void setBusy(bool busy);
void startEditorProbe(const QString& line);
void showUnsupportedVersionWarning();
void showInvalidAssetWarning();
QComboBox* resourceCombo_ = nullptr; QComboBox* resourceCombo_ = nullptr;
QComboBox* animationCombo_ = nullptr; QComboBox* animationCombo_ = nullptr;
@@ -68,6 +75,11 @@ private:
RuntimePlugin runtime_; RuntimePlugin runtime_;
ConversionJob* conversionJob_ = nullptr; ConversionJob* conversionJob_ = nullptr;
QTimer* previewTimer_ = nullptr; QTimer* previewTimer_ = nullptr;
QElapsedTimer previewClock_;
QFutureWatcher<QPair<int, QString>>* editorProbeWatcher_ = nullptr;
int editorProbeGeneration_ = 0;
QStringList pendingVersionWarnings_;
QStringList pendingInvalidAssets_;
}; };
} // namespace dts } // namespace dts
Submodule DateToSpine/third_party/spine-runtimes/3.8 deleted from 8b4844bd4b.
+19
View File
@@ -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
+922
View File
@@ -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)
+26
View File
@@ -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.
+33
View File
@@ -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
File diff suppressed because it is too large. Load diff
@@ -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
Binary file not shown.

After

Width:  |  Height:  |  Size: 257 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.
+39
View File
@@ -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=="
}
}
}
+33
View File
@@ -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)
@@ -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)
@@ -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
@@ -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();
}
@@ -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 */
@@ -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 &lt;= 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 &lt;= 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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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 */
@@ -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
@@ -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 */
Loaded 100 of 1293 files, more files were not shown because too many files have changed in this diff. Show more