rename variables

This commit is contained in:
geron-cn 2015-01-14 13:02:30 +08:00
parent 78e6d2f7ab
commit ab2b86b392
1 changed files with 14 additions and 14 deletions

View File

@ -480,27 +480,27 @@ InnerActionFrame::InnerActionFrame()
void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
{
int start = _startFrameIndex;
int end = _endFrameIndex;
auto actiontimeline = static_cast<ActionTimeline*>(_node->getActionByTag(_node->getTag()));
auto innerActiontimeline = static_cast<ActionTimeline*>(_node->getActionByTag(_node->getTag()));
if (InnerActionType::SingleFrame == _innerActionType)
{
actiontimeline->gotoFrameAndPause(_singleFrameIndex);
innerActiontimeline->gotoFrameAndPause(_singleFrameIndex);
return;
}
int innerStart = _startFrameIndex;
int innerEnd = _endFrameIndex;
if (_enterWithName)
{
if (_animationName == AnimationAllName)
{
start = 0;
end = actiontimeline->getDuration();
innerStart = 0;
innerEnd = innerActiontimeline->getDuration();
}
else if(actiontimeline->IsAnimationInfoExists(_animationName))
else if(innerActiontimeline->IsAnimationInfoExists(_animationName))
{
AnimationInfo info = actiontimeline->getAnimationInfo(_animationName);
start = info.startIndex;
end = info.endIndex;
AnimationInfo info = innerActiontimeline->getAnimationInfo(_animationName);
innerStart = info.startIndex;
innerEnd = info.endIndex;
}
else
{
@ -509,19 +509,19 @@ void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
}
int duration = _timeline->getActionTimeline()->getDuration();
int odddiff = duration - _frameIndex - end + start;
int odddiff = duration - _frameIndex - innerEnd + innerStart;
if (odddiff < 0)
{
end += odddiff;
innerEnd += odddiff;
}
if (InnerActionType::NoLoopAction == _innerActionType)
{
actiontimeline->gotoFrameAndPlay(start, end, false);
innerActiontimeline->gotoFrameAndPlay(innerStart, innerEnd, false);
}
else if (InnerActionType::LoopAction == _innerActionType)
{
actiontimeline->gotoFrameAndPlay(start, end, true);
innerActiontimeline->gotoFrameAndPlay(innerStart, innerEnd, true);
}
}