705 Commits

Author SHA1 Message Date
Mario Zechner
1d0b33fb69 Formatting 2024-07-24 14:37:16 +02:00
Mario Zechner
83ac01e76c [c] Port: Scale physics constraint limits with skeleton scale. See #2576 2024-07-24 14:36:41 +02:00
Mario Zechner
70af9d8159 [sfml] Refactor CMake build 2024-06-30 21:03:37 +02:00
Mario Zechner
35d76de559 [c][cpp] Fix formatting 2024-06-28 15:38:51 +02:00
Mario Zechner
ccac475c81 [c][cpp] Closes #2551, fix inherit transform timelines 2024-06-13 18:02:39 +02:00
Mario Zechner
f2d1a2104d [c][cpp] Port: Added TrackEntry#isNextReady() #2547 2024-06-11 14:15:34 +02:00
Mario Zechner
ac4ff96915 [c] Ported clipping fixes for colinear points (a0caef6 and 932c33a). See #2546. 2024-06-11 13:45:02 +02:00
Mario Zechner
e99899e819 [c][cpp] Port 687260a384df3461f72738d08be85993fb83ec70 2024-05-15 13:57:39 +02:00
Mario Zechner
0a828099e9 Formatting 2024-05-03 12:47:24 +02:00
Mario Zechner
04c132f4af [c] Closes #2509, SP_INHERIT_NOSCALE was incorrectly implemented 2024-05-02 16:01:04 +02:00
Dmitro Sechin
f67807f1e7
[spine-c] Fix crashes in skins or animations error handling (#2491)
* Fix android-specific rotation issue. bone->arotation == NaN, in some specific cases during update bones, cause squared value can been very smoll but still negative anyway and create NaN value

* Fix crash at spSkeletonData_dispose() while handling problems in skeleton in SkeletonBinary/SkeletonJson.
Use increase counts instead directly put counts value for avoid problems at early dispose vectors

* additional commit for prev revision
2024-04-30 10:45:53 +02:00
Mario Zechner
d0da762dc6 Formatting 2024-04-27 11:37:40 +02:00
Mario Zechner
3d31acdc5b [c] Fix errors due to Defold's compiler flags 2024-04-27 11:13:10 +02:00
Mario Zechner
de6b411007 Formatting 2024-04-16 17:21:36 +02:00
Mario Zechner
7e1d5e5273 [c][cpp] Update docs of spPhysics enum 2024-04-16 16:25:43 +02:00
Mario Zechner
072c2c0965 Update README.mds, preprare spine-flutter for publication 2024-04-16 15:33:55 +02:00
Mario Zechner
9fbd84344e [c] Finished 4.2 port 2024-04-16 15:15:14 +02:00
Mario Zechner
cbf150b653 [c] More 4.2 porting, SkeletonBinary, untested, probably broken 2024-04-16 13:48:27 +02:00
Mario Zechner
2d940b4156 [c] More 4.2 porting, SkeletonJson, SFML physics examples 2024-04-16 10:50:07 +02:00
Mario Zechner
f7f4d5cbe7 [c] More 4.2 porting, only loaders left. 2024-04-15 21:41:48 +02:00
Mario Zechner
430758eb9b [c] More 4.2 porting, remove incorrect/unnecessary const qualifiers 2024-04-15 15:32:25 +02:00
Mario Zechner
3938424f26 [c] 4.2 porting, removal of const qualifiers from fields. 2024-04-10 15:57:10 +02:00
Dmitriy Sechin
0ffc316793
Fix android-specific rotation issue. bone->arotation == NaN, in some specific cases during update bones, cause squared value can been very smoll but still negative anyway and create NaN value (#2459) 2024-03-06 03:29:25 +01:00
Mario Zechner
d03f535ed8 [cpp] Formatting 2024-01-16 12:42:22 +01:00
Mario Zechner
8c79c7c1de [c][cpp] Fix all warnings on Clang, more physics constraints porting 2024-01-03 12:52:10 +01:00
Mario Zechner
355a91de79 Merge branch '4.1' into 4.2-beta
# Conflicts:
#	spine-flutter/CHANGELOG.md
#	spine-flutter/lib/assets/libspine_flutter.wasm
#	spine-flutter/pubspec.yaml
#	spine-ts/package-lock.json
#	spine-ts/package.json
#	spine-ts/spine-canvas/package.json
#	spine-ts/spine-core/package.json
#	spine-ts/spine-phaser/package.json
#	spine-ts/spine-pixi/package.json
#	spine-ts/spine-player/package.json
#	spine-ts/spine-threejs/package.json
#	spine-ts/spine-webgl/package.json
2023-11-28 13:41:20 +01:00
Mario Zechner
501ad3553d [c][cpp] Fix for #2412 2023-11-28 13:30:02 +01:00
Mario Zechner
aeef4495de Merge branch '4.1' into 4.2-beta
# Conflicts:
#	spine-sfml/cpp/example/testbed.cpp
2023-10-24 17:12:22 +02:00
Mario Zechner
5989c861ca [c] Closes #2397, buffer overflow when loading sequences with less than 10 frames. 2023-10-19 19:43:59 +02:00
Mario Zechner
6241ce9f14 Merge branch '4.1' into 4.2-beta 2023-10-11 11:45:00 +02:00
Mario Zechner
087b2688db [c] Closes #2394, double free of sequences in mesh attachments. 2023-10-11 11:44:36 +02:00
Mario Zechner
90db1108db Merge branch '4.1' into 4.2-beta 2023-09-06 11:47:17 +02:00
Mario Zechner
aa0b9d57ca Formatting 2023-09-06 11:47:07 +02:00
Mario Zechner
8c53a07c5d Merge branch '4.1' into 4.2-beta 2023-09-06 11:07:25 +02:00
Mario Zechner
fed76c80c6 [c] Additional #2325 work, precalculate the space needed for property IDs in animations 2023-09-06 11:07:17 +02:00
Mario Zechner
8fb5d4f2b8 Merge branch '4.1' into 4.2-beta 2023-09-06 11:03:46 +02:00
Mario Zechner
066a152756 [c] Closes #2325, avoid allocations when reading vertices from binary files. 2023-09-06 11:03:35 +02:00
Mario Zechner
74b7882efa Merge branch '4.1' into 4.2-beta 2023-07-31 13:29:29 +02:00
Mario Zechner
4047f1ba07 Updated license headers. 2023-07-31 13:29:16 +02:00
Harald Csaszar
08b56ea1ca Merge branch '4.1' into 4.2-beta 2023-05-02 17:21:44 +02:00
Mario Zechner
18eef55eb5 [cpp] Formatting. 2023-05-02 13:06:10 +02:00
Mario Zechner
fc1cc6f0ee [c] Fix readVarint, closes #2281 2023-05-02 11:44:49 +02:00
Mario Zechner
0d443644c5 Merge branch '4.1' into 4.2-beta 2023-04-24 10:11:24 +02:00
Mario Zechner
cf68a9fd07 Formatting. 2023-04-24 10:11:14 +02:00
Alexey Gulev
4ca219668e
fix crash (#2270) 2023-04-24 09:39:55 +02:00
Dmitriy Sechin
77e2e34e8f
Handle skeleton loading problems without crashes (#2276)
This pull request improve the loading of binary skeleton so that there is no crash in case of attachment problems. 
Essentially, it will have the same behavior as for JSON skeleton, just returning NULL, and you can print pSkeleton->error to the output for the debug purpose.

The functions spSkeletonBinary_create() and spSkeletonJson_create() both use spAtlasAttachmentLoader, which creates attachments in its _spAtlasAttachmentLoader_createAttachment(). 
This function can return NULL in case of any problems with the atlas regions also setting internal error1,error2 to "Region not found: ", region_path

In case of SkeletonJson.c, there is a check for attachment != NULL after calling spAttachmentLoader_createAttachment(). 
However, unfortunately, there is no such check for SkeletonBinary.c, and if the region is not found, there is simply a crash deep inside the spine lib.

I fixed it like this

Currently, all calls to spAttachmentLoader_createAttachment() in SkeletonBinary.c are located inside the spSkeletonBinary_readAttachment() function, which is convenient. It is possible to check for the validity of the attachment after each _createAttachment() call. We can use
	if (!attachment)
		return NULL;

In fact, the problem with the attachment can only be in three cases inside spSkeletonBinary_readAttachment()
case SP_ATTACHMENT_REGION:
case SP_ATTACHMENT_MESH:
case SP_ATTACHMENT_LINKED_MESH:

But for the sake of consistency, it may be worth checking the other four cases:
SP_ATTACHMENT_BOUNDING_BOX:
SP_ATTACHMENT_PATH:
SP_ATTACHMENT_POINT:
SP_ATTACHMENT_CLIPPING:
(I do attachment check here, but maybe we can just "trust" that the attachment is always valid in this cases).

Now that spSkeletonBinary_readAttachment() can return NULL instead of crashing, so go on and fix the next function - spSkeletonBinary_readSkin()
Here, we also check the attachment for validity in this code 'for (i = 0; i < slotCount; ++i)'. 
Unfortunately, we cannot use 'continue' inside the loop here, as it is done in SkeletonJson.c, as we cannot move 'input->cursor' to the beginning of the data for the next slot. Here, we can only exit using return NULL, which generally suits us

And finally, in the function spSkeletonBinary_readSkeletonData(), there are only two calls to spSkeletonBinary_readSkin() - one for the default skin and another inside the loop for other skins. 
Here, you can apply a check 'if(self->attachmentLoader->error1)', and in case of problems, clear the data by spSkeletonData_dispose() and exit with return NULL; similarly to how it is done below for errors "Skin not found: " and "Parent mesh not found: ".

Thus, there will be no crash inside spine lib in case of attachment problems. Instead, NULL will be returned when calling spSkeletonBinary_readSkeletonData(), which the game engine can recognize and output the error message from pSkeleton->error in the output. 
This will help understand why my wonderful spine animation is not loading.
2023-04-24 09:39:05 +02:00
Harald Csaszar
954ab69bce Merge branch '4.1' into 4.2-beta 2023-04-06 13:30:38 +02:00
Mario Zechner
da68e66e9c [c][cpp] Formatting. 2023-04-06 13:26:25 +02:00
Mario Zechner
1fb89b6e89 [c][cpp] Port of commit e04e7b5. Adjusted fix for IK constraint NaN when parent has zero scale. 2023-04-06 13:25:13 +02:00
Mario Zechner
2b5bedd543 [c][cpp] Fixed IK constraint NaN when a parent bone has zero scale. 2023-04-05 15:50:28 +02:00