Ejemplo n.º 1
0
CCSkeletonAnimation::~CCSkeletonAnimation () {
	for (std::vector<AnimationStateData*>::iterator iter = stateDatas.begin(); iter != stateDatas.end(); ++iter)
		AnimationStateData_dispose(*iter);

	for (std::vector<AnimationState*>::iterator iter = states.begin(); iter != states.end(); ++iter)
		AnimationState_dispose(*iter);
}
Ejemplo n.º 2
0
void CCSkeletonAnimation::setAnimationStateData (AnimationStateData* stateData, int stateIndex) {
	CCAssert(stateIndex >= 0 && stateIndex < (int)states.size(), "stateIndex out of range.");
	CCAssert(stateData, "stateData cannot be null.");

	AnimationState* state = states[stateIndex];
	for (std::vector<AnimationStateData*>::iterator iter = stateDatas.begin(); iter != stateDatas.end(); ++iter) {
		if (state->data == *iter) {
			AnimationStateData_dispose(state->data);
			stateDatas.erase(iter);
			break;
		}
	}
	for (std::vector<AnimationState*>::iterator iter = states.begin(); iter != states.end(); ++iter) {
		if (state == *iter) {
			states.erase(iter);
			break;
		}
	}
	AnimationState_dispose(state);

	state = AnimationState_create(stateData);
	states[stateIndex] = state;
}
Ejemplo n.º 3
0
CCSkeleton::~CCSkeleton () {
	if (ownsSkeleton) Skeleton_dispose(skeleton);
	if (ownsStateData) AnimationStateData_dispose(state->data);
	if (atlas) Atlas_dispose(atlas);
	AnimationState_dispose(state);
}
Ejemplo n.º 4
0
CCSkeleton::~CCSkeleton () {
	Skeleton_dispose(skeleton);
	if (ownsStateData) AnimationStateData_dispose(state->data);
	AnimationState_dispose(state);
}