- Implement comprehensive C++ serializer generator (tests/generate-cpp-serializer.ts) - Direct transformation of Java SkeletonSerializer to C++ header-only implementation - Handle all C++-specific API differences: * Field access patterns (obj.field → obj->field, private fields → obj->_field) * Null check removal for reference-returning methods (getBones, getEdges) * Nested array null check elimination (getVertices, getDrawOrders) * Enum serialization via switch statements replacing .name() calls * Custom function replacement system for C++-specific implementations - Add specialized C++ implementations: * writeColor: handle public Color fields (r,g,b,a without underscore) * writeSkin: iterate AttachmentMap::Entries and call writeSkinEntry * writeSkinEntry: handle AttachmentMap::Entry instead of Java SkinEntry - Auto-generate both pointer and reference versions of all write methods - Create JsonWriter.h as header-only port of Java JsonWriter - Update HeadlessTest.cpp to use generated SkeletonSerializer - Add comprehensive type analysis and enum mapping from analysis-result.json - Implement exclusion system for filtering unwanted types/methods - Fix Java generator nested array null checks that were incorrectly hardcoded Generated C++ serializer produces identical JSON output to Java reference implementation.
spine-cpp
The spine-cpp runtime provides basic functionality to load and manipulate spine skeletal animation data using C++. It does not perform rendering but can be extended to enable spine animations for other projects that utilize C++.
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. 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 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 and Section 2 of the Spine Editor License Agreement.
Spine version
spine-cpp works with data exported from spine 4.2.xx.
spine-cpp supports all spine features.
Setup
- Download the spine Runtimes source using git or by downloading it as a zip via the download button above.
- Copy the contents of the
spine-cpp/spine-cpp/srcandspine-cpp/spine-cpp/includedirectories into your project. Be sure your header search is configured to find the contents of thespine-cpp/spine-cpp/includedirectory. Note that the includes usespine/Xxx.h, so thespinedirectory cannot be omitted when copying the files.
Usage
Please see the spine-cpp guide for full documentation
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 }
};