Clean up.

This commit is contained in:
NathanSweet 2013-04-30 18:50:12 +02:00
parent b7ac58b0d2
commit 35b45a564b
3 changed files with 5 additions and 7 deletions

View File

@ -42,7 +42,6 @@ bool ExampleLayer::init () {
if (!CCLayer::init()) return false;
skeletonNode = new CCSkeletonAnimation("spineboy.json", "spineboy.atlas");
skeletonNode->addAnimationState();
skeletonNode->setMix("walk", "jump", 0.2f);
skeletonNode->setMix("jump", "walk", 0.4f);

View File

@ -219,11 +219,7 @@ CCRect CCSkeleton::boundingBox () {
maxY = max(maxY, quad.tr.vertices.y * scaleY);
}
CCPoint position = getPosition();
minX = position.x + minX;
minY = position.y + minY;
maxX = position.x + maxX;
maxY = position.y + maxY;
return CCRectMake(minX, minY, maxX - minX, maxY - minY);
return CCRectMake(position.x + minX, position.y + minY, maxX - minX, maxY - minY);
}
// CCBlendProtocol

View File

@ -54,14 +54,17 @@ CCSkeletonAnimation* CCSkeletonAnimation::createWithFile (const char* skeletonDa
CCSkeletonAnimation::CCSkeletonAnimation (SkeletonData *skeletonData)
: CCSkeleton(skeletonData) {
addAnimationState();
}
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, Atlas* atlas, float scale)
: CCSkeleton(skeletonDataFile, atlas, scale) {
addAnimationState();
}
CCSkeletonAnimation::CCSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale)
: CCSkeleton(skeletonDataFile, atlasFile, scale) {
addAnimationState();
}
CCSkeletonAnimation::~CCSkeletonAnimation () {
@ -113,7 +116,7 @@ void CCSkeletonAnimation::setAnimationStateData (AnimationStateData* stateData,
AnimationState_dispose(state);
state = AnimationState_create(stateData);
states.push_back(state);
states[stateIndex] = state;
}
void CCSkeletonAnimation::setMix (char* fromAnimation, char* toAnimation, float duration, int stateIndex) {