674 Commits

Author SHA1 Message Date
Mario Zechner
d0d77b68ae [cpp] Fix BoundingBoxAttachment default color 2025-07-21 01:41:54 +02:00
Mario Zechner
ab469cbefd [tests] headless-test-runner.ts with language specific fixes (e.g. icon: null (Java) > icon: "" (C++), C++ JSON will have null as well) 2025-07-21 00:58:43 +02:00
Mario Zechner
1a10d185a3 [cpp] Smoke tests 2025-07-20 22:42:16 +02:00
Mario Zechner
f2fced8bf8 Fix logging in various Bash scripts 2025-07-20 21:35:19 +02:00
Mario Zechner
d409ff23ff Fix format-xx.sh files wrt logging, add proper Swift formatting configuration. 2025-07-20 21:31:07 +02:00
Mario Zechner
0dd86dfdc1 Consistent logging in all Bash scripts via formatters/logging/logging.sh 2025-07-20 20:45:54 +02:00
Mario Zechner
2036aa3e76 [cpp] Fix double free crash in SkeletonBinary::readSkeletonDataFile, add terminal logging utilities and style guide, add nostdcpp 2025-07-20 20:19:07 +02:00
Mario Zechner
aaca02ad81 [cpp] nostdlib build to be used with WASM and other environments that do not want stdlibc++ linked in. 2025-07-20 14:20:40 +02:00
Mario Zechner
b544dd99ed [formatters] C/C++ formatting 2025-07-15 22:56:12 +02:00
Mario Zechner
0c74907da2 [tests] Improve snapshot testing infrastructure
- test.sh which given a language builds the headless test executable and runs the test with the given inputs
- generate-serializers.sh to (re-)generate all language specific serializers
- Improved README.md
- Removed headless-test-runner.ts, now fully expressed in more concise test.sh
2025-07-15 15:13:45 +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
9de99309f4 [c][cpp] Improved README.md 2025-07-15 11:49:15 +02:00
Mario Zechner
84a541b098 [c][cpp] Use CMake presets and Ninja as the default generator 2025-07-15 11:34:11 +02:00
Mario Zechner
557465ed01 [cpp] Rename RegionAttachment::_vertexOffset -> ::_offset 2025-07-15 11:25:05 +02:00
Mario Zechner
d3c0e7ad66 [cpp] Fixed bone disable inherit scale/reflection, see #2888 2025-07-15 11:09:49 +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
102b030db3 [tests] More improvements to serializer generator. 2025-07-13 02:52:50 +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
73a17e88c9 [tests] DebugPrinter -> HeadlessTest 2025-07-11 14:16:24 +02:00
Mario Zechner
d973417106 [tests] Fix locale in all debug printers, add tests/README.md, build if sources changed in compare-with-reference-impl.ts 2025-07-11 13:17:15 +02:00
Mario Zechner
4e3d2be023 [c][cpp][libgdx] Launch configs for debug-printer 2025-07-11 12:33:02 +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
Mario Zechner
f9fad00936 [c][cpp] Fix DataInput.read() to return unsigned int, fixes SkeletonBinary parsing. Remove findXXXConstraint methods from SkeletonData. 2025-07-11 02:48:54 +02:00
Mario Zechner
9c06cef2be [c][cpp] Fix ir-generator, Update type hierarchy in C++
- ir-generator did not handle const String& parameters correctly
- Type hierarchy of Bone, Constraint was incorrect. Bone didn't extend Update, thus fetching RTTI in updateCache failed at runtime.
2025-07-11 02:17:12 +02:00
Mario Zechner
8f831bd245 [c] More fixes to C wrapper generator, everything compiles, smoke test works 2025-07-10 04:44:35 +02:00
Mario Zechner
dcc0e20361 [c] Fixed C wrapper generator 2025-07-10 04:22:20 +02:00
Mario Zechner
b1e5ed1c25 [cpp] Various fixes for c wrapper generation 2025-07-10 00:33:36 +02:00
Mario Zechner
e1577829dd [cpp] Add Array(capacity) constructor 2025-07-09 20:22:35 +02:00
Mario Zechner
22ea76db1b [c] Port type extractor to TypeScript and improve codegen
- Ported extract-spine-cpp-types.js to TypeScript in type-extractor.ts
- Improved type interfaces with discriminated unions for better type safety
- Added proper isConst tracking for const-qualified methods
- Fixed exclusions to check method.isConst instead of return type
- Removed special type mappings (utf8, spine_void) - primitives pass through unchanged
- Made toCTypeName strict with proper error handling
- Documented all conversion functions with examples
- Excluded SpineObject from extraction (matches JS behavior)
- Removed original JS extractor as it's now replaced by TypeScript version

The TypeScript extractor produces identical output (107 files, 164 types) while providing better type information including isConst for methods and consistent isStatic fields.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 01:50:41 +02:00
Mario Zechner
759434e461 [c] Fix abstract type detection and improve codegen filtering
- Always set isAbstract to boolean in extract-spine-cpp-types.js
- Check for inherited pure virtual methods after inheritance pass
- Include abstract classes but skip create() function generation
- Only exclude template classes from code generation
- Extract const/non-const conflict checking into separate function
- Remove unused OpaqueTypeGenerator and helper functions
2025-07-08 23:08:48 +02:00
Mario Zechner
10ad175c8a [cpp] Remove spine:: namespace prefix everywhere. 2025-07-08 21:09:34 +02:00
Mario Zechner
9d384c50ed [cpp] Rename Vector -> Array, ContainerUtil > ArrayUtils 2025-07-08 20:38:45 +02:00
Mario Zechner
c75fd64189 [cpp] First pass of C wrapper generator and generated sources, WIP 2025-07-08 14:34:10 +02:00
Mario Zechner
46410f4b8a [cpp] Added type extractor script to be used by C wrapper generator. 2025-07-08 13:42:25 +02:00
Mario Zechner
65d0eec7c5 [cpp] 4.3 porting WIP 2025-07-07 22:57:37 +02:00
Mario Zechner
7add48c8f9 [cpp] 4.3 porting WIP 2025-07-07 22:04:00 +02:00
Mario Zechner
5aeceb27c9 [cpp] 4.3 porting WIP 2025-07-07 21:58:42 +02:00
Mario Zechner
972a1bc8fc [cpp] 4.3 porting WIP 2025-07-07 21:37:55 +02:00
Mario Zechner
e7c4a3eef0 [cpp] 4.3 porting WIP 2025-07-07 19:15:16 +02:00
Mario Zechner
751ee5972c [cpp] 4.3 porting WIP 2025-07-05 20:29:01 +02:00
Mario Zechner
8ff8680035 [cpp] 4.3 porting WIP 2025-07-05 03:28:39 +02:00
Mario Zechner
9deb524a70 [cpp] 4.3 porting WIP 2025-07-05 03:16:24 +02:00
Mario Zechner
c04f89e8ee [cpp] 4.3 porting WIP 2025-07-05 02:10:45 +02:00
Mario Zechner
d7891870bf [cpp] 4.3 porting WIP 2025-07-04 23:21:04 +02:00
Mario Zechner
782620c737 [cpp] 4.3 porting WIP 2025-07-04 22:57:16 +02:00
Mario Zechner
ac2046c1a5 [cpp] 4.3 porting WIP 2025-07-04 22:37:58 +02:00
Mario Zechner
80bf16785f [cpp] 4.3 porting WIP 2025-07-04 22:18:50 +02:00
Mario Zechner
f24242e317 [cpp] 4.3 porting WIP 2025-07-04 22:16:35 +02:00