[c] Listeners on spAnimationState and spTrackEntry will now also be called if a track entry gets disposed as part of disposing an spAnimationState.

This commit is contained in:
badlogic 2017-09-05 11:46:03 +02:00
parent 017d224cb6
commit a4a97969e8
3 changed files with 6 additions and 1 deletions

View File

@ -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`.

View File

@ -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;
}