52 Commits

Author SHA1 Message Date
Mario Zechner
d62b2682bb [c][ios][flutter] More documentation related codegen 2025-09-15 15:44:13 +02:00
Mario Zechner
b96e7c2461 [assets] Re-exported and distributed to runtimes 2025-09-11 01:09:23 +02:00
Mario Zechner
3d5d64885b [ios] Update to latest spine-c, fix swift-writer.cpp to cast on the C++ side if necesary. 2025-09-11 00:28:45 +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
b9743fde46 Update README.mds 2025-08-28 18:18:36 +02:00
Mario Zechner
3d5a66b5f8 Formatting 2025-08-28 13:57:28 +02:00
Mario Zechner
927e2e8f3f [sdl] Updated to latest spine-cpp/spine-c 2025-08-27 12:42:27 +02:00
Mario Zechner
37fef98fd2 feat(spine-ios): Add bindings generation script and remove CocoaPods support
- Add generate-bindings.sh script similar to spine-flutter
- Remove outdated CocoaPods example and podspecs
- Remove setup.sh (no longer needed as we use symlinks)
- CocoaPods users should use Swift Package Manager instead
2025-08-27 11:42:40 +02:00
Mario Zechner
ab53d271a4 feat(spine-ios): Add memory leak detection and fix PMA handling
- Enable debug extension on app startup for leak detection
- Add reportLeaks() calls when example views disappear
- Fix PMA flag handling by reading it from atlas page instead of hardcoding to false
- Add manual dispose() method to SpineController for explicit cleanup if needed

Note: SwiftUI view caching may show false positive leaks when views disappear,
as SwiftUI keeps views in memory for performance until they're truly no longer needed.
2025-08-27 11:21:23 +02:00
Mario Zechner
cb62bd70c0 feat(spine-ios): Add Objective-C support to generated Swift bindings
- Add NSObject inheritance to root classes for ObjC compatibility
- Add @objc(Spine<ClassName>) and @objcMembers annotations to all classes
- Fix property name conflicts (className -> rttiClassName, hash -> hashString)
- Use @nonobjc on subclass initializers to avoid selector conflicts
- Fix convenience init override modifiers
- Update ObjC example to use new API method names
- Update test to use rttiClassName property
2025-08-27 10:58:23 +02:00
Mario Zechner
81c9f5630a [ios] Fix SkeletonDrawableWrapper.update() to call directly into the drawable. 2025-08-26 17:38:08 +02:00
Mario Zechner
500c30319a [cpp] Remove spine-cpp-lite, superceeded by spine-c 2025-08-26 17:35:31 +02:00
Mario Zechner
9b345068b6 feat(spine-ios): Update SpineiOS and Example to work with new SpineSwift generated bindings
- Remove AnimationStateWrapper (no longer needed with new SpineSwift API)
- Replace Spine.Generated+Extensions.swift with simplified SpineSwiftExtensions.swift
- Update SpineiOS to use SpineSwift API instead of direct SpineC calls
- Fix namespace conflicts (ContentMode → SpineContentMode, Alignment → SpineAlignment)
- Update texture mapping to use atlas page index from RenderCommand pointer
- Fix all Example app API calls to match new SpineSwift generated API:
  - setAnimationByName → setAnimation
  - addAnimationByName → addAnimation
  - slot.color → slot.appliedPose.color.set()
  - EventType enum cases instead of constants
  - Physics enum with qualified name to avoid conflicts
  - setSkin2() instead of property assignment
  - Array iteration using indices instead of for-in
  - bone.worldX → bone.appliedPose.worldX
- Update Objective-C imports from Spine to SpineiOS module

Note: SimpleAnimationViewController.m still needs updates for full ObjC compatibility
2025-08-26 17:35:31 +02:00
Mario Zechner
f1d98393d5 fix(spine-ios): Fix memory management and complete test implementation
- Changed code generator to emit dispose() methods instead of deinit
- Add override keyword for dispose() in subclasses
- Keep deinit with _ownsMemory check for array types
- Fix SkinExtensions to use correct C++ class names for attachments
- Complete skeleton_drawable_test implementations with no warnings
- Add comprehensive bone pose transformation tests
- Fix skin entries test to properly show attachments

The memory management fix prevents Swift wrappers from accidentally
disposing C++ objects they don't own when created via fromPointer.
2025-08-16 21:24:13 +02:00
Mario Zechner
0b318d01fd [ios] VS Code debug launch config 2025-08-11 21:08:51 +02:00
Mario Zechner
1627bd81e5 [ios] Improved test 2025-08-11 20:29:54 +02:00
Mario Zechner
cc43fd549b feat(spine-ios): Implement SpineSwift high-level API mirroring spine_dart.dart
- Created SkeletonDrawable class wrapping spine_skeleton_drawable C functions
- Implemented AnimationStateEventManager singleton for event listener management
- Added helper types: Bounds and Vector structs
- Added extensions for Skeleton (bounds, getPosition)
- Added extensions for Skin (getEntries to iterate attachments)
- Added extensions for BonePose (coordinate transformations)
- Added extensions for AnimationState and TrackEntry (event listeners)
- Created skeleton_drawable_test_swift.swift using SpineSwift high-level API
- Updated test Package.swift to include SpineSwift dependency
- SpineSwift module now compiles with 0 errors

This completes the port of the high-level API from spine-flutter's spine_dart.dart
to SpineSwift, providing a clean Swift API that mirrors the Dart implementation.
2025-08-11 20:17:17 +02:00
Mario Zechner
9fdc0f0033 spine-ios: Fix Swift bindings compilation - arrays and type conversions
- Fixed array wrapper generation to use correct pointer casting
- Changed array count/length properties to return Int instead of Int32
- Fixed buffer access for primitive and object arrays (no assumingMemoryBound needed)
- Corrected size_t parameters to use Int instead of Int32
- Updated module imports (SpineSwift instead of Spine)
- Reduced compilation errors from 17,500 to 0 for SpineSwift module
- Remaining 27 errors are iOS-specific (UIKit) in SpineiOS module
2025-08-11 19:31:33 +02:00
Mario Zechner
a52ac67661 [ios] More Swift generator work. 2025-08-11 19:11:24 +02:00
Mario Zechner
ecbd700af4 Restructure spine-ios modules: SpineC, SpineSwift, SpineiOS
- Created clean module separation:
  - SpineC: C/C++ compilation only (working)
  - SpineSwift: Generated Swift bindings + platform-agnostic API
  - SpineiOS: iOS-specific UI components only
- Updated Package.swift with proper target structure
- Moved generated Swift files to SpineSwift/Generated
- Removed redundant SpineModule
- Created test with skeleton_drawable_test.swift ported from Dart
- Test successfully runs using SpineC module directly
- Note: SpineSwift has Objective-C selector conflicts to be fixed
2025-08-11 19:07:29 +02:00
Mario Zechner
106c39d0af [workflows] Add diff artifact to dart format check for debugging 2025-07-31 21:32:13 +02:00
Mario Zechner
7eb414e2f7 [ios] codegen scaffold 2025-07-31 21:27:53 +02:00
Mario Zechner
1efd045a83 Final clean-up of all Bash scripts except examples/**/*.sh and spine-godot/build/*.sh 2025-07-20 22:07:17 +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
b544dd99ed [formatters] C/C++ formatting 2025-07-15 22:56:12 +02:00
Nathan Sweet
f4f1ea1fd9 Ran: examples/export/runtimes.sh 2025-06-20 15:56:02 -04:00
Nathan Sweet
7be6dac44a Merge branch '4.2' into 4.3-beta
# Conflicts:
#	spine-ts/package.json
#	spine-unity/Assets/Spine/package.json
2025-05-09 17:05:41 -04:00
Byeong Gwan
123426d3e3
[iOS] fix additive, normal blending (#2822) 2025-05-05 11:57:51 +02:00
Nathan Sweet
dafafca942 Merge branch '4.2' into 4.3-beta-sliders
# Conflicts:
#	spine-ts/package.json
2025-04-23 11:59:55 -04:00
Byeong Gwan
759c8115c4
[iOS] Spine fix Metal deadlock (#2816) 2025-04-17 11:19:14 +02:00
Byeong Gwan
f04382bacd
expose multiplatform spine-engine target (#2806) 2025-04-10 11:28:34 +02:00
Byeong Gwan
88230582c2
[iOS] merge shader header and disable cpp-interp in example project (#2808)
* [iOS] disable objc-interp in example project & reuse struct header inside shader

* [iOS] support sharing Shader Header on both cocoapods and SPM
2025-04-10 11:27:24 +02:00
Mario Zechner
7cafab92b0
Update spine-cpp-lite.h 2025-04-09 12:18:02 +02:00
Byeong Gwan
6e5da45fa3
[iOS] update Swift inteface for more fine grained control(like external atlas loading) (#2772)
* update Swift inteface for more fine grained control

- move instance method to static method which does not require spine cpp pointer
- implement equality and hashing based on cpp pointer so that it can be stored in collection and compare it
- expose Atlas image count property so that the user can load the atlas resource lazily

- User can now Create Atlas by using Altas static function, and fetch whole resource path by iterating count of atlas page count

* [iOS] fix wrong y-axis alignment
2025-04-08 11:51:32 +02:00
Nathan Sweet
f08d58dc98 License header update. 2025-04-05 13:42:13 -04:00
Byeong Gwan
caf7700e2c
[iOS] Refactor error and data access (#2733)
* implement safe bounded data Access and cancellation supporting URLSession downloadTask

* declare specific SpineError type
declaring conformance to Error on String is discouraged, and Creating own Error type is recommended

* use explicit Error initializing rather than casing syntax (apply requested change)
2025-02-26 09:26:10 +01:00
Allen
7629d7dd35 [ios] Using SIMD to replace vector_float types can boost CPU performance on mid-range models. 2025-02-11 14:23:34 +01:00
Allen
b2061f1cf9
[ios] Using UnsafeBufferPointer to skip data copying and boost performance. (#2686)
* [ios] Using UnsafeBufferPointer to skip data copying and boost performance.

* [ios] Fix the extra data copying caused by using  and move the guard let condition to be earlier
2024-11-20 11:54:22 +01:00
kikiloveswift
000df07027
[ios] Fix the issue where the SkeletonBounds instance couldn’t be initialized (#2669)
Co-authored-by: liqiang <liqiangbj01@kanyun.com>
2024-11-14 12:21:14 +01:00
kikiloveswift
648170f325
[ios] Provide the ability to convert an Attachment into a BoundingBoxAttachment. (#2671)
Co-authored-by: liqiang <liqiangbj01@kanyun.com>
2024-11-14 12:19:17 +01:00
kikiloveswift
4f7fe00427
ADD: spine-ios support Cocoapods :Static Framework (#2658)
Co-authored-by: liqiang <liqiangbj01@kanyun.com>
2024-11-05 15:48:35 +01:00
Mario Zechner
19d3d1b29b [ios] Closes #2666, expose SkeletonBounds via spine-cpp-lite/Swift 2024-11-05 15:46:53 +01:00
Mario Zechner
f9fb7a3b0c [ios] Fix UIKit example. 2024-07-02 14:48:21 +02:00
Mario Zechner
520dd36c71 [ios] Switch to SkeletonRenderer, update README.md 2024-07-02 14:08:32 +02:00
Mario Zechner
a5b3bc709d [ios] Fix blending, use PMA assets in all examples. See #2555 2024-06-28 15:46:28 +02:00
Mario Zechner
7d6f0f9490 [ios] Fix blending, see #2555 2024-06-28 15:39:13 +02:00
Mario Zechner
a58346ff64 [ios] Add new spine-cpp-lite function. 2024-06-28 14:44:38 +02:00
Mario Zechner
da8131e0e1 [ios] Fix version in podspec files, update example/export/runtimes.sh 2024-06-18 10:46:12 +02:00