7606 Commits

Author SHA1 Message Date
Harald Csaszar
f0c53a757f [unity] Fixed shader compile error occurring during build on Unity URP versions 12.x and 13.x. See related commit 2f1b0b8. (Not related to last commit 1fa6c2e.) 2023-05-31 16:38:12 +02:00
Harald Csaszar
1fa6c2edbb [unity] Added support for Tint Black at all Spine URP shaders (2D and 3D) and at Spine/Sprite shaders. Closes #1705. 2023-05-31 12:05:43 +02:00
Harald Csaszar
72e4c2915f [unity] Fixed NullReferenceException when SkeletonGraphic SkeletonDataAsset is null. Closes #2294. 2023-05-26 12:20:46 +02:00
Mario Zechner
9d0c069f5d [flutter] Update libspine_flutter.wasm. 2023-05-24 13:06:37 +02:00
Mario Zechner
3a9c57b6a7 [flutter] Update pubspec.lock 2023-05-24 13:00:06 +02:00
Mario Zechner
1cf2d1df5e [flutter] Minimum Flutter SDK 3.10.1 2023-05-24 12:54:41 +02:00
Harald Csaszar
7883f0fafd [unity] Fixed NullReferenceException upon SkeletonGraphic drag&drop instantiation. Closes #2292. 2023-05-16 14:06:31 +02:00
Harald Csaszar
ddb05fe469 [unity] Increased package version numbers for previous commit ba99dda. 2023-05-16 13:39:24 +02:00
Harald Csaszar
ba99ddae07 [unity] Added Spine preferences parameter Timeline - Default Mix Duration. 2023-05-16 13:19:17 +02:00
Harald Csaszar
149aad2fa0 [unity] Fixed RenderExistingMesh not updating when "Reload Scene" is disabled. Closes #2291. 2023-05-12 17:41:32 +02:00
Harald Csaszar
fc05ecf931 [unity] Added support for light cookies at Universal Render Pipeline/Spine/Sprite shader. Closes #2285. 2023-05-03 20:27:58 +02:00
Harald Csaszar
ae2f1a1dc6 [unity] Added previously missing unlit URP 2D shader variant Universal Render Pipeline/2D/Spine/Skeleton. 2023-05-03 17:37:13 +02:00
Harald Csaszar
ef1249d86b [unity] Minor: Corrected some leftover URP shaders _StencilComp default values to 8 (Always). 2023-05-03 17:14:12 +02:00
Harald Csaszar
f85fb25a35 [unity] Increased package version number for last commit 9244091. See #2284. 2023-05-02 16:45:52 +02:00
Harald Csaszar
92440912d2 [unity] Fixed RootMotion components with Rigidbody in parent not supporting position offset. Closes #2284. 2023-05-02 16:40:22 +02:00
Mario Zechner
54cc75c203 hreejs] Closes #2278, coordinate transform example. 2023-05-02 13:27:16 +02:00
Mario Zechner
18eef55eb5 [cpp] Formatting. 2023-05-02 13:06:10 +02:00
Mario Zechner
4f01861cac [sdl] Fix renderer to use new TextureRegion struct. 2023-05-02 11:45:08 +02:00
Mario Zechner
fc1cc6f0ee [c] Fix readVarint, closes #2281 2023-05-02 11:44:49 +02:00
Mario Zechner
350ad06269 [c] Fix SDL CMake build 2023-05-02 11:09:37 +02:00
Mario Zechner
7d33f18b36 [godot] Update GH Action runners to Ubuntu 20.04, update to latest Godot tags 2023-05-02 10:54:09 +02:00
Mario Zechner
d83cae37f0 [cpp] Formatting. 2023-04-28 14:05:57 +02:00
Mario Zechner
3545fa9f32 [cpp] Fix up root CMakeLists.txt to always include spine-c, spine-cpp, and spine-cpp-unit-tests 2023-04-28 13:54:59 +02:00
Mario Zechner
42626d7ff7 [phaser] Clean-up and inline documentation. 2023-04-28 13:32:17 +02:00
Mario Zechner
b4969465a0 [phaser] Fix extracting atlas page file names. 2023-04-28 09:06:28 +02:00
Mario Zechner
9dbada6541 [phaser] Fix control bones example. 2023-04-27 17:32:36 +02:00
Mario Zechner
de894957da [phaser] Update assets. 2023-04-27 17:27:53 +02:00
Mario Zechner
90e369fcfe [phaser] More example work, Stretchyman idle animation. 2023-04-27 17:25:23 +02:00
Mario Zechner
bf3f70379f [phaser] Improve TypeScript example. 2023-04-26 11:16:13 +02:00
Mario Zechner
43caf7563b Merge branch '4.1' of https://github.com/esotericsoftware/spine-runtimes into 4.1 2023-04-26 10:53:11 +02:00
Mario Zechner
a996baa2b0 [phaser] Add before and after update world transforms callbacks. 2023-04-26 10:53:01 +02:00
Luke Ingram
d3004bfbf7 [godot] Updates scripts to handle spaces in file paths (#2244). 2023-04-25 13:35:06 -04:00
Mario Zechner
5662c75db9 [phaser] Expose getters for preloaded skeleton data and atlases. 2023-04-25 15:13:12 +02:00
Mario Zechner
f8837604f5 [phaser] Rework skeleton data loading. Cache based on data + atlas key. 2023-04-25 14:33:22 +02:00
Mario Zechner
125d7c9903 [phaser] Example clean-up 2023-04-24 10:33:40 +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
Mario Zechner
0aca55b453 [phaser] Fix TypeScript example version. 2023-04-21 14:08:32 +02:00
Mario Zechner
d15e51340b [ts] 4.1.31 release. 2023-04-21 14:08:20 +02:00
Mario Zechner
ba2eb2cf9c [phaser] Fix GameObjectCreator.spine parameter types. 2023-04-21 14:05:32 +02:00
Mario Zechner
8db318ab85 [phaser] 4.1.30 release 2023-04-21 14:03:40 +02:00
Mario Zechner
d24787b81e [phaser] Fix preDestroy in SpineGameObject. 2023-04-21 13:54:28 +02:00
Mario Zechner
2900605300 [phaser] Clean-up, TypeScript example README, non-null SpineGameObject fields. 2023-04-21 13:52:35 +02:00
Mario Zechner
cc0ee7ce80 [ts] 4.1.29 release. 2023-04-21 11:45:37 +02:00
Mario Zechner
c0b8b31945 [ts] Fix versions of dependencies. 2023-04-21 11:43:46 +02:00
Mario Zechner
2f70cdde77 [phaser] Move TS/NPM example. 2023-04-21 11:38:24 +02:00
Mario Zechner
7a07f0b512 [ts] 4.1.28 release. 2023-04-21 11:36:22 +02:00
Mario Zechner
eb51ae30d9 [phaser] Exclude example TS files from build 2023-04-21 11:35:35 +02:00
Mario Zechner
2cc7667a18 [phaser] Add vanilla JS and NPM/TS examples, fix typings. 2023-04-21 11:33:35 +02:00