mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
- Remove erroneous i+=3 increment in SkeletonClipping.cpp that caused triangle skipping - Add missing continue statement to match Java reference implementation behavior - Portal animation now renders correctly with proper triangular clipping
1.6 KiB
1.6 KiB
C++ Clipping Appears Broken
Status: Done Agent PID: 7713
Original Todo
c++ clipping appears broken, try with portal animation in spine-glfw
Description
Fix critical bugs in the C++ clipping implementation that cause triangles to be skipped during clipping operations. The analysis reveals that the C++ port of the Java reference implementation has several bugs, most notably an erroneous loop increment that causes incomplete triangle processing during clipping.
Implementation Plan
- Fix triangle skipping bug: Remove line 249
i += 3;from spine-cpp/src/spine/SkeletonClipping.cpp in clipTriangles method (keepindex += 3; break;only) - Analyze Java labeled continue statements: Compare spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonClipping.java lines 414-430 with C++ lines 322-336 to determine correct control flow
- Fix polygon clipping control flow: Modify spine-cpp/src/spine/SkeletonClipping.cpp lines 322-336 to properly handle intersection cases (replace missing continue logic with appropriate break/goto)
- Build spine-cpp: Run
cd spine-cpp && cmake -B build && cmake --build buildto verify compilation - Enable portal test: Uncomment line 90 in spine-glfw/example/main.cpp:
animationState.setAnimation(0, "portal", true);(already enabled) - Build spine-glfw: Run
cd spine-glfw && cmake -B build && cmake --build buildto compile test - User test: Run spine-glfw example and verify portal animation shows correct triangular clipping (no missing/skipped triangles)
Notes
[Implementation notes]