Merge pull request #9951 from pipu/update_inneractionframe

Update InnerActionFrame
This commit is contained in:
minggo 2015-01-13 17:10:39 +08:00
commit 78e6d2f7ab
2 changed files with 8 additions and 5 deletions

View File

@ -508,6 +508,13 @@ void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
} }
} }
int duration = _timeline->getActionTimeline()->getDuration();
int odddiff = duration - _frameIndex - end + start;
if (odddiff < 0)
{
end += odddiff;
}
if (InnerActionType::NoLoopAction == _innerActionType) if (InnerActionType::NoLoopAction == _innerActionType)
{ {
actiontimeline->gotoFrameAndPlay(start, end, false); actiontimeline->gotoFrameAndPlay(start, end, false);

View File

@ -1129,15 +1129,11 @@ Node* CSLoader::createNodeWithFlatBuffersForSimulator(const std::string& filenam
// decode plist // decode plist
auto textures = csparsebinary->textures(); auto textures = csparsebinary->textures();
auto texturePngs = csparsebinary->texturePngs();
int textureSize = csparsebinary->textures()->size(); int textureSize = csparsebinary->textures()->size();
// CCLOG("textureSize = %d", textureSize); // CCLOG("textureSize = %d", textureSize);
for (int i = 0; i < textureSize; ++i) for (int i = 0; i < textureSize; ++i)
{ {
std::string texture = textures->Get(i)->c_str(); SpriteFrameCache::getInstance()->addSpriteFramesWithFile(textures->Get(i)->c_str());
std::string texturePng = texturePngs->Get(i)->c_str();
SpriteFrameCache::getInstance()->addSpriteFramesWithFile(texture,
texturePng);
} }
auto nodeTree = csparsebinary->nodeTree(); auto nodeTree = csparsebinary->nodeTree();