Browse Source

Merge pull request #1232 from floooh/spine-4.2

sokol_spine.h: updated to Spine C runtime 4.2
Andre Weissflog 5 months ago
parent
commit
a9a2a5cea2
3 changed files with 13 additions and 3 deletions
  1. 6 0
      CHANGELOG.md
  2. 3 1
      tests/ext/CMakeLists.txt
  3. 4 2
      util/sokol_spine.h

+ 6 - 0
CHANGELOG.md

@@ -1,5 +1,11 @@
 ## Updates
 
+### 28-Mar-2025
+
+- sokol_spine.h has been updated for the Spine C runtime version 4.2
+- all headers: fixed warning when building with Clang on Windows
+  (mostly -Wsign-conversion issues in the Windows-specific code paths)
+
 ### 26-Mar-2025
 
 - sokol_app.h win32: Mouse lock behaviour is now more robust in edge cases

+ 3 - 1
tests/ext/CMakeLists.txt

@@ -14,7 +14,7 @@ if (IS_DIRECTORY ${spineruntimes_dir})
     message("### ${spineruntimes_dir} exists...")
 else()
     message("### Fetching spine runtimes to ${spineruntimes_dir} (this may take a while...)")
-    execute_process(COMMAND git clone --depth=1 --branch 4.1 --recursive https://github.com/EsotericSoftware/spine-runtimes ${spineruntimes_dir})
+    execute_process(COMMAND git clone --depth=1 --branch 4.2 --recursive https://github.com/EsotericSoftware/spine-runtimes ${spineruntimes_dir})
 endif()
 
 add_library(imgui
@@ -51,6 +51,8 @@ add_library(spine
     ${spineruntimes_dir}/spine-c/spine-c/src/spine/PathAttachment.c
     ${spineruntimes_dir}/spine-c/spine-c/src/spine/PathConstraint.c
     ${spineruntimes_dir}/spine-c/spine-c/src/spine/PathConstraintData.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/PhysicsConstraint.c
+    ${spineruntimes_dir}/spine-c/spine-c/src/spine/PhysicsConstraintData.c
     ${spineruntimes_dir}/spine-c/spine-c/src/spine/PointAttachment.c
     ${spineruntimes_dir}/spine-c/spine-c/src/spine/RegionAttachment.c
     ${spineruntimes_dir}/spine-c/spine-c/src/spine/Sequence.c

+ 4 - 2
util/sokol_spine.h

@@ -4590,7 +4590,8 @@ static sspine_resource_state _sspine_init_instance(_sspine_instance_t* instance,
     spSkeleton_setToSetupPose(instance->sp_skel);
     spAnimationState_update(instance->sp_anim_state, 0.0f);
     spAnimationState_apply(instance->sp_anim_state, instance->sp_skel);
-    spSkeleton_updateWorldTransform(instance->sp_skel);
+    spSkeleton_update(instance->sp_skel, 0.0f);
+    spSkeleton_updateWorldTransform(instance->sp_skel, SP_PHYSICS_UPDATE);
 
     return SSPINE_RESOURCESTATE_VALID;
 }
@@ -5379,7 +5380,8 @@ SOKOL_API_IMPL void sspine_update_instance(sspine_instance instance_id, float de
         _sspine_rewind_triggered_events(instance);
         spAnimationState_update(instance->sp_anim_state, delta_time);
         spAnimationState_apply(instance->sp_anim_state, instance->sp_skel);
-        spSkeleton_updateWorldTransform(instance->sp_skel);
+        spSkeleton_update(instance->sp_skel, delta_time);
+        spSkeleton_updateWorldTransform(instance->sp_skel, SP_PHYSICS_UPDATE);
     }
 }