From 1cb7dd58ecfde6d5f4557b43e73cfb43ec434e3e Mon Sep 17 00:00:00 2001 From: pipu Date: Thu, 12 Jun 2014 19:40:58 +0800 Subject: [PATCH 1/2] add CCNodeReader into project --- build/cocos2d_libs.xcodeproj/project.pbxproj | 36 +++++++------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index a1bf7062ee..c80b0628b2 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -995,18 +995,10 @@ 2AC795EA1862875D005EC8E1 /* BoundingBoxAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D418628672005EC8E1 /* BoundingBoxAttachment.h */; }; 373B9129187891F400198F86 /* CCComBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 373B910718787C0B00198F86 /* CCComBase.h */; }; 373B912A187891FB00198F86 /* CCComBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 373B910718787C0B00198F86 /* CCComBase.h */; }; - 38FA2E0D1949569800FF2BE4 /* CCAsyncReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E011949569800FF2BE4 /* CCAsyncReader.cpp */; }; - 38FA2E0E1949569800FF2BE4 /* CCAsyncReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E011949569800FF2BE4 /* CCAsyncReader.cpp */; }; - 38FA2E0F1949569800FF2BE4 /* CCAsyncReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E021949569800FF2BE4 /* CCAsyncReader.h */; }; - 38FA2E101949569800FF2BE4 /* CCAsyncReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E021949569800FF2BE4 /* CCAsyncReader.h */; }; 38FA2E111949569800FF2BE4 /* CCFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E031949569800FF2BE4 /* CCFrame.cpp */; }; 38FA2E121949569800FF2BE4 /* CCFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E031949569800FF2BE4 /* CCFrame.cpp */; }; 38FA2E131949569800FF2BE4 /* CCFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E041949569800FF2BE4 /* CCFrame.h */; }; 38FA2E141949569800FF2BE4 /* CCFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E041949569800FF2BE4 /* CCFrame.h */; }; - 38FA2E151949569800FF2BE4 /* CCNodeCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E051949569800FF2BE4 /* CCNodeCache.cpp */; }; - 38FA2E161949569800FF2BE4 /* CCNodeCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E051949569800FF2BE4 /* CCNodeCache.cpp */; }; - 38FA2E171949569800FF2BE4 /* CCNodeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E061949569800FF2BE4 /* CCNodeCache.h */; }; - 38FA2E181949569800FF2BE4 /* CCNodeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E061949569800FF2BE4 /* CCNodeCache.h */; }; 38FA2E191949569800FF2BE4 /* CCTimeLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E071949569800FF2BE4 /* CCTimeLine.cpp */; }; 38FA2E1A1949569800FF2BE4 /* CCTimeLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E071949569800FF2BE4 /* CCTimeLine.cpp */; }; 38FA2E1B1949569800FF2BE4 /* CCTimeLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E081949569800FF2BE4 /* CCTimeLine.h */; }; @@ -1019,6 +1011,10 @@ 38FA2E221949569800FF2BE4 /* CCTimelineActionCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E0B1949569800FF2BE4 /* CCTimelineActionCache.cpp */; }; 38FA2E231949569800FF2BE4 /* CCTimelineActionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E0C1949569800FF2BE4 /* CCTimelineActionCache.h */; }; 38FA2E241949569800FF2BE4 /* CCTimelineActionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E0C1949569800FF2BE4 /* CCTimelineActionCache.h */; }; + 38FA2E341949C75600FF2BE4 /* CCNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E321949C75600FF2BE4 /* CCNodeReader.cpp */; }; + 38FA2E351949C75600FF2BE4 /* CCNodeReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38FA2E321949C75600FF2BE4 /* CCNodeReader.cpp */; }; + 38FA2E361949C75600FF2BE4 /* CCNodeReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E331949C75600FF2BE4 /* CCNodeReader.h */; }; + 38FA2E371949C75600FF2BE4 /* CCNodeReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 38FA2E331949C75600FF2BE4 /* CCNodeReader.h */; }; 3EA0FB6B191C841D00B170C8 /* UIVideoPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */; }; 3EA0FB6C191C841D00B170C8 /* UIVideoPlayerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */; }; 460E468118080832000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; }; @@ -2299,18 +2295,16 @@ 37936A3C1869B76800E974DD /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = ""; }; 37936A3D1869B76800E974DD /* stringbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringbuffer.h; sourceTree = ""; }; 37936A3E1869B76800E974DD /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = ""; }; - 38FA2E011949569800FF2BE4 /* CCAsyncReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAsyncReader.cpp; sourceTree = ""; }; - 38FA2E021949569800FF2BE4 /* CCAsyncReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAsyncReader.h; sourceTree = ""; }; 38FA2E031949569800FF2BE4 /* CCFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFrame.cpp; sourceTree = ""; }; 38FA2E041949569800FF2BE4 /* CCFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFrame.h; sourceTree = ""; }; - 38FA2E051949569800FF2BE4 /* CCNodeCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeCache.cpp; sourceTree = ""; }; - 38FA2E061949569800FF2BE4 /* CCNodeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeCache.h; sourceTree = ""; }; 38FA2E071949569800FF2BE4 /* CCTimeLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTimeLine.cpp; sourceTree = ""; }; 38FA2E081949569800FF2BE4 /* CCTimeLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTimeLine.h; sourceTree = ""; }; 38FA2E091949569800FF2BE4 /* CCTimelineAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTimelineAction.cpp; sourceTree = ""; }; 38FA2E0A1949569800FF2BE4 /* CCTimelineAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTimelineAction.h; sourceTree = ""; }; 38FA2E0B1949569800FF2BE4 /* CCTimelineActionCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTimelineActionCache.cpp; sourceTree = ""; }; 38FA2E0C1949569800FF2BE4 /* CCTimelineActionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTimelineActionCache.h; sourceTree = ""; }; + 38FA2E321949C75600FF2BE4 /* CCNodeReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeReader.cpp; sourceTree = ""; }; + 38FA2E331949C75600FF2BE4 /* CCNodeReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeReader.h; sourceTree = ""; }; 3EA0FB69191C841D00B170C8 /* UIVideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIVideoPlayer.h; sourceTree = ""; }; 3EA0FB6A191C841D00B170C8 /* UIVideoPlayerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIVideoPlayerIOS.mm; sourceTree = ""; }; 46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = ""; }; @@ -4042,12 +4036,10 @@ 38FA2E001949569800FF2BE4 /* TimelineAction */ = { isa = PBXGroup; children = ( - 38FA2E011949569800FF2BE4 /* CCAsyncReader.cpp */, - 38FA2E021949569800FF2BE4 /* CCAsyncReader.h */, + 38FA2E321949C75600FF2BE4 /* CCNodeReader.cpp */, + 38FA2E331949C75600FF2BE4 /* CCNodeReader.h */, 38FA2E031949569800FF2BE4 /* CCFrame.cpp */, 38FA2E041949569800FF2BE4 /* CCFrame.h */, - 38FA2E051949569800FF2BE4 /* CCNodeCache.cpp */, - 38FA2E061949569800FF2BE4 /* CCNodeCache.h */, 38FA2E071949569800FF2BE4 /* CCTimeLine.cpp */, 38FA2E081949569800FF2BE4 /* CCTimeLine.h */, 38FA2E091949569800FF2BE4 /* CCTimelineAction.cpp */, @@ -5197,7 +5189,6 @@ 50ABC00B1926664800A911A9 /* CCDevice.h in Headers */, 2905FA7A18CF08D100240AA3 /* UISlider.h in Headers */, 1A8C59AD180E930E00EF57C3 /* CCArmatureDefine.h in Headers */, - 38FA2E171949569800FF2BE4 /* CCNodeCache.h in Headers */, 50ABC0131926664800A911A9 /* CCGLViewProtocol.h in Headers */, 1A8C59B1180E930E00EF57C3 /* CCBatchNode.h in Headers */, 50ABBDB31925AB4100A911A9 /* ccShaders.h in Headers */, @@ -5212,6 +5203,7 @@ 38FA2E231949569800FF2BE4 /* CCTimelineActionCache.h in Headers */, 1A8C59C5180E930E00EF57C3 /* CCComController.h in Headers */, 1A8C59C9180E930E00EF57C3 /* CCComRender.h in Headers */, + 38FA2E361949C75600FF2BE4 /* CCNodeReader.h in Headers */, 1A8C59CD180E930E00EF57C3 /* CCDataReaderHelper.h in Headers */, 50ABBEB11925AB6F00A911A9 /* CCUserDefault.h in Headers */, 50ABBEC71925AB6F00A911A9 /* etc1.h in Headers */, @@ -5222,7 +5214,6 @@ 1A8C59D9180E930E00EF57C3 /* CCDisplayFactory.h in Headers */, 50ABC0691926664800A911A9 /* CCStdC.h in Headers */, 50ABBECD1925AB6F00A911A9 /* s3tc.h in Headers */, - 38FA2E0F1949569800FF2BE4 /* CCAsyncReader.h in Headers */, 50ABBE771925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */, 1A8C59DD180E930E00EF57C3 /* CCDisplayManager.h in Headers */, 1A8C59E1180E930E00EF57C3 /* CCInputDelegate.h in Headers */, @@ -5445,6 +5436,7 @@ 50ABBD9E1925AB4100A911A9 /* ccGLStateCache.h in Headers */, 1A57008C180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */, 2905FA8318CF08D100240AA3 /* UITextAtlas.h in Headers */, + 38FA2E371949C75600FF2BE4 /* CCNodeReader.h in Headers */, 1A570090180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */, 1A570094180BC5A10088DEC7 /* CCActionTween.h in Headers */, 1A57009B180BC5C10088DEC7 /* CCAtlasNode.h in Headers */, @@ -5494,7 +5486,6 @@ 50ABBE9E1925AB6F00A911A9 /* CCRefPtr.h in Headers */, 1A01C69518F57BE800EFE3A6 /* CCFloat.h in Headers */, 1A5701CA180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */, - 38FA2E181949569800FF2BE4 /* CCNodeCache.h in Headers */, 2905FA7B18CF08D100240AA3 /* UISlider.h in Headers */, 5034CA22191D591100CE6051 /* ccShader_PositionTextureColorAlphaTest.frag in Headers */, 50ABBECE1925AB6F00A911A9 /* s3tc.h in Headers */, @@ -5689,7 +5680,6 @@ 1A8C599E180E930E00EF57C3 /* CCActionObject.h in Headers */, 1A8C59A2180E930E00EF57C3 /* CCArmature.h in Headers */, 1A8C59A6180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */, - 38FA2E101949569800FF2BE4 /* CCAsyncReader.h in Headers */, 2905FA8718CF08D100240AA3 /* UITextBMFont.h in Headers */, 1A8C59AA180E930E00EF57C3 /* CCArmatureDataManager.h in Headers */, 1A8C59AE180E930E00EF57C3 /* CCArmatureDefine.h in Headers */, @@ -6234,6 +6224,7 @@ 1A5702EE180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */, 50ABBE691925AB6F00A911A9 /* CCEventListenerFocus.cpp in Sources */, 1A5702F2180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */, + 38FA2E341949C75600FF2BE4 /* CCNodeReader.cpp in Sources */, 1A5702F6180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */, 38FA2E191949569800FF2BE4 /* CCTimeLine.cpp in Sources */, 1A5702FA180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */, @@ -6277,7 +6268,6 @@ 2905FA6A18CF08D100240AA3 /* UIPageView.cpp in Sources */, B29594C61926D61F003EEF37 /* CCObjLoader.cpp in Sources */, 06CAAAC7186AD7E90012A414 /* TriggerObj.cpp in Sources */, - 38FA2E151949569800FF2BE4 /* CCNodeCache.cpp in Sources */, 1AD71DEF180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */, 50ABC01D1926664800A911A9 /* CCThread.cpp in Sources */, 1AD71DF3180E26E600808F54 /* CCNodeLoader.cpp in Sources */, @@ -6315,7 +6305,6 @@ 50E6D33818E174130051CA34 /* UIRelativeBox.cpp in Sources */, 1AD71ECD180E26E600808F54 /* Skeleton.cpp in Sources */, 1AD71ED1180E26E600808F54 /* SkeletonData.cpp in Sources */, - 38FA2E0D1949569800FF2BE4 /* CCAsyncReader.cpp in Sources */, 1AD71ED5180E26E600808F54 /* SkeletonJson.cpp in Sources */, B29594CA1926D61F003EEF37 /* CCSprite3D.cpp in Sources */, 1AD71ED9180E26E600808F54 /* Skin.cpp in Sources */, @@ -6627,6 +6616,7 @@ 1A5701B6180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */, 50ABBEAC1925AB6F00A911A9 /* ccTypes.cpp in Sources */, 1A5701BA180BCB5A0088DEC7 /* CCLabel.cpp in Sources */, + 38FA2E351949C75600FF2BE4 /* CCNodeReader.cpp in Sources */, 2905FA4B18CF08D100240AA3 /* UICheckBox.cpp in Sources */, 1A5701BE180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */, 1A5701C2180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */, @@ -6834,12 +6824,10 @@ 1A8C59EC180E930E00EF57C3 /* CCSkin.cpp in Sources */, 2905FA4718CF08D100240AA3 /* UIButton.cpp in Sources */, 1A8C59F0180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */, - 38FA2E161949569800FF2BE4 /* CCNodeCache.cpp in Sources */, 50ABBEB41925AB6F00A911A9 /* CCUserDefault.mm in Sources */, 1A1645B1191B726C008C7C7F /* ConvertUTF.c in Sources */, 1A8C59F4180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */, 1A8C59F8180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */, - 38FA2E0E1949569800FF2BE4 /* CCAsyncReader.cpp in Sources */, 50ABBE3A1925AB6F00A911A9 /* CCData.cpp in Sources */, 1A8C59FC180E930E00EF57C3 /* CCTween.cpp in Sources */, 2905FA5318CF08D100240AA3 /* UIImageView.cpp in Sources */, From c0170d23c7c2199cd131e8fdc7ea215215cda259 Mon Sep 17 00:00:00 2001 From: pipu Date: Thu, 12 Jun 2014 19:56:15 +0800 Subject: [PATCH 2/2] fixed warnings --- .../cocostudio/TimelineAction/CCFrame.cpp | 4 +- .../cocostudio/TimelineAction/CCFrame.h | 6 +-- .../TimelineAction/CCNodeReader.cpp | 39 +++++++------------ .../cocostudio/TimelineAction/CCTimeLine.cpp | 3 -- .../TimelineAction/CCTimelineActionCache.cpp | 11 ------ 5 files changed, 19 insertions(+), 44 deletions(-) diff --git a/cocos/editor-support/cocostudio/TimelineAction/CCFrame.cpp b/cocos/editor-support/cocostudio/TimelineAction/CCFrame.cpp index 9184b7c1f0..9f1dd4ae94 100644 --- a/cocos/editor-support/cocostudio/TimelineAction/CCFrame.cpp +++ b/cocos/editor-support/cocostudio/TimelineAction/CCFrame.cpp @@ -105,11 +105,11 @@ TextureFrame::TextureFrame() { } -void TextureFrame::setNode(cocos2d::CCNode* node) +void TextureFrame::setNode(cocos2d::Node* node) { Frame::setNode(node); - _sprite = dynamic_cast(node); + _sprite = dynamic_cast(node); } void TextureFrame::onEnter(Frame *nextFrame) diff --git a/cocos/editor-support/cocostudio/TimelineAction/CCFrame.h b/cocos/editor-support/cocostudio/TimelineAction/CCFrame.h index 2f32ba824e..83188376ad 100644 --- a/cocos/editor-support/cocostudio/TimelineAction/CCFrame.h +++ b/cocos/editor-support/cocostudio/TimelineAction/CCFrame.h @@ -31,7 +31,7 @@ namespace cocostudio { namespace timeline{ -class Frame : public cocos2d::Object +class Frame : public cocos2d::Ref { public: @@ -92,7 +92,7 @@ public: TextureFrame(); - virtual void setNode(cocos2d::CCNode* node); + virtual void setNode(cocos2d::Node* node); virtual void onEnter(Frame *nextFrame) override; virtual Frame* clone() override; @@ -101,7 +101,7 @@ public: inline std::string getTexture() const { return _texture; } protected: - cocos2d::CCSprite* _sprite; + cocos2d::Sprite* _sprite; std::string _texture; }; diff --git a/cocos/editor-support/cocostudio/TimelineAction/CCNodeReader.cpp b/cocos/editor-support/cocostudio/TimelineAction/CCNodeReader.cpp index 4b86209a7a..64351e3980 100644 --- a/cocos/editor-support/cocostudio/TimelineAction/CCNodeReader.cpp +++ b/cocos/editor-support/cocostudio/TimelineAction/CCNodeReader.cpp @@ -85,21 +85,6 @@ static const char* RED = "colorR"; static const char* GREEN = "colorG"; static const char* BLUE = "colorB"; static const char* PARTICLE_NUM = "particleNum"; - -static const char* MULRESPOSITION = "mulResPosition"; -static const char* POSITIONTYPE = "positionType"; -static const char* MUL_POSITION = "position"; -static const char* MUL_POSITIONX = "x"; -static const char* MUL_POSITIONY = "y"; -static const char* MUL_POSITIONPERCENTAGE = "percentagepos"; -static const char* MUL_POSITIONPERCENTAGEX = "x"; -static const char* MUL_POSITIONPERCENTAGEY = "y"; -static const char* MUL_RELATIVEALIGN = "mulpositionpercentage"; -static const char* MUL_MARGIN = "margin"; -static const char* MUL_MARGIN_LEFT = "left"; -static const char* MUL_MARGIN_TOP = "top"; -static const char* MUL_MARGIN_RIGHT = "right"; -static const char* MUL_MARGIN_BOTTOM = "bottom"; static const char* TEXTURES = "textures"; static const char* TEXTURES_PNG = "texturesPng"; @@ -193,13 +178,13 @@ cocos2d::Node* NodeReader::createNode(const std::string& filename) if(_recordJsonPath) { std::string jsonPath = filename.substr(0, filename.find_last_of('/') + 1); - GUIReader::shareReader()->setFilePath(jsonPath); + GUIReader::getInstance()->setFilePath(jsonPath); _jsonPath = jsonPath; } else { - GUIReader::shareReader()->setFilePath(""); + GUIReader::getInstance()->setFilePath(""); _jsonPath = ""; } @@ -307,7 +292,7 @@ void NodeReader::initNode(cocos2d::Node* node, const rapidjson::Value& json) int actionTag = DICTOOL->getIntValue_json(json, ACTION_TAG); if(x != 0 || y != 0) - node->setPosition(CCPoint(x, y)); + node->setPosition(Point(x, y)); if(scalex != 1) node->setScaleX(scalex); if(scaley != 1) @@ -323,18 +308,22 @@ void NodeReader::initNode(cocos2d::Node* node, const rapidjson::Value& json) if(skewy != 0) node->setSkewY(skewy); if(anchorx != 0.5f || anchory != 0.5f) - node->setAnchorPoint(CCPoint(anchorx, anchory)); + node->setAnchorPoint(Point(anchorx, anchory)); if(width != 0 || height != 0) node->setContentSize(Size(width, height)); - CCRGBAProtocol *rgbaProtocaol = dynamic_cast(node); - if(rgbaProtocaol) + + if(alpha != 255) { - if(alpha != 255) - rgbaProtocaol->setOpacity(alpha); rgbaProtocaol->setCascadeOpacityEnabled(true); - if(red != 255 || green != 255 || blue != 255) - rgbaProtocaol->setColor(ccc3(red, green, blue)); + node->setOpacity(alpha); + node->setCascadeOpacityEnabled(true); } + if(red != 255 || green != 255 || blue != 255) + { + node->setColor(Color3B(red, green, blue)); + node->setCascadeColorEnabled(true); + } + node->setTag(tag); node->setUserObject(TimelineActionData::create(actionTag)); diff --git a/cocos/editor-support/cocostudio/TimelineAction/CCTimeLine.cpp b/cocos/editor-support/cocostudio/TimelineAction/CCTimeLine.cpp index d9b34e4524..0c1a6d93aa 100644 --- a/cocos/editor-support/cocostudio/TimelineAction/CCTimeLine.cpp +++ b/cocos/editor-support/cocostudio/TimelineAction/CCTimeLine.cpp @@ -136,10 +136,7 @@ void Timeline::binarySearchKeyFrame(int frameIndex) Frame *from = NULL; Frame *to = NULL; - int step = 2; - int target = 0; long length = _frames.size(); - bool needEnterFrame = false; do diff --git a/cocos/editor-support/cocostudio/TimelineAction/CCTimelineActionCache.cpp b/cocos/editor-support/cocostudio/TimelineAction/CCTimelineActionCache.cpp index 9fb1b18899..05d85d148d 100644 --- a/cocos/editor-support/cocostudio/TimelineAction/CCTimelineActionCache.cpp +++ b/cocos/editor-support/cocostudio/TimelineAction/CCTimelineActionCache.cpp @@ -46,14 +46,11 @@ static const char* FrameType_EventFrame = "EventFrame"; static const char* FrameType_ZOrderFrame = "ZOrderFrame"; static const char* ACTION = "action"; -static const char* NAME = "name"; static const char* DURATION = "duration"; -static const char* NODES = "nodes"; static const char* TIMELINES = "timelines"; static const char* FRAME_TYPE = "frameType"; static const char* FRAMES = "frames"; static const char* FRAME_INDEX = "frameIndex"; -static const char* VISIBLE = "visible"; static const char* TWEEN = "tween"; static const char* TIME_SPEED = "speed"; static const char* ACTION_TAG = "actionTag"; @@ -62,15 +59,7 @@ static const char* START_FRAME = "startFrame"; static const char* X = "x"; static const char* Y = "y"; -static const char* SCALE_X = "scaleX"; -static const char* SCALE_Y = "scaleY"; -static const char* SKEW_X = "skewX"; -static const char* SKEW_Y = "skewY"; static const char* ROTATION = "rotation"; -static const char* ROTATION_SKEW_X = "rotationSkewX"; -static const char* ROTATION_SKEW_Y = "rotationSkewY"; -static const char* ANCHOR_X = "anchorPointX"; -static const char* ANCHOR_Y = "anchorPointY"; static const char* ALPHA = "alpha"; static const char* RED = "red"; static const char* GREEN = "green";