44 Commits

Author SHA1 Message Date
Mario Zechner
fa0f92958c [cpp] Fix findConstraint template. 2025-09-29 19:08:13 +02:00
Mario Zechner
c6495719ca [c][cpp][flutter][ios] Make attachment in Skin.setAttachment optional 2025-09-23 17:07:03 +02:00
Mario Zechner
fa4d43bda5 [cpp] Unshadow apply in BoneTimeline and others by prefixing the protected method with _apply() 2025-09-10 21:38:35 +02:00
badlogic
b64da9b637 [cpp] Introduce base classes for constraints without SP_API, from which concrete clsases derrive
MSVC issue. SP_API can't be used on classes with methods inherited from templated classes like ConstraintGeneric::getData(). we need an intermediate class that gets the method instantiation, and derrive from that instead.
2025-09-10 15:01:29 +02:00
Mario Zechner
e884b02f6d Revert "[cpp] Remove dll.h and SP_API"
This reverts commit 8bde2aeb543c7f51fd0224cd69ede246c719e6ea.
2025-09-10 13:58:03 +02:00
Mario Zechner
8bde2aeb54 [cpp] Remove dll.h and SP_API 2025-09-10 13:53:34 +02:00
Mario Zechner
18a244386e [cpp] Remove SP_API from templated classes 2025-09-10 13:32:14 +02:00
badlogic
9dea30a91b [cpp] More MSVC fixes, see https://forums.unrealengine.com/t/member-of-dll-interface-class-may-not-be-declared-what-does-it-mean/297770
Ridiculous
2025-09-10 13:25:20 +02:00
Mario Zechner
5297391a44 [cpp] More MSVC fixes 2025-09-10 13:14:03 +02:00
Mario Zechner
998fd7d17e [c][ios][flutter] Add render object getter setter to TextureRegion and AtlasRegion 2025-08-29 15:59:50 +02:00
Mario Zechner
51410a526e [c] Direct setListener on track entry and animation state 2025-08-29 15:10:56 +02:00
Mario Zechner
f9fefee0c8 [cpp] Docker build for GCC testing, minor GCC fixes 2025-07-30 12:10:02 +02:00
Mario Zechner
f6fbbabd6b [cpp] pEvents -> events 2025-07-30 09:41:42 +02:00
Mario Zechner
65f01fefb9 [cpp] Skeleton::getBounds() without scratch buffers 2025-07-30 00:42:27 +02:00
Mario Zechner
fe5e25c3a0 [cpp] Added TrackEntry::getAnimationState(), wired up when TrackEntry is obtained from pool in AnimatinState::newTrackEntry 2025-07-29 23:15:38 +02:00
Mario Zechner
fd939f4401 [c][cpp] SpineExtension::strdup convenience method, better spine_skin_entries api in spine-c extensions 2025-07-29 22:18:42 +02:00
Mario Zechner
9b778bc508 [cpp] Fix SkeletonBinary::readLong() UB, revert bendDirection fix again ... 2025-07-26 01:18:47 +02:00
Mario Zechner
a0bcb01a2a [cpp] Fix inconsistens getters/setters wrt nullability 2025-07-25 22:20:02 +02:00
Mario Zechner
854b6f9a2a [cpp] Constructor nullability. 2025-07-25 22:00:52 +02:00
Mario Zechner
861eac1c1b [c] References for non-nullable arguments and return types, pointers for nullable args and return types 2025-07-25 20:21:39 +02:00
Mario Zechner
6ad01acc6a [flutter] Use new loading infra from spine-c 2025-07-25 02:19:53 +02:00
Mario Zechner
ce12249682 [cpp] Use stl unordered_map if STL is available in Debug.h (faster) 2025-07-25 01:20:53 +02:00
Mario Zechner
31e0566b7d [cpp] Remove CurveTimeline2, replace with BoneTimeline2. 2025-07-24 22:25:23 +02:00
Mario Zechner
a018a3d7e9 [cpp] Fix _boneIndex initialization in constructors 2025-07-24 14:40:36 +02:00
Mario Zechner
d25c75d86b [cpp] BoneTimeline is pure now 2025-07-24 14:25:49 +02:00
Mario Zechner
af05f0681d [cpp] Refactored type hierarchy to be single inheritance, multiple interfaces 2025-07-24 14:16:19 +02:00
Mario Zechner
60cc9f0e20 [cpp] Make Constraint and Posed pure 2025-07-24 12:48:34 +02:00
Mario Zechner
94e5e74e8a [cpp] AtlasRegion::getName returns const String & instead of String. 2025-07-24 12:23:16 +02:00
Mario Zechner
ddf4c50954 [cpp] Call setupPose() in PosedGeneric constructor, to mirror what we do in Java. 2025-07-22 02:09:01 +02:00
Mario Zechner
b544dd99ed [formatters] C/C++ formatting 2025-07-15 22:56:12 +02:00
Mario Zechner
acbcfeb44d [cpp] Still compute RegionAttachment offsets when the region is null, see #2887
- Includes a massive refactor of the TextureRegion/AtlasRegion hierarchy to be in line with Java implementation
- Exact line by line port of RegionAttachment#updateRegion and MeshAttachment#updateRegion using new region implementations
2025-07-15 14:22:19 +02:00
Mario Zechner
557465ed01 [cpp] Rename RegionAttachment::_vertexOffset -> ::_offset 2025-07-15 11:25:05 +02:00
Mario Zechner
aac98324f2 [cpp][c] Clean up AtlasRegion, TextureRegion to use _ field prefixes and getters/setters instead of public fields 2025-07-14 21:13:56 +02:00
Mario Zechner
eaff42c840 [cpp] Fix primitive type array reading in SkeletonJson/SkeletonBinary 2025-07-13 04:43:05 +02:00
Mario Zechner
bd5b032619 [tests] ir-based serializer generator for C++ 2025-07-13 04:23:57 +02:00
Mario Zechner
429ed9dd3b [tests] Complete C++ SkeletonSerializer auto-generation from Java
- 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.
2025-07-13 02:06:44 +02:00
Mario Zechner
cc4f11fded [cpp] Simplify directory structure, add DebugPrinter program
- spine-cpp/spine-cpp was moved into spine-cpp directory, so spine-cpp/spine-cpp/src -> spine-cpp/src, spine-cpp/spine-cpp/include -> spine-cpp/include
- Added scaffold for DebugPrinter to be used by runtime comparison tests
- Added build.sh
2025-07-11 11:00:44 +02:00
NathanSweet
5aa58c5a9b spine-cpp is no longer supported. Use spine-c. 2013-04-02 02:48:12 +02:00
NathanSweet
42d072ae8d Simplified Timeline interface. 2013-03-25 12:49:02 +01:00
NathanSweet
75fc36eab6 Simplified all loading methods to take path, stream, or pointers. 2013-03-25 12:33:21 +01:00
NathanSweet
3aab744395 Utility methods to read from file and other minor improvements. 2013-03-22 16:18:03 +01:00
NathanSweet
6899b5249c Added AnimationState.
Fixed bug with keeping attachments visisble when setting new skin.
Clean up. Always more clean up can be done, freaking C++...
2013-03-22 14:22:35 +01:00
NathanSweet
6e9bcfd1d5 License headers for source files. 2013-03-20 14:58:59 +01:00
NathanSweet
a6a7200097 includes -> include 2013-03-20 14:22:16 +01:00