From 532269c44eb023e94df2ac6d540bb38c95aefafd Mon Sep 17 00:00:00 2001 From: pipu Date: Tue, 13 Jan 2015 11:07:06 +0800 Subject: [PATCH 1/2] fix bug: cut inner timeline action as outer timeline action's length --- cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp index 733b774544..25c4d460f3 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp @@ -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) { actiontimeline->gotoFrameAndPlay(start, end, false); From a20cc2b151eeb29b84038db38845d477f7202bef Mon Sep 17 00:00:00 2001 From: pipu Date: Tue, 13 Jan 2015 11:12:28 +0800 Subject: [PATCH 2/2] Modify that parses plist for cocostudio editor simulator. --- cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index ed9af698af..5d02225e85 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -1129,15 +1129,11 @@ Node* CSLoader::createNodeWithFlatBuffersForSimulator(const std::string& filenam // decode plist auto textures = csparsebinary->textures(); - auto texturePngs = csparsebinary->texturePngs(); int textureSize = csparsebinary->textures()->size(); // CCLOG("textureSize = %d", textureSize); for (int i = 0; i < textureSize; ++i) { - std::string texture = textures->Get(i)->c_str(); - std::string texturePng = texturePngs->Get(i)->c_str(); - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(texture, - texturePng); + SpriteFrameCache::getInstance()->addSpriteFramesWithFile(textures->Get(i)->c_str()); } auto nodeTree = csparsebinary->nodeTree();