Skip to content

Commit

Permalink
[c] Listeners on spAnimationState and spTrackEntry will now also be c…
Browse files Browse the repository at this point in the history
…alled if a track entry gets disposed as part of disposing an spAnimationState.
  • Loading branch information
badlogic committed Sep 5, 2017
1 parent 017d224 commit a4a9796
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -35,6 +35,7 @@
* Removed `spBone_worldToLocalRotationX` and `spBone_worldToLocalRotationY`. Replaced by `spBone_worldToLocalRotation` (rotation given relative to x-axis, counter-clockwise, in degrees).
* Replaced `r`, `g`, `b`, `a` fields with instances of new `spColor` struct in `spRegionAttachment`, `spMeshAttachment`, `spSkeleton`, `spSkeletonData`, `spSlot` and `spSlotData`.
* Removed `spVertexIndex`from public API.
* Listeners on `spAnimationState` or `spTrackEntry` will now be also called in case a track entry is disposed as part of dispoing the `spAnimationState`.
* **Additions**
* Added support for local and relative transform constraint calculation, including additional fields in `spTransformConstraintData`.
* Added `spPointAttachment`, additional method `spAtlasAttachmentLoadeR_newPointAttachment`.
Expand Down
2 changes: 1 addition & 1 deletion spine-c/spine-c/include/spine/dll.h
Expand Up @@ -45,4 +45,4 @@
#define SP_API SPINEPLUGIN_API
#endif

#endif /* SPINE_SHAREDLIB_H */
#endif /* SPINE_SHAREDLIB_H */
4 changes: 4 additions & 0 deletions spine-c/spine-c/src/spine/AnimationState.c
Expand Up @@ -193,9 +193,13 @@ void _spAnimationState_disposeTrackEntries (spAnimationState* state, spTrackEntr
spTrackEntry* from = entry->mixingFrom;
while (from) {
spTrackEntry* nextFrom = from->mixingFrom;
if (entry->listener) entry->listener(state, SP_ANIMATION_DISPOSE, from, 0);
if (state->listener) state->listener(state, SP_ANIMATION_DISPOSE, from, 0);
_spAnimationState_disposeTrackEntry(from);
from = nextFrom;
}
if (entry->listener) entry->listener(state, SP_ANIMATION_DISPOSE, entry, 0);
if (state->listener) state->listener(state, SP_ANIMATION_DISPOSE, entry, 0);
_spAnimationState_disposeTrackEntry(entry);
entry = next;
}
Expand Down

0 comments on commit a4a9796

Please sign in to comment.