[ue4] Reverted re-import fix, lead to memory corruption...

This commit is contained in:
badlogic 2018-09-28 17:54:27 +02:00
parent bb48f1466b
commit 6f486a03a1

View File

@ -104,27 +104,11 @@ void USpineSkeletonAnimationComponent::InternalTick(float DeltaTime, bool CallDe
}
void USpineSkeletonAnimationComponent::CheckState () {
bool needsUpdate = 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) {
if (lastAtlas != Atlas || lastData != SkeletonData) {
DisposeState();
if (Atlas && SkeletonData) {
spine::SkeletonData *data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), true);
spine::SkeletonData *data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
if (data) {
skeleton = new (__FILE__, __LINE__) Skeleton(data);
AnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas(false));