mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ue4] Reverted re-import fix, lead to memory corruption...
This commit is contained in:
parent
bb48f1466b
commit
6f486a03a1
@ -104,27 +104,11 @@ void USpineSkeletonAnimationComponent::InternalTick(float DeltaTime, bool CallDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonAnimationComponent::CheckState () {
|
void USpineSkeletonAnimationComponent::CheckState () {
|
||||||
bool needsUpdate = lastAtlas != Atlas || lastData != SkeletonData;
|
if (lastAtlas != Atlas || lastData != SkeletonData) {
|
||||||
|
|
||||||
if (!needsUpdate) {
|
|
||||||
// Are we doing a re-import? Then check if the underlying spine-cpp data
|
|
||||||
// has changed.
|
|
||||||
if (lastAtlas && lastAtlas == Atlas && lastData && lastData == SkeletonData) {
|
|
||||||
spine::Atlas* atlas = Atlas->GetAtlas(false);
|
|
||||||
if (lastSpineAtlas != atlas) {
|
|
||||||
needsUpdate = true;
|
|
||||||
}
|
|
||||||
if (skeleton && skeleton->getData() != SkeletonData->GetSkeletonData(atlas)) {
|
|
||||||
needsUpdate = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needsUpdate) {
|
|
||||||
DisposeState();
|
DisposeState();
|
||||||
|
|
||||||
if (Atlas && SkeletonData) {
|
if (Atlas && SkeletonData) {
|
||||||
spine::SkeletonData *data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), true);
|
spine::SkeletonData *data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
|
||||||
if (data) {
|
if (data) {
|
||||||
skeleton = new (__FILE__, __LINE__) Skeleton(data);
|
skeleton = new (__FILE__, __LINE__) Skeleton(data);
|
||||||
AnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas(false));
|
AnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas(false));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user