SkeletonRenderer::~SkeletonRenderer () { if (_ownsSkeletonData) spSkeletonData_dispose(_skeleton->data); spSkeleton_dispose(_skeleton); if (_atlas) spAtlas_dispose(_atlas); if (_attachmentLoader) spAttachmentLoader_dispose(_attachmentLoader); delete _worldVertices; }
Skeleton::~Skeleton() { spAnimationStateData_dispose(animation_data_); spAnimationState_dispose(state_); spSkeleton_dispose(skeleton_); spSkeletonData_dispose(data_); spAtlas_dispose(atlas_); }
SpineDrawable::~SpineDrawable() { if (bounds) spSkeletonBounds_dispose(bounds); if (atlas) spAtlas_dispose(atlas); if (animationState) spAnimationState_dispose(animationState); if (animationStateData) spAnimationStateData_dispose(animationStateData); if (skeleton) spSkeleton_dispose(skeleton); if (skeletonData) spSkeletonData_dispose(skeletonData); }
static void testRunner(const char* jsonName, const char* atlasName) { /////////////////////////////////////////////////////////////////////////// // Global Animation Information spAtlas* atlas = spAtlas_createFromFile(atlasName, 0); ASSERT(atlas != 0); spSkeletonData* skeletonData = readSkeletonJsonData(jsonName, atlas); ASSERT(skeletonData != 0); spAnimationStateData* stateData = spAnimationStateData_create(skeletonData); ASSERT(stateData != 0); stateData->defaultMix = 0.2f; // force mixing /////////////////////////////////////////////////////////////////////////// // Animation Instance spSkeleton* skeleton = spSkeleton_create(skeletonData); ASSERT(skeleton != 0); spAnimationState* state = spAnimationState_create(stateData); ASSERT(state != 0); /////////////////////////////////////////////////////////////////////////// // Run animation spSkeleton_setToSetupPose(skeleton); SpineEventMonitor eventMonitor(state); // eventMonitor.SetDebugLogging(true); AnimList anims; // Let's chain all the animations together as a test size_t count = enumerateAnimations(anims, skeletonData); if (count > 0) spAnimationState_setAnimationByName(state, 0, anims[0].c_str(), false); for (size_t i = 1; i < count; ++i) { spAnimationState_addAnimationByName(state, 0, anims[i].c_str(), false, 0.0f); } // Run Loop for (int i = 0; i < MAX_RUN_TIME && eventMonitor.isAnimationPlaying(); ++i) { const float timeSlice = 1.0f / 60.0f; spSkeleton_update(skeleton, timeSlice); spAnimationState_update(state, timeSlice); spAnimationState_apply(state, skeleton); } /////////////////////////////////////////////////////////////////////////// // Dispose Instance spSkeleton_dispose(skeleton); spAnimationState_dispose(state); /////////////////////////////////////////////////////////////////////////// // Dispose Global spAnimationStateData_dispose(stateData); spSkeletonData_dispose(skeletonData); spAtlas_dispose(atlas); }
void USpineSkeletonAnimationComponent::DisposeState () { if (state) { spAnimationState_dispose(state); state = nullptr; } if (skeleton) { spSkeleton_dispose(skeleton); skeleton = nullptr; } trackEntries.Empty(); }
static void DisposeAll(spSkeleton* skeleton, spAnimationState* state, spAnimationStateData* stateData, spSkeletonData* skeletonData, spAtlas* atlas) { /////////////////////////////////////////////////////////////////////////// // Dispose Instance spSkeleton_dispose(skeleton); spAnimationState_dispose(state); /////////////////////////////////////////////////////////////////////////// // Dispose Global spAnimationStateData_dispose(stateData); spSkeletonData_dispose(skeletonData); spAtlas_dispose(atlas); }
void ComponentSpine::updateSpine(graphics::SpineManagerItem & animation) { if(skeleton && skeleton->data != animation.getSkeletonData()) { spSkeleton_dispose(skeleton); spAnimationState_dispose(animationState); skeleton = nullptr; } if(!skeleton) { skeleton = spSkeleton_create(animation.getSkeletonData()); animationState = spAnimationState_create(animation.getAnimationStateData()); } }
void SpineAnimation::destroy(JNIEnv* env) { if (this->skeleton) { spSkeleton_dispose(this->skeleton); } if (this->state) { spAnimationState_dispose(this->state); } this->callback->destroy(env); delete this->callback; delete this->vertices; delete this->center; delete this->bounds; this->boneVertBuffers.clear(); if(this->translator) { delete this->translator; } }
void SkeletonAnimationFbo::releaseSkeletonRelatedData() { if (mspAnimationState){ spAnimationStateData_dispose(mspAnimationState->data); spAnimationState_dispose(mspAnimationState); mspAnimationState = 0; } if (mspSkeleton) spSkeletonData_dispose(mspSkeleton->data); if (mspAtlas){ spAtlas_dispose(mspAtlas); mspAtlas = 0; } if (mspSkeleton) { spSkeleton_dispose(mspSkeleton); mspSkeleton = 0; } mSkeletonLoaded = false; mShouldRelaseCacheTexture = true; }
WIPAnimator::~WIPAnimator() { spAnimationState_dispose(state); spSkeleton_dispose(skeleton); delete _out_buffer; }
Skeleton::~Skeleton () { if (ownsSkeletonData) spSkeletonData_dispose(skeleton->data); if (atlas) spAtlas_dispose(atlas); spSkeleton_dispose(skeleton); }
SkeletonDrawable::~SkeletonDrawable () { delete vertexArray; spAnimationState_dispose(state); spSkeleton_dispose(skeleton); }