From 769b2cbc75c9cec38a30fdbe832649f99355e5eb Mon Sep 17 00:00:00 2001 From: youyou <501251991@qq.com> Date: Wed, 19 Nov 2014 20:06:10 +0800 Subject: [PATCH 1/3] add file to mac project --- build/cocos2d_libs.xcodeproj/project.pbxproj | 12 ++++ .../ActionTimeline/CCActionTimeLineNode.cpp | 57 ++++++++------- .../ActionTimeline/CCActionTimeLineNode.h | 71 ++++++++++--------- 3 files changed, 79 insertions(+), 61 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 452e52b591..f8f68274f9 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1326,6 +1326,10 @@ 46C02E0818E91123004B7456 /* xxhash.c in Sources */ = {isa = PBXBuildFile; fileRef = 46C02E0518E91123004B7456 /* xxhash.c */; }; 46C02E0918E91123004B7456 /* xxhash.h in Headers */ = {isa = PBXBuildFile; fileRef = 46C02E0618E91123004B7456 /* xxhash.h */; }; 46C02E0A18E91123004B7456 /* xxhash.h in Headers */ = {isa = PBXBuildFile; fileRef = 46C02E0618E91123004B7456 /* xxhash.h */; }; + 4DAB8DC61A1CBDB200F7B768 /* CCActionTimeLineNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DAB8DC41A1CBDB200F7B768 /* CCActionTimeLineNode.cpp */; }; + 4DAB8DC71A1CBDB200F7B768 /* CCActionTimeLineNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4DAB8DC41A1CBDB200F7B768 /* CCActionTimeLineNode.cpp */; }; + 4DAB8DC81A1CBDB200F7B768 /* CCActionTimeLineNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DAB8DC51A1CBDB200F7B768 /* CCActionTimeLineNode.h */; }; + 4DAB8DC91A1CBDB200F7B768 /* CCActionTimeLineNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DAB8DC51A1CBDB200F7B768 /* CCActionTimeLineNode.h */; }; 5027253A190BF1B900AAF4ED /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = 50272538190BF1B900AAF4ED /* cocos2d.h */; }; 5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = 50272538190BF1B900AAF4ED /* cocos2d.h */; }; 5027253C190BF1B900AAF4ED /* cocos2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50272539190BF1B900AAF4ED /* cocos2d.cpp */; }; @@ -2629,6 +2633,8 @@ 46A170781807CE7A005B8026 /* CCPhysicsWorld.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsWorld.h; sourceTree = ""; }; 46C02E0518E91123004B7456 /* xxhash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xxhash.c; sourceTree = ""; }; 46C02E0618E91123004B7456 /* xxhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xxhash.h; sourceTree = ""; }; + 4DAB8DC41A1CBDB200F7B768 /* CCActionTimeLineNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionTimeLineNode.cpp; sourceTree = ""; }; + 4DAB8DC51A1CBDB200F7B768 /* CCActionTimeLineNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTimeLineNode.h; sourceTree = ""; }; 50272538190BF1B900AAF4ED /* cocos2d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cocos2d.h; path = ../cocos/cocos2d.h; sourceTree = ""; }; 50272539190BF1B900AAF4ED /* cocos2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cocos2d.cpp; path = ../cocos/cocos2d.cpp; sourceTree = ""; }; 5034C9FB191D591000CE6051 /* ccShader_PositionTextureColorAlphaTest.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionTextureColorAlphaTest.frag; sourceTree = ""; }; @@ -3067,6 +3073,8 @@ 0634A4C4194B19E400E608AF /* ActionTimeline */ = { isa = PBXGroup; children = ( + 4DAB8DC41A1CBDB200F7B768 /* CCActionTimeLineNode.cpp */, + 4DAB8DC51A1CBDB200F7B768 /* CCActionTimeLineNode.h */, 38B8E2D319E66581002D7CE7 /* CSLoader.cpp */, 38B8E2D419E66581002D7CE7 /* CSLoader.h */, 0634A4C5194B19E400E608AF /* CCActionTimeline.cpp */, @@ -5280,6 +5288,7 @@ 1A5701B3180BCB590088DEC7 /* CCFontFNT.h in Headers */, 15AE1BD919AAE01E00C27E9E /* CCControlStepper.h in Headers */, 15AE192119AAD35000C27E9E /* CocoStudio.h in Headers */, + 4DAB8DC81A1CBDB200F7B768 /* CCActionTimeLineNode.h in Headers */, 15AE18A119AAD33D00C27E9E /* CCNodeLoaderListener.h in Headers */, 5034CA47191D591100CE6051 /* ccShader_Label_normal.frag in Headers */, 15AE182219AAD2F700C27E9E /* CCBundleReader.h in Headers */, @@ -6058,6 +6067,7 @@ 3E6176781960F89B00DE83F5 /* CCGameController.h in Headers */, 15AE19BB19AAD39700C27E9E /* TextReader.h in Headers */, 50ABBE641925AB6F00A911A9 /* CCEventListenerAcceleration.h in Headers */, + 4DAB8DC91A1CBDB200F7B768 /* CCActionTimeLineNode.h in Headers */, 15AE180B19AAD2F700C27E9E /* CCAABB.h in Headers */, 50ABBD921925AB4100A911A9 /* CCGLProgramCache.h in Headers */, 50ABBE961925AB6F00A911A9 /* CCProfiling.h in Headers */, @@ -6663,6 +6673,7 @@ 50ABBE5D1925AB6F00A911A9 /* CCEventListener.cpp in Sources */, B29A7E2D19EE1B7700872B35 /* Slot.c in Sources */, 15AE182819AAD2F700C27E9E /* CCMeshSkin.cpp in Sources */, + 4DAB8DC61A1CBDB200F7B768 /* CCActionTimeLineNode.cpp in Sources */, 15AE19A619AAD39600C27E9E /* TextReader.cpp in Sources */, 15AE198819AAD36A00C27E9E /* ButtonReader.cpp in Sources */, 15AE1A6319AAD40300C27E9E /* b2Island.cpp in Sources */, @@ -6909,6 +6920,7 @@ 15AE193419AAD35100C27E9E /* CCActionObject.cpp in Sources */, 15AE1AD619AAD40300C27E9E /* b2WheelJoint.cpp in Sources */, 299754F5193EC95400A54AC3 /* ObjectFactory.cpp in Sources */, + 4DAB8DC71A1CBDB200F7B768 /* CCActionTimeLineNode.cpp in Sources */, 1A5701DF180BCB8C0088DEC7 /* CCLayer.cpp in Sources */, B29A7DEA19EE1B7700872B35 /* EventData.c in Sources */, 50ABBDBE1925AB4100A911A9 /* CCTextureCache.cpp in Sources */, diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.cpp index 29254823b1..3f0b4cf2d2 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.cpp @@ -1,26 +1,26 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #include "CCActionTimeLineNode.h" #include "CSLoader.h" @@ -42,8 +42,8 @@ ActionTimelineNode* ActionTimelineNode::create(Node* root, ActionTimeline* actio } ActionTimelineNode::ActionTimelineNode() - : _root(nullptr) - , _action(nullptr) +: _root(nullptr) +, _action(nullptr) { } @@ -51,17 +51,22 @@ ActionTimelineNode::~ActionTimelineNode() { } +bool ActionTimelineNode::init() +{ + return Node::init(); +} + bool ActionTimelineNode::init(Node* root, ActionTimeline* action) { _root = root; _action = action; - + if(_root) { _root->removeFromParent(); addChild(_root); } - + return true; } diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.h b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.h index bce93639dc..c8c5b6023a 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeLineNode.h @@ -1,26 +1,26 @@ /**************************************************************************** -Copyright (c) 2013 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ #ifndef __COCOSSTUDIO_CCACTIONTIMELINENODE_H__ #define __COCOSSTUDIO_CCACTIONTIMELINENODE_H__ @@ -36,19 +36,20 @@ class ActionTimeline; class CC_STUDIO_DLL ActionTimelineNode : public cocos2d::Node { public: - static ActionTimelineNode* create(cocos2d::Node* root, ActionTimeline* action); - - ActionTimelineNode(); - ~ActionTimelineNode(); - - virtual bool init(cocos2d::Node* root, ActionTimeline* action); - - virtual void setRoot(cocos2d::Node* root); - virtual cocos2d::Node* getRoot(); - - virtual void setActionTimeline(ActionTimeline* action); - virtual ActionTimeline* getActionTimeline(); - + static ActionTimelineNode* create(cocos2d::Node* root, ActionTimeline* action); + + ActionTimelineNode(); + ~ActionTimelineNode(); + + bool init() override; + bool init(cocos2d::Node* root, ActionTimeline* action); + + virtual void setRoot(cocos2d::Node* root); + virtual cocos2d::Node* getRoot(); + + virtual void setActionTimeline(ActionTimeline* action); + virtual ActionTimeline* getActionTimeline(); + protected: cocos2d::Node* _root; ActionTimeline* _action; From d04945d77c9fd19a1ce55cdc2e691350f2124691 Mon Sep 17 00:00:00 2001 From: youyou <501251991@qq.com> Date: Mon, 24 Nov 2014 11:08:37 +0800 Subject: [PATCH 2/3] update templates --- templates/cocos2dx_files.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index cfc5a0d2c2..10959783ec 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -528,6 +528,8 @@ "cocos/editor-support/cocosbuilder/CocosBuilder.h", "cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp", "cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.h", + "cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineNode.cpp", + "cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineNode.h", "cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.cpp", "cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineCache.h", "cocos/editor-support/cocostudio/ActionTimeline/CCFrame.cpp", From 07457a34b593a9b08a745ec56a90d8ace555f460 Mon Sep 17 00:00:00 2001 From: youyou <501251991@qq.com> Date: Wed, 26 Nov 2014 15:56:51 +0800 Subject: [PATCH 3/3] update lua ini files --- tools/tolua/cocos2dx.ini | 2 +- tools/tolua/cocos2dx_studio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index c634744397..b17518dfe9 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -22,7 +22,7 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h %(cocosdir)s/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h +headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h %(cocosdir)s/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h %(cocosdir)s/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimelineNode.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". diff --git a/tools/tolua/cocos2dx_studio.ini b/tools/tolua/cocos2dx_studio.ini index 995692a6c1..34639066d7 100644 --- a/tools/tolua/cocos2dx_studio.ini +++ b/tools/tolua/cocos2dx_studio.ini @@ -30,7 +30,7 @@ headers = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode SceneReader GUIReader ActionObject Tween DisplayManager NodeReader ActionTimeline.* .*Frame$ Timeline +classes = Armature ArmatureAnimation Skin Bone ArmatureDataManager \w+Data$ ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode SceneReader GUIReader ActionObject Tween DisplayManager NodeReader ActionTimeline.* .*Frame$ Timeline ActionTimelineNode # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also