change ActionTimeline to cocostudio ActionTimeline folder

This commit is contained in:
2youyou2 2014-06-13 18:51:32 +08:00
parent c60e424ef2
commit 5bce6b87ea
18 changed files with 164 additions and 123 deletions

View File

@ -303,7 +303,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="CCFontCharMap.cpp" /> <ClCompile Include="CCFontCharMap.cpp" />
<ClCompile Include="CCFontFNT.cpp" /> <ClCompile Include="CCFontFNT.cpp" />
<ClCompile Include="CCFontFreeType.cpp" /> <ClCompile Include="CCFontFreeType.cpp" />
<ClCompile Include="CCFrame.cpp" />
<ClCompile Include="CCGLBufferedNode.cpp" /> <ClCompile Include="CCGLBufferedNode.cpp" />
<ClCompile Include="CCGrabber.cpp" /> <ClCompile Include="CCGrabber.cpp" />
<ClCompile Include="CCGrid.cpp" /> <ClCompile Include="CCGrid.cpp" />
@ -332,8 +331,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClCompile Include="CCSpriteFrameCache.cpp" /> <ClCompile Include="CCSpriteFrameCache.cpp" />
<ClCompile Include="CCTextFieldTTF.cpp" /> <ClCompile Include="CCTextFieldTTF.cpp" />
<ClCompile Include="CCTileMapAtlas.cpp" /> <ClCompile Include="CCTileMapAtlas.cpp" />
<ClCompile Include="CCTimeLine.cpp" />
<ClCompile Include="CCActionTimeline.cpp" />
<ClCompile Include="CCTMXLayer.cpp" /> <ClCompile Include="CCTMXLayer.cpp" />
<ClCompile Include="CCTMXObjectGroup.cpp" /> <ClCompile Include="CCTMXObjectGroup.cpp" />
<ClCompile Include="CCTMXTiledMap.cpp" /> <ClCompile Include="CCTMXTiledMap.cpp" />
@ -502,7 +499,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="CCFontCharMap.h" /> <ClInclude Include="CCFontCharMap.h" />
<ClInclude Include="CCFontFNT.h" /> <ClInclude Include="CCFontFNT.h" />
<ClInclude Include="CCFontFreeType.h" /> <ClInclude Include="CCFontFreeType.h" />
<ClInclude Include="CCFrame.h" />
<ClInclude Include="CCGLBufferedNode.h" /> <ClInclude Include="CCGLBufferedNode.h" />
<ClInclude Include="CCGrabber.h" /> <ClInclude Include="CCGrabber.h" />
<ClInclude Include="CCGrid.h" /> <ClInclude Include="CCGrid.h" />
@ -531,8 +527,6 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
<ClInclude Include="CCSpriteFrameCache.h" /> <ClInclude Include="CCSpriteFrameCache.h" />
<ClInclude Include="CCTextFieldTTF.h" /> <ClInclude Include="CCTextFieldTTF.h" />
<ClInclude Include="CCTileMapAtlas.h" /> <ClInclude Include="CCTileMapAtlas.h" />
<ClInclude Include="CCTimeLine.h" />
<ClInclude Include="CCActionTimeline.h" />
<ClInclude Include="CCTMXLayer.h" /> <ClInclude Include="CCTMXLayer.h" />
<ClInclude Include="CCTMXObjectGroup.h" /> <ClInclude Include="CCTMXObjectGroup.h" />
<ClInclude Include="CCTMXTiledMap.h" /> <ClInclude Include="CCTMXTiledMap.h" />

View File

@ -568,15 +568,6 @@
<ClCompile Include="..\base\ObjectFactory.cpp"> <ClCompile Include="..\base\ObjectFactory.cpp">
<Filter>base</Filter> <Filter>base</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="CCFrame.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCTimeLine.cpp">
<Filter>2d</Filter>
</ClCompile>
<ClCompile Include="CCActionTimeline.cpp">
<Filter>2d</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\physics\CCPhysicsBody.h"> <ClInclude Include="..\physics\CCPhysicsBody.h">
@ -1159,15 +1150,6 @@
<ClInclude Include="..\base\ObjectFactory.h"> <ClInclude Include="..\base\ObjectFactory.h">
<Filter>base</Filter> <Filter>base</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="CCFrame.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCTimeLine.h">
<Filter>2d</Filter>
</ClInclude>
<ClInclude Include="CCActionTimeline.h">
<Filter>2d</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\math\Mat4.inl"> <None Include="..\math\Mat4.inl">

View File

@ -21,9 +21,6 @@ cocos2d.cpp \
2d/CCActionProgressTimer.cpp \ 2d/CCActionProgressTimer.cpp \
2d/CCActionTiledGrid.cpp \ 2d/CCActionTiledGrid.cpp \
2d/CCActionTween.cpp \ 2d/CCActionTween.cpp \
2d/CCFrame.cpp \
2d/CCTimeline.cpp \
2d/CCActionTimeline.cpp \
2d/CCAnimation.cpp \ 2d/CCAnimation.cpp \
2d/CCAnimationCache.cpp \ 2d/CCAnimationCache.cpp \
2d/CCAtlasNode.cpp \ 2d/CCAtlasNode.cpp \

View File

@ -104,9 +104,6 @@ THE SOFTWARE.
#include "2d/CCActionTween.h" #include "2d/CCActionTween.h"
#include "2d/CCActionCatmullRom.h" #include "2d/CCActionCatmullRom.h"
#include "2d/CCTweenFunction.h" #include "2d/CCTweenFunction.h"
#include "2d/CCFrame.h"
#include "2d/CCTimeLine.h"
#include "2d/CCActionTimeline.h"
// 2d nodes // 2d nodes
#include "2d/CCNode.h" #include "2d/CCNode.h"

View File

@ -24,8 +24,9 @@ THE SOFTWARE.
#include "CCActionTimeline.h" #include "CCActionTimeline.h"
NS_CC_BEGIN USING_NS_CC;
NS_TIMELINE_BEGIN
// ActionTimelineData // ActionTimelineData
ActionTimelineData* ActionTimelineData::create(int actionTag) ActionTimelineData* ActionTimelineData::create(int actionTag)
@ -271,4 +272,4 @@ void ActionTimeline::stepToFrame(int frameIndex)
} }
} }
NS_CC_END NS_TIMELINE_END

View File

@ -25,15 +25,12 @@ THE SOFTWARE.
#ifndef __CCTIMELINE_ACTION_H__ #ifndef __CCTIMELINE_ACTION_H__
#define __CCTIMELINE_ACTION_H__ #define __CCTIMELINE_ACTION_H__
#include "2d/CCNode.h" #include "CCTimeLine.h"
#include "2d/CCAction.h"
#include "2d/CCTimeLine.h"
#include "base/CCRef.h"
#include "renderer/CCRenderer.h" #include "renderer/CCRenderer.h"
NS_CC_BEGIN NS_TIMELINE_BEGIN
class CC_DLL ActionTimelineData : public Ref class ActionTimelineData : public cocos2d::Ref
{ {
public: public:
static ActionTimelineData* create(int actionTag); static ActionTimelineData* create(int actionTag);
@ -48,7 +45,7 @@ protected:
}; };
class CC_DLL ActionTimeline : public Action class ActionTimeline : public cocos2d::Action
{ {
public: public:
friend class Frame; friend class Frame;
@ -113,7 +110,7 @@ public:
virtual void addTimeline(Timeline* timeline); virtual void addTimeline(Timeline* timeline);
virtual void removeTimeline(Timeline* timeline); virtual void removeTimeline(Timeline* timeline);
virtual const Vector<Timeline*>& getTimelines() const { return _timelineList; } virtual const cocos2d::Vector<Timeline*>& getTimelines() const { return _timelineList; }
/** Set ActionTimeline's frame event callback function */ /** Set ActionTimeline's frame event callback function */
void setFrameEventCallFunc(std::function<void(Frame *)> listener); void setFrameEventCallFunc(std::function<void(Frame *)> listener);
@ -130,7 +127,7 @@ public:
virtual ActionTimeline* reverse() const override { return nullptr; } virtual ActionTimeline* reverse() const override { return nullptr; }
virtual void step(float delta) override; virtual void step(float delta) override;
virtual void startWithTarget(Node *target) override; virtual void startWithTarget(cocos2d::Node *target) override;
virtual bool isDone() const override { return false; } virtual bool isDone() const override { return false; }
protected: protected:
virtual void gotoFrame(int frameIndex); virtual void gotoFrame(int frameIndex);
@ -139,8 +136,8 @@ protected:
/** emit frame event, call it when enter a frame*/ /** emit frame event, call it when enter a frame*/
virtual void emitFrameEvent(Frame* frame); virtual void emitFrameEvent(Frame* frame);
std::map<int, Vector<Timeline*>> _timelineMap; std::map<int, cocos2d::Vector<Timeline*>> _timelineMap;
Vector<Timeline*> _timelineList; cocos2d::Vector<Timeline*> _timelineList;
int _duration; int _duration;
double _time; double _time;
@ -154,7 +151,7 @@ protected:
std::function<void(Frame*)> _frameEventListener; std::function<void(Frame*)> _frameEventListener;
}; };
NS_CC_END NS_TIMELINE_END
#endif /*__CCTIMELINE_ACTION_H__*/ #endif /*__CCTIMELINE_ACTION_H__*/

View File

@ -24,6 +24,9 @@ THE SOFTWARE.
#include "CCActionTimelineCache.h" #include "CCActionTimelineCache.h"
#include "CCNodeReader.h" #include "CCNodeReader.h"
#include "CCFrame.h"
#include "CCTimeLine.h"
#include "CCActionTimeline.h"
using namespace cocos2d; using namespace cocos2d;

View File

@ -27,10 +27,13 @@ THE SOFTWARE.
#include "cocos2d.h" #include "cocos2d.h"
#include "cocostudio/DictionaryHelper.h" #include "cocostudio/DictionaryHelper.h"
#include "CCTimelineMacro.h"
NS_TIMELINE_BEGIN
namespace cocostudio { class ActionTimeline;
namespace timeline{ class Timeline;
class Frame;
class ActionTimelineCache class ActionTimelineCache
{ {
@ -49,38 +52,36 @@ public:
void removeAction(const std::string& fileName); void removeAction(const std::string& fileName);
/** Clone a action with the specified name from the container. */ /** Clone a action with the specified name from the container. */
cocos2d::ActionTimeline* createAction(const std::string& fileName); ActionTimeline* createAction(const std::string& fileName);
cocos2d::ActionTimeline* loadAnimationActionWithFile(const std::string& fileName); ActionTimeline* loadAnimationActionWithFile(const std::string& fileName);
cocos2d::ActionTimeline* loadAnimationActionWithContent(const std::string&fileName, const std::string& content); ActionTimeline* loadAnimationActionWithContent(const std::string&fileName, const std::string& content);
protected: protected:
cocos2d::Timeline* loadTimeline(const rapidjson::Value& json); Timeline* loadTimeline(const rapidjson::Value& json);
cocos2d::Frame* loadVisibleFrame (const rapidjson::Value& json); Frame* loadVisibleFrame (const rapidjson::Value& json);
cocos2d::Frame* loadPositionFrame (const rapidjson::Value& json); Frame* loadPositionFrame (const rapidjson::Value& json);
cocos2d::Frame* loadScaleFrame (const rapidjson::Value& json); Frame* loadScaleFrame (const rapidjson::Value& json);
cocos2d::Frame* loadSkewFrame (const rapidjson::Value& json); Frame* loadSkewFrame (const rapidjson::Value& json);
cocos2d::Frame* loadRotationSkewFrame(const rapidjson::Value& json); Frame* loadRotationSkewFrame(const rapidjson::Value& json);
cocos2d::Frame* loadRotationFrame (const rapidjson::Value& json); Frame* loadRotationFrame (const rapidjson::Value& json);
cocos2d::Frame* loadAnchorPointFrame (const rapidjson::Value& json); Frame* loadAnchorPointFrame (const rapidjson::Value& json);
cocos2d::Frame* loadInnerActionFrame (const rapidjson::Value& json); Frame* loadInnerActionFrame (const rapidjson::Value& json);
cocos2d::Frame* loadColorFrame (const rapidjson::Value& json); Frame* loadColorFrame (const rapidjson::Value& json);
cocos2d::Frame* loadTextureFrame (const rapidjson::Value& json); Frame* loadTextureFrame (const rapidjson::Value& json);
cocos2d::Frame* loadEventFrame (const rapidjson::Value& json); Frame* loadEventFrame (const rapidjson::Value& json);
cocos2d::Frame* loadZOrderFrame (const rapidjson::Value& json); Frame* loadZOrderFrame (const rapidjson::Value& json);
protected: protected:
typedef std::function<cocos2d::Frame*(const rapidjson::Value& json)> FrameCreateFunc; typedef std::function<Frame*(const rapidjson::Value& json)> FrameCreateFunc;
typedef std::pair<std::string, FrameCreateFunc> Pair; typedef std::pair<std::string, FrameCreateFunc> Pair;
std::unordered_map<std::string, FrameCreateFunc> _funcs; std::unordered_map<std::string, FrameCreateFunc> _funcs;
cocos2d::Map<std::string, cocos2d::ActionTimeline*> _animationActions; cocos2d::Map<std::string, ActionTimeline*> _animationActions;
}; };
} NS_TIMELINE_END
}
#endif /*__CCTIMELINE_ACTION_CACHE_H__*/ #endif /*__CCTIMELINE_ACTION_CACHE_H__*/

View File

@ -22,14 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "2d/CCFrame.h" #include "CCFrame.h"
#include "2d/CCTimeLine.h" #include "CCTimeLine.h"
#include "2d/CCTimeLine.h" #include "CCActionTimeline.h"
#include "2d/CCActionTimeline.h"
#include "2d/CCSprite.h"
#include "2d/CCSpriteFrameCache.h"
NS_CC_BEGIN USING_NS_CC;
NS_TIMELINE_BEGIN
// Frame // Frame
Frame::Frame() Frame::Frame()
@ -642,4 +641,4 @@ Frame* ZOrderFrame::clone()
return frame; return frame;
} }
NS_CC_END NS_TIMELINE_END

View File

@ -25,18 +25,14 @@ THE SOFTWARE.
#ifndef __CCFRAME_H__ #ifndef __CCFRAME_H__
#define __CCFRAME_H__ #define __CCFRAME_H__
#include "base/CCRef.h" #include "cocos2d.h"
#include "math/Vec2.h" #include "CCTimelineMacro.h"
#include "CCGL.h"
#include "base/ccTypes.h"
#include <string>
NS_CC_BEGIN NS_TIMELINE_BEGIN
class Sprite;
class Timeline; class Timeline;
class CC_DLL Frame : public Ref class Frame : public cocos2d::Ref
{ {
public: public:
@ -46,8 +42,8 @@ public:
virtual void setTimeline(Timeline* timeline) { _timeline = timeline; } virtual void setTimeline(Timeline* timeline) { _timeline = timeline; }
virtual Timeline* getTimeline() const { return _timeline; } virtual Timeline* getTimeline() const { return _timeline; }
virtual void setNode(Node* node) { _node = node; } virtual void setNode(cocos2d::Node* node) { _node = node; }
virtual Node* getTimelineNode() const { return _node; } virtual cocos2d::Node* getTimelineNode() const { return _node; }
virtual void setTween(bool tween) { _tween = tween; } virtual void setTween(bool tween) { _tween = tween; }
virtual bool isTween() const { return _tween; } virtual bool isTween() const { return _tween; }
@ -68,11 +64,11 @@ protected:
bool _tween; bool _tween;
Timeline* _timeline; Timeline* _timeline;
Node* _node; cocos2d::Node* _node;
}; };
class CC_DLL VisibleFrame : public Frame class VisibleFrame : public Frame
{ {
public: public:
static VisibleFrame* create(); static VisibleFrame* create();
@ -90,14 +86,14 @@ protected:
}; };
class CC_DLL TextureFrame : public Frame class TextureFrame : public Frame
{ {
public: public:
static TextureFrame* create(); static TextureFrame* create();
TextureFrame(); TextureFrame();
virtual void setNode(Node* node); virtual void setNode(cocos2d::Node* node);
virtual void onEnter(Frame *nextFrame) override; virtual void onEnter(Frame *nextFrame) override;
virtual Frame* clone() override; virtual Frame* clone() override;
@ -106,11 +102,11 @@ public:
inline std::string getTexture() const { return _texture; } inline std::string getTexture() const { return _texture; }
protected: protected:
Sprite* _sprite; cocos2d::Sprite* _sprite;
std::string _texture; std::string _texture;
}; };
class CC_DLL RotationFrame : public Frame class RotationFrame : public Frame
{ {
public: public:
static RotationFrame* create(); static RotationFrame* create();
@ -129,7 +125,7 @@ protected:
float _betwennRotation; float _betwennRotation;
}; };
class CC_DLL SkewFrame : public Frame class SkewFrame : public Frame
{ {
public: public:
static SkewFrame* create(); static SkewFrame* create();
@ -154,7 +150,7 @@ protected:
}; };
class CC_DLL RotationSkewFrame : public SkewFrame class RotationSkewFrame : public SkewFrame
{ {
public: public:
static RotationSkewFrame* create(); static RotationSkewFrame* create();
@ -167,7 +163,7 @@ public:
}; };
class CC_DLL PositionFrame : public Frame class PositionFrame : public Frame
{ {
public: public:
static PositionFrame* create(); static PositionFrame* create();
@ -178,8 +174,8 @@ public:
virtual void apply(float percent) override; virtual void apply(float percent) override;
virtual Frame* clone() override; virtual Frame* clone() override;
inline void setPosition(const Point& position) { _position = position; } inline void setPosition(const cocos2d::Point& position) { _position = position; }
inline Point getPosition() const { return _position; } inline cocos2d::Point getPosition() const { return _position; }
inline void setX(float x) { _position.x = x; } inline void setX(float x) { _position.x = x; }
inline void setY(float y) { _position.y = y; } inline void setY(float y) { _position.y = y; }
@ -187,13 +183,13 @@ public:
inline float getX() const { return _position.x; } inline float getX() const { return _position.x; }
inline float getY() const { return _position.y; } inline float getY() const { return _position.y; }
protected: protected:
Point _position; cocos2d::Point _position;
float _betweenX; float _betweenX;
float _betweenY; float _betweenY;
}; };
class CC_DLL ScaleFrame : public Frame class ScaleFrame : public Frame
{ {
public: public:
static ScaleFrame* create(); static ScaleFrame* create();
@ -220,7 +216,7 @@ protected:
}; };
class CC_DLL AnchorPointFrame : public Frame class AnchorPointFrame : public Frame
{ {
public: public:
static AnchorPointFrame* create(); static AnchorPointFrame* create();
@ -230,11 +226,11 @@ public:
virtual void onEnter(Frame *nextFrame) override; virtual void onEnter(Frame *nextFrame) override;
virtual Frame* clone() override; virtual Frame* clone() override;
inline void setAnchorPoint(const Point& point) { _anchorPoint = point; } inline void setAnchorPoint(const cocos2d::Point& point) { _anchorPoint = point; }
inline Point getAnchorPoint() const { return _anchorPoint; } inline cocos2d::Point getAnchorPoint() const { return _anchorPoint; }
protected: protected:
Point _anchorPoint; cocos2d::Point _anchorPoint;
}; };
@ -246,7 +242,7 @@ enum InnerActionType
SingleFrame SingleFrame
}; };
class CC_DLL InnerActionFrame : public Frame class InnerActionFrame : public Frame
{ {
public: public:
static InnerActionFrame* create(); static InnerActionFrame* create();
@ -267,7 +263,7 @@ protected:
}; };
class CC_DLL ColorFrame : public Frame class ColorFrame : public Frame
{ {
public: public:
static ColorFrame* create(); static ColorFrame* create();
@ -280,12 +276,12 @@ public:
inline void setAlpha(GLubyte alpha) { _alpha = alpha; } inline void setAlpha(GLubyte alpha) { _alpha = alpha; }
inline GLubyte getAlpha() const { return _alpha; } inline GLubyte getAlpha() const { return _alpha; }
inline void setColor(const Color3B& color) { _color = color; } inline void setColor(const cocos2d::Color3B& color) { _color = color; }
inline Color3B getColor() const { return _color; } inline cocos2d::Color3B getColor() const { return _color; }
protected: protected:
GLubyte _alpha; GLubyte _alpha;
Color3B _color; cocos2d::Color3B _color;
int _betweenAlpha; int _betweenAlpha;
int _betweenRed; int _betweenRed;
@ -294,7 +290,7 @@ protected:
}; };
class CC_DLL EventFrame : public Frame class EventFrame : public Frame
{ {
public: public:
static EventFrame* create(); static EventFrame* create();
@ -311,7 +307,7 @@ protected:
std::string _event; std::string _event;
}; };
class CC_DLL ZOrderFrame : public Frame class ZOrderFrame : public Frame
{ {
public: public:
static ZOrderFrame* create(); static ZOrderFrame* create();
@ -328,7 +324,7 @@ protected:
int _zorder; int _zorder;
}; };
NS_CC_END NS_TIMELINE_END
#endif /*__CCFRAME_H__*/ #endif /*__CCFRAME_H__*/

View File

@ -24,6 +24,7 @@ THE SOFTWARE.
#include "CCNodeReader.h" #include "CCNodeReader.h"
#include "CCActionTimelineCache.h" #include "CCActionTimelineCache.h"
#include "CCActionTimeline.h"
#include "../CCSGUIReader.h" #include "../CCSGUIReader.h"

View File

@ -25,7 +25,9 @@ THE SOFTWARE.
#include "CCTimeLine.h" #include "CCTimeLine.h"
#include "CCActionTimeline.h" #include "CCActionTimeline.h"
NS_CC_BEGIN USING_NS_CC;
NS_TIMELINE_BEGIN
Timeline* Timeline::create() Timeline* Timeline::create()
{ {
@ -244,4 +246,4 @@ void Timeline::updateCurrentKeyFrame(int frameIndex)
} }
} }
NS_CC_END NS_TIMELINE_END

View File

@ -25,14 +25,14 @@ THE SOFTWARE.
#ifndef __CCTIMELINE_H__ #ifndef __CCTIMELINE_H__
#define __CCTIMELINE_H__ #define __CCTIMELINE_H__
#include "2d/CCNode.h" #include "CCFrame.h"
#include "2d/CCFrame.h" #include "CCTimelineMacro.h"
NS_CC_BEGIN NS_TIMELINE_BEGIN
class ActionTimeline; class ActionTimeline;
class CC_DLL Timeline : public Ref class Timeline : public cocos2d::Ref
{ {
public: public:
static Timeline* create(); static Timeline* create();
@ -43,7 +43,7 @@ public:
virtual void gotoFrame(int frameIndex); virtual void gotoFrame(int frameIndex);
virtual void stepToFrame(int frameIndex); virtual void stepToFrame(int frameIndex);
virtual const Vector<Frame*>& getFrames() const { return _frames; } virtual const cocos2d::Vector<Frame*>& getFrames() const { return _frames; }
virtual void addFrame(Frame* frame); virtual void addFrame(Frame* frame);
virtual void insertFrame(Frame* frame, int index); virtual void insertFrame(Frame* frame, int index);
@ -52,8 +52,8 @@ public:
virtual void setActionTag(int tag) { _actionTag = tag; } virtual void setActionTag(int tag) { _actionTag = tag; }
virtual int getActionTag() const { return _actionTag; } virtual int getActionTag() const { return _actionTag; }
virtual void setNode(Node* node); virtual void setNode(cocos2d::Node* node);
virtual Node* getNode() const; virtual cocos2d::Node* getNode() const;
virtual void setActionTimeline(ActionTimeline* action) { _ActionTimeline = action; } virtual void setActionTimeline(ActionTimeline* action) { _ActionTimeline = action; }
virtual ActionTimeline* getActionTimeline() const { return _ActionTimeline; } virtual ActionTimeline* getActionTimeline() const { return _ActionTimeline; }
@ -66,7 +66,7 @@ protected:
virtual void binarySearchKeyFrame (int frameIndex); virtual void binarySearchKeyFrame (int frameIndex);
virtual void updateCurrentKeyFrame(int frameIndex); virtual void updateCurrentKeyFrame(int frameIndex);
Vector<Frame*> _frames; cocos2d::Vector<Frame*> _frames;
Frame* _currentKeyFrame; Frame* _currentKeyFrame;
int _currentKeyFrameIndex; int _currentKeyFrameIndex;
@ -76,10 +76,10 @@ protected:
int _actionTag; int _actionTag;
ActionTimeline* _ActionTimeline; ActionTimeline* _ActionTimeline;
Node* _node; cocos2d::Node* _node;
}; };
NS_CC_END NS_TIMELINE_END
#endif /*__CCTIMELINE_H__*/ #endif /*__CCTIMELINE_H__*/

View File

@ -0,0 +1,38 @@
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2013-2014 Chukong Technologies
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 __CC_TIMELINE_MACROS_H__
#define __CC_TIMELINE_MACROS_H__
#ifdef __cplusplus
#define NS_TIMELINE_BEGIN namespace cocostudio { namespace timeline{
#define NS_TIMELINE_END }}
#define USING_NS_TIMELINE using namespace cocostudio::timeline;
#else
#define NS_TIMELINE_BEGIN
#define NS_TIMELINE_END
#define USING_NS_TIMELINE
#endif
#endif

View File

@ -55,7 +55,9 @@ WidgetReader/TextFieldReader/TextFieldReader.cpp \
WidgetReader/TextReader/TextReader.cpp \ WidgetReader/TextReader/TextReader.cpp \
ActionTimeline/CCNodeReader.cpp \ ActionTimeline/CCNodeReader.cpp \
ActionTimeline/CCActionTimelineCache.cpp \ ActionTimeline/CCActionTimelineCache.cpp \
ActionTimeline/CCFrame.cpp \
ActionTimeline/CCTimeline.cpp \
ActionTimeline/CCActionTimeline.cpp \
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../../../external $(LOCAL_PATH)/../../../external

View File

@ -60,5 +60,8 @@ THE SOFTWARE.
#include "cocostudio/TriggerBase.h" #include "cocostudio/TriggerBase.h"
#include "cocostudio/ActionTimeline/CCNodeReader.h" #include "cocostudio/ActionTimeline/CCNodeReader.h"
#include "cocostudio/ActionTimeline/CCActionTimelineCache.h" #include "cocostudio/ActionTimeline/CCActionTimelineCache.h"
#include "cocostudio/ActionTimeline/CCFrame.h"
#include "cocostudio/ActionTimeline/CCTimeLine.h"
#include "cocostudio/ActionTimeline/CCActionTimeline.h"
#endif #endif

View File

@ -11,8 +11,11 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\ActionTimeline\CCActionTimeline.cpp" />
<ClCompile Include="..\ActionTimeline\CCFrame.cpp" />
<ClCompile Include="..\ActionTimeline\CCNodeReader.cpp" /> <ClCompile Include="..\ActionTimeline\CCNodeReader.cpp" />
<ClCompile Include="..\ActionTimeline\CCActionTimelineCache.cpp" /> <ClCompile Include="..\ActionTimeline\CCActionTimelineCache.cpp" />
<ClCompile Include="..\ActionTimeline\CCTimeLine.cpp" />
<ClCompile Include="..\CCActionFrame.cpp" /> <ClCompile Include="..\CCActionFrame.cpp" />
<ClCompile Include="..\CCActionFrameEasing.cpp" /> <ClCompile Include="..\CCActionFrameEasing.cpp" />
<ClCompile Include="..\CCActionManagerEx.cpp" /> <ClCompile Include="..\CCActionManagerEx.cpp" />
@ -73,8 +76,12 @@
<ClInclude Include="..\..\..\..\external\json\reader.h" /> <ClInclude Include="..\..\..\..\external\json\reader.h" />
<ClInclude Include="..\..\..\..\external\json\stringbuffer.h" /> <ClInclude Include="..\..\..\..\external\json\stringbuffer.h" />
<ClInclude Include="..\..\..\..\external\json\writer.h" /> <ClInclude Include="..\..\..\..\external\json\writer.h" />
<ClInclude Include="..\ActionTimeline\CCActionTimeline.h" />
<ClInclude Include="..\ActionTimeline\CCFrame.h" />
<ClInclude Include="..\ActionTimeline\CCNodeReader.h" /> <ClInclude Include="..\ActionTimeline\CCNodeReader.h" />
<ClInclude Include="..\ActionTimeline\CCActionTimelineCache.h" /> <ClInclude Include="..\ActionTimeline\CCActionTimelineCache.h" />
<ClInclude Include="..\ActionTimeline\CCTimeLine.h" />
<ClInclude Include="..\ActionTimeline\CCTimelineMacro.h" />
<ClInclude Include="..\CCActionFrame.h" /> <ClInclude Include="..\CCActionFrame.h" />
<ClInclude Include="..\CCActionFrameEasing.h" /> <ClInclude Include="..\CCActionFrameEasing.h" />
<ClInclude Include="..\CCActionManagerEx.h" /> <ClInclude Include="..\CCActionManagerEx.h" />

View File

@ -237,6 +237,15 @@
<ClCompile Include="..\ActionTimeline\CCActionTimelineCache.cpp"> <ClCompile Include="..\ActionTimeline\CCActionTimelineCache.cpp">
<Filter>TimelineAction</Filter> <Filter>TimelineAction</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\ActionTimeline\CCActionTimeline.cpp">
<Filter>TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\ActionTimeline\CCFrame.cpp">
<Filter>TimelineAction</Filter>
</ClCompile>
<ClCompile Include="..\ActionTimeline\CCTimeLine.cpp">
<Filter>TimelineAction</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\CCComAttribute.h"> <ClInclude Include="..\CCComAttribute.h">
@ -425,5 +434,17 @@
<ClInclude Include="..\ActionTimeline\CCActionTimelineCache.h"> <ClInclude Include="..\ActionTimeline\CCActionTimelineCache.h">
<Filter>TimelineAction</Filter> <Filter>TimelineAction</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\ActionTimeline\CCActionTimeline.h">
<Filter>TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\ActionTimeline\CCFrame.h">
<Filter>TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\ActionTimeline\CCTimeLine.h">
<Filter>TimelineAction</Filter>
</ClInclude>
<ClInclude Include="..\ActionTimeline\CCTimelineMacro.h">
<Filter>TimelineAction</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>