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