mirror of https://github.com/axmolengine/axmol.git
merge newest version
This commit is contained in:
parent
3cfba7bc9a
commit
10ed7ebdf4
|
@ -53,7 +53,6 @@ network/WebSocket.cpp \
|
||||||
physics_nodes/CCPhysicsDebugNode.cpp \
|
physics_nodes/CCPhysicsDebugNode.cpp \
|
||||||
physics_nodes/CCPhysicsSprite.cpp \
|
physics_nodes/CCPhysicsSprite.cpp \
|
||||||
LocalStorage/LocalStorageAndroid.cpp \
|
LocalStorage/LocalStorageAndroid.cpp \
|
||||||
<<<<<<< HEAD
|
|
||||||
CCArmature/CCArmature.cpp \
|
CCArmature/CCArmature.cpp \
|
||||||
CCArmature/CCBone.cpp \
|
CCArmature/CCBone.cpp \
|
||||||
CCArmature/animation/CCAnimation.cpp \
|
CCArmature/animation/CCAnimation.cpp \
|
||||||
|
@ -78,8 +77,7 @@ CCArmature/utils/CCDataReaderHelper.cpp \
|
||||||
CCArmature/utils/CCSpriteFrameCacheHelper.cpp \
|
CCArmature/utils/CCSpriteFrameCacheHelper.cpp \
|
||||||
CCArmature/utils/CCTransformHelp.cpp \
|
CCArmature/utils/CCTransformHelp.cpp \
|
||||||
CCArmature/utils/CCTweenFunction.cpp \
|
CCArmature/utils/CCTweenFunction.cpp \
|
||||||
CCArmature/utils/CCUtilMath.cpp
|
CCArmature/utils/CCUtilMath.cpp \
|
||||||
=======
|
|
||||||
spine/Animation.cpp \
|
spine/Animation.cpp \
|
||||||
spine/AnimationState.cpp \
|
spine/AnimationState.cpp \
|
||||||
spine/AnimationStateData.cpp \
|
spine/AnimationStateData.cpp \
|
||||||
|
@ -105,7 +103,6 @@ Components/CCComAttribute.cpp \
|
||||||
Components/CCComAudio.cpp \
|
Components/CCComAudio.cpp \
|
||||||
Components/CCComController.cpp \
|
Components/CCComController.cpp \
|
||||||
Components/CCInputDelegate.cpp
|
Components/CCInputDelegate.cpp
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
|
|
||||||
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
|
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
|
||||||
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
|
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
|
||||||
|
|
|
@ -139,13 +139,13 @@ bool CCArmature::init(const char *name)
|
||||||
{
|
{
|
||||||
m_strName = name;
|
m_strName = name;
|
||||||
|
|
||||||
AnimationData* animationData = armatureDataManager->getAnimationData(name);
|
CCAnimationData* animationData = armatureDataManager->getAnimationData(name);
|
||||||
CCAssert(animationData, "AnimationData not exist! ");
|
CCAssert(animationData, "CCAnimationData not exist! ");
|
||||||
|
|
||||||
m_pAnimation->setAnimationData(animationData);
|
m_pAnimation->setAnimationData(animationData);
|
||||||
|
|
||||||
|
|
||||||
ArmatureData *armatureData = armatureDataManager->getArmatureData(name);
|
CCArmatureData *armatureData = armatureDataManager->getArmatureData(name);
|
||||||
CCAssert(armatureData, "");
|
CCAssert(armatureData, "");
|
||||||
|
|
||||||
m_pArmatureData = armatureData;
|
m_pArmatureData = armatureData;
|
||||||
|
@ -160,13 +160,13 @@ bool CCArmature::init(const char *name)
|
||||||
//! init bone's CCTween to 1st movement's 1st frame
|
//! init bone's CCTween to 1st movement's 1st frame
|
||||||
do {
|
do {
|
||||||
|
|
||||||
MovementData *movData = animationData->getMovement(animationData->movementNames.at(0).c_str());
|
CCMovementData *movData = animationData->getMovement(animationData->movementNames.at(0).c_str());
|
||||||
CC_BREAK_IF(!movData);
|
CC_BREAK_IF(!movData);
|
||||||
|
|
||||||
MovementBoneData *movBoneData = movData->getMovementBoneData(bone->getName().c_str());
|
CCMovementBoneData *movBoneData = movData->getMovementBoneData(bone->getName().c_str());
|
||||||
CC_BREAK_IF(!movBoneData || movBoneData->frameList.count() <= 0);
|
CC_BREAK_IF(!movBoneData || movBoneData->frameList.count() <= 0);
|
||||||
|
|
||||||
FrameData *frameData = movBoneData->getFrameData(0);
|
CCFrameData *frameData = movBoneData->getFrameData(0);
|
||||||
CC_BREAK_IF(!frameData);
|
CC_BREAK_IF(!frameData);
|
||||||
|
|
||||||
bone->getTweenData()->copy(frameData);
|
bone->getTweenData()->copy(frameData);
|
||||||
|
@ -180,10 +180,10 @@ bool CCArmature::init(const char *name)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_strName = "new_armature";
|
m_strName = "new_armature";
|
||||||
m_pArmatureData = ArmatureData::create();
|
m_pArmatureData = CCArmatureData::create();
|
||||||
m_pArmatureData->name = m_strName;
|
m_pArmatureData->name = m_strName;
|
||||||
|
|
||||||
AnimationData *animationData = AnimationData::create();
|
CCAnimationData *animationData = CCAnimationData::create();
|
||||||
animationData->name = m_strName;
|
animationData->name = m_strName;
|
||||||
|
|
||||||
armatureDataManager->addArmatureData(m_strName.c_str(), m_pArmatureData);
|
armatureDataManager->addArmatureData(m_strName.c_str(), m_pArmatureData);
|
||||||
|
@ -221,7 +221,7 @@ CCBone *CCArmature::createBone(const char *boneName)
|
||||||
if(existedBone != NULL)
|
if(existedBone != NULL)
|
||||||
return existedBone;
|
return existedBone;
|
||||||
|
|
||||||
BoneData *boneData = (BoneData*)m_pArmatureData->getBoneData(boneName);
|
CCBoneData *boneData = (CCBoneData*)m_pArmatureData->getBoneData(boneName);
|
||||||
std::string parentName = boneData->parentName;
|
std::string parentName = boneData->parentName;
|
||||||
|
|
||||||
CCBone *bone = NULL;
|
CCBone *bone = NULL;
|
||||||
|
|
|
@ -43,9 +43,9 @@ public:
|
||||||
static CCArmature *create();
|
static CCArmature *create();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocates a armature, and use the ArmatureData named name in CCArmatureDataManager to initializes the armature.
|
* Allocates a armature, and use the CCArmatureData named name in CCArmatureDataManager to initializes the armature.
|
||||||
*
|
*
|
||||||
* @param name CCArmature will use the name to find to the ArmatureData to initializes it.
|
* @param name CCArmature will use the name to find to the CCArmatureData to initializes it.
|
||||||
* @return A initialized armature which is marked as "autorelease".
|
* @return A initialized armature which is marked as "autorelease".
|
||||||
*/
|
*/
|
||||||
static CCArmature *create(const char *name);
|
static CCArmature *create(const char *name);
|
||||||
|
@ -133,7 +133,7 @@ protected:
|
||||||
|
|
||||||
CC_SYNTHESIZE_RETAIN(CCAnimation *, m_pAnimation, Animation);
|
CC_SYNTHESIZE_RETAIN(CCAnimation *, m_pAnimation, Animation);
|
||||||
|
|
||||||
CC_SYNTHESIZE(ArmatureData *, m_pArmatureData, ArmatureData);
|
CC_SYNTHESIZE(CCArmatureData *, m_pArmatureData, CCArmatureData);
|
||||||
|
|
||||||
CC_SYNTHESIZE(CCBatchNode*, m_pBatchNode, BatchNode);
|
CC_SYNTHESIZE(CCBatchNode*, m_pBatchNode, BatchNode);
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ bool CCBone::init(const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
CC_SAFE_DELETE(m_pTweenData);
|
CC_SAFE_DELETE(m_pTweenData);
|
||||||
m_pTweenData = new FrameData();
|
m_pTweenData = new CCFrameData();
|
||||||
|
|
||||||
CC_SAFE_DELETE(m_pTween);
|
CC_SAFE_DELETE(m_pTween);
|
||||||
m_pTween = new CCTween();
|
m_pTween = new CCTween();
|
||||||
|
@ -127,7 +127,7 @@ bool CCBone::init(const char *name)
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCBone::setBoneData(BoneData *boneData)
|
void CCBone::setBoneData(CCBoneData *boneData)
|
||||||
{
|
{
|
||||||
CCAssert(NULL != boneData, "_boneData must not be NULL");
|
CCAssert(NULL != boneData, "_boneData must not be NULL");
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ void CCBone::setBoneData(BoneData *boneData)
|
||||||
m_pDisplayManager->initDisplayList(boneData);
|
m_pDisplayManager->initDisplayList(boneData);
|
||||||
}
|
}
|
||||||
|
|
||||||
BoneData *CCBone::getBoneData()
|
CCBoneData *CCBone::getBoneData()
|
||||||
{
|
{
|
||||||
return m_pBoneData;
|
return m_pBoneData;
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ void CCBone::setZOrder(int zOrder)
|
||||||
CCNode::setZOrder(zOrder);
|
CCNode::setZOrder(zOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCBone::addDisplay(DisplayData *_displayData, int _index)
|
void CCBone::addDisplay(CCDisplayData *_displayData, int _index)
|
||||||
{
|
{
|
||||||
m_pDisplayManager->addDisplay(_displayData, _index);
|
m_pDisplayManager->addDisplay(_displayData, _index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,12 +73,12 @@ public:
|
||||||
* If index is current display index, then also change display to _index
|
* If index is current display index, then also change display to _index
|
||||||
*
|
*
|
||||||
* @param displayData it include the display information, like DisplayType.
|
* @param displayData it include the display information, like DisplayType.
|
||||||
* If you want to create a sprite display, then create a SpriteDisplayData param
|
* If you want to create a sprite display, then create a CCSpriteDisplayData param
|
||||||
*
|
*
|
||||||
* @param _index the index of the display you want to replace or add to
|
* @param _index the index of the display you want to replace or add to
|
||||||
* -1 : append display from back
|
* -1 : append display from back
|
||||||
*/
|
*/
|
||||||
void addDisplay(DisplayData *displayData, int index);
|
void addDisplay(CCDisplayData *displayData, int index);
|
||||||
|
|
||||||
void changeDisplayByIndex(int index, bool force);
|
void changeDisplayByIndex(int index, bool force);
|
||||||
|
|
||||||
|
@ -140,9 +140,9 @@ public:
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
* The origin state of the CCBone. Display's state is effected by m_pBoneData, m_pNode, m_pTweenData
|
* The origin state of the CCBone. Display's state is effected by m_pBoneData, m_pNode, m_pTweenData
|
||||||
* when call setData function, it will copy from the BoneData.
|
* when call setData function, it will copy from the CCBoneData.
|
||||||
*/
|
*/
|
||||||
CC_PROPERTY(BoneData *, m_pBoneData, BoneData);
|
CC_PROPERTY(CCBoneData *, m_pBoneData, BoneData);
|
||||||
|
|
||||||
//! A weak reference to the CCArmature
|
//! A weak reference to the CCArmature
|
||||||
CC_SYNTHESIZE(CCArmature *, m_pArmature, Armature);
|
CC_SYNTHESIZE(CCArmature *, m_pArmature, Armature);
|
||||||
|
@ -153,7 +153,7 @@ public:
|
||||||
CC_SYNTHESIZE(CCDisplayManager*, m_pDisplayManager, DisplayManager)
|
CC_SYNTHESIZE(CCDisplayManager*, m_pDisplayManager, DisplayManager)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When CCArmature play a animation, if there is not a MovementBoneData of this bone in this MovementData, this bone will hide.
|
* When CCArmature play a animation, if there is not a CCMovementBoneData of this bone in this CCMovementData, this bone will hide.
|
||||||
* Set IgnoreMovementBoneData to true, then this bone will also show.
|
* Set IgnoreMovementBoneData to true, then this bone will also show.
|
||||||
*/
|
*/
|
||||||
CC_SYNTHESIZE_PASS_BY_REF(bool, m_bIgnoreMovementBoneData, IgnoreMovementBoneData)
|
CC_SYNTHESIZE_PASS_BY_REF(bool, m_bIgnoreMovementBoneData, IgnoreMovementBoneData)
|
||||||
|
@ -162,7 +162,7 @@ protected:
|
||||||
CCTween *m_pTween; //! Calculate tween effect
|
CCTween *m_pTween; //! Calculate tween effect
|
||||||
|
|
||||||
//! Used for make tween effect between every frame
|
//! Used for make tween effect between every frame
|
||||||
CC_SYNTHESIZE_READONLY(FrameData*, m_pTweenData, TweenData);
|
CC_SYNTHESIZE_READONLY(CCFrameData*, m_pTweenData, TweenData);
|
||||||
|
|
||||||
CC_SYNTHESIZE_PASS_BY_REF(std::string, m_strName, Name);
|
CC_SYNTHESIZE_PASS_BY_REF(std::string, m_strName, Name);
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ void CCAnimation::play(const char *animationName, int durationTo, int durationTw
|
||||||
m_iDurationTween = durationTween;
|
m_iDurationTween = durationTween;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementBoneData *movementBoneData = NULL;
|
CCMovementBoneData *movementBoneData = NULL;
|
||||||
m_pTweenList->removeAllObjects();
|
m_pTweenList->removeAllObjects();
|
||||||
|
|
||||||
CCDictElement *element = NULL;
|
CCDictElement *element = NULL;
|
||||||
|
@ -186,7 +186,7 @@ void CCAnimation::play(const char *animationName, int durationTo, int durationTw
|
||||||
CCDICT_FOREACH(dict, element)
|
CCDICT_FOREACH(dict, element)
|
||||||
{
|
{
|
||||||
CCBone *bone = (CCBone*)element->getObject();
|
CCBone *bone = (CCBone*)element->getObject();
|
||||||
movementBoneData = (MovementBoneData*)m_pMovementData->movBoneDataDic.objectForKey(bone->getName());
|
movementBoneData = (CCMovementBoneData*)m_pMovementData->movBoneDataDic.objectForKey(bone->getName());
|
||||||
|
|
||||||
CCTween *tween = bone->getTween();
|
CCTween *tween = bone->getTween();
|
||||||
if(movementBoneData && movementBoneData->frameList.count()>0)
|
if(movementBoneData && movementBoneData->frameList.count()>0)
|
||||||
|
|
|
@ -65,21 +65,21 @@ public:
|
||||||
* @param durationTo The frames between two animation changing-over.
|
* @param durationTo The frames between two animation changing-over.
|
||||||
* It's meaning is changing to this animation need how many frames
|
* It's meaning is changing to this animation need how many frames
|
||||||
*
|
*
|
||||||
* -1 : use the value from MovementData get from flash design panel
|
* -1 : use the value from CCMovementData get from flash design panel
|
||||||
* @param durationTween The frame count you want to play in the game.
|
* @param durationTween The frame count you want to play in the game.
|
||||||
* if _durationTween is 80, then the animation will played 80 frames in a loop
|
* if _durationTween is 80, then the animation will played 80 frames in a loop
|
||||||
*
|
*
|
||||||
* -1 : use the value from MovementData get from flash design panel
|
* -1 : use the value from CCMovementData get from flash design panel
|
||||||
*
|
*
|
||||||
* @param loop Whether the animation is loop
|
* @param loop Whether the animation is loop
|
||||||
*
|
*
|
||||||
* loop < 0 : use the value from MovementData get from flash design panel
|
* loop < 0 : use the value from CCMovementData get from flash design panel
|
||||||
* loop = 0 : this animation is not loop
|
* loop = 0 : this animation is not loop
|
||||||
* loop > 0 : this animation is loop
|
* loop > 0 : this animation is loop
|
||||||
*
|
*
|
||||||
* @param tweenEasing CCTween easing is used for calculate easing effect
|
* @param tweenEasing CCTween easing is used for calculate easing effect
|
||||||
*
|
*
|
||||||
* TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
|
* TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel
|
||||||
* -1 : fade out
|
* -1 : fade out
|
||||||
* 0 : line
|
* 0 : line
|
||||||
* 1 : fade in
|
* 1 : fade in
|
||||||
|
@ -131,18 +131,18 @@ protected:
|
||||||
*/
|
*/
|
||||||
void updateMovementFrameData(float _currentPercent);
|
void updateMovementFrameData(float _currentPercent);
|
||||||
protected:
|
protected:
|
||||||
//! AnimationData save all MovementDatas this animation used.
|
//! CCAnimationData save all MovementDatas this animation used.
|
||||||
CC_SYNTHESIZE_RETAIN(AnimationData*, m_pAnimationData, AnimationData);
|
CC_SYNTHESIZE_RETAIN(CCAnimationData*, m_pAnimationData, AnimationData);
|
||||||
|
|
||||||
|
|
||||||
MovementData *m_pMovementData; //! MovementData save all MovementFrameDatas this animation used.
|
CCMovementData *m_pMovementData; //! CCMovementData save all MovementFrameDatas this animation used.
|
||||||
|
|
||||||
CCArmature *m_pArmature; //! A weak reference of armature
|
CCArmature *m_pArmature; //! A weak reference of armature
|
||||||
|
|
||||||
std::string m_strMovementID; //! Current movment's name
|
std::string m_strMovementID; //! Current movment's name
|
||||||
|
|
||||||
int m_iPrevFrameIndex; //! Prev key frame index
|
int m_iPrevFrameIndex; //! Prev key frame index
|
||||||
int m_iToIndex; //! The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex.
|
int m_iToIndex; //! The frame index in CCMovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex.
|
||||||
|
|
||||||
CCArray *m_pTweenList;
|
CCArray *m_pTweenList;
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -60,21 +60,21 @@ public:
|
||||||
* @param durationTo The frames between two animation changing-over.
|
* @param durationTo The frames between two animation changing-over.
|
||||||
* It's meaning is changing to this animation need how many frames
|
* It's meaning is changing to this animation need how many frames
|
||||||
*
|
*
|
||||||
* -1 : use the value from MovementData get from flash design panel
|
* -1 : use the value from CCMovementData get from flash design panel
|
||||||
* @param durationTween The frame count you want to play in the game.
|
* @param durationTween The frame count you want to play in the game.
|
||||||
* if _durationTween is 80, then the animation will played 80 frames in a loop
|
* if _durationTween is 80, then the animation will played 80 frames in a loop
|
||||||
*
|
*
|
||||||
* -1 : use the value from MovementData get from flash design panel
|
* -1 : use the value from CCMovementData get from flash design panel
|
||||||
*
|
*
|
||||||
* @param loop Whether the animation is loop
|
* @param loop Whether the animation is loop
|
||||||
*
|
*
|
||||||
* loop < 0 : use the value from MovementData get from flash design panel
|
* loop < 0 : use the value from CCMovementData get from flash design panel
|
||||||
* loop = 0 : this animation is not loop
|
* loop = 0 : this animation is not loop
|
||||||
* loop > 0 : this animation is loop
|
* loop > 0 : this animation is loop
|
||||||
*
|
*
|
||||||
* @param tweenEasing CCTween easing is used for calculate easing effect
|
* @param tweenEasing CCTween easing is used for calculate easing effect
|
||||||
*
|
*
|
||||||
* TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
|
* TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel
|
||||||
* -1 : fade out
|
* -1 : fade out
|
||||||
* 0 : line
|
* 0 : line
|
||||||
* 1 : fade in
|
* 1 : fade in
|
||||||
|
|
|
@ -77,8 +77,8 @@ bool CCTween::init(CCBone *bone)
|
||||||
bool bRet = false;
|
bool bRet = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
m_pFrom = new FrameData();
|
m_pFrom = new CCFrameData();
|
||||||
m_pBetween = new FrameData();
|
m_pBetween = new CCFrameData();
|
||||||
|
|
||||||
m_pBone = bone;
|
m_pBone = bone;
|
||||||
m_pTweenData = m_pBone->getTweenData();
|
m_pTweenData = m_pBone->getTweenData();
|
||||||
|
@ -93,7 +93,7 @@ bool CCTween::init(CCBone *bone)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CCTween::play(MovementBoneData *_movementBoneData, int _durationTo, int _durationTween, int _loop, int _tweenEasing)
|
void CCTween::play(CCMovementBoneData *_movementBoneData, int _durationTo, int _durationTween, int _loop, int _tweenEasing)
|
||||||
{
|
{
|
||||||
CCProcessBase::play(NULL, _durationTo, _durationTween, _loop, _tweenEasing);
|
CCProcessBase::play(NULL, _durationTo, _durationTween, _loop, _tweenEasing);
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void CCTween::play(MovementBoneData *_movementBoneData, int _durationTo, int _du
|
||||||
if (m_pMovementBoneData->frameList.count() == 1)
|
if (m_pMovementBoneData->frameList.count() == 1)
|
||||||
{
|
{
|
||||||
m_eLoopType = SINGLE_FRAME;
|
m_eLoopType = SINGLE_FRAME;
|
||||||
FrameData *_nextKeyFrame = m_pMovementBoneData->getFrameData(0);
|
CCFrameData *_nextKeyFrame = m_pMovementBoneData->getFrameData(0);
|
||||||
if(_durationTo == 0)
|
if(_durationTo == 0)
|
||||||
{
|
{
|
||||||
setBetween(_nextKeyFrame, _nextKeyFrame);
|
setBetween(_nextKeyFrame, _nextKeyFrame);
|
||||||
|
@ -148,7 +148,7 @@ void CCTween::play(MovementBoneData *_movementBoneData, int _durationTo, int _du
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FrameData *_nextKeyFrame = m_pMovementBoneData->getFrameData(0);
|
CCFrameData *_nextKeyFrame = m_pMovementBoneData->getFrameData(0);
|
||||||
setBetween(m_pTweenData, _nextKeyFrame);
|
setBetween(m_pTweenData, _nextKeyFrame);
|
||||||
m_bIsTweenKeyFrame = true;
|
m_bIsTweenKeyFrame = true;
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ void CCTween::updateHandler()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTween::setBetween(FrameData *from, FrameData *to)
|
void CCTween::setBetween(CCFrameData *from, CCFrameData *to)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -282,7 +282,7 @@ void CCTween::setBetween(FrameData *from, FrameData *to)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CCTween::arriveKeyFrame(FrameData *keyFrameData)
|
void CCTween::arriveKeyFrame(CCFrameData *keyFrameData)
|
||||||
{
|
{
|
||||||
if(keyFrameData)
|
if(keyFrameData)
|
||||||
{
|
{
|
||||||
|
@ -318,7 +318,7 @@ void CCTween::arriveKeyFrame(FrameData *keyFrameData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FrameData *CCTween::tweenNodeTo(float percent, FrameData *node)
|
CCFrameData *CCTween::tweenNodeTo(float percent, CCFrameData *node)
|
||||||
{
|
{
|
||||||
node = node == NULL ? m_pTweenData : node;
|
node = node == NULL ? m_pTweenData : node;
|
||||||
|
|
||||||
|
@ -358,8 +358,8 @@ float CCTween::updateFrameData(float currentPrecent, bool activeFrame)
|
||||||
float playedTime = (float)rawDuration * currentPrecent;
|
float playedTime = (float)rawDuration * currentPrecent;
|
||||||
|
|
||||||
|
|
||||||
FrameData *from;
|
CCFrameData *from;
|
||||||
FrameData *to;
|
CCFrameData *to;
|
||||||
bool isListEnd;
|
bool isListEnd;
|
||||||
|
|
||||||
//! If play to current frame's front or back, then find current frame again
|
//! If play to current frame's front or back, then find current frame again
|
||||||
|
|
|
@ -55,32 +55,32 @@ public:
|
||||||
/**
|
/**
|
||||||
* Start the Process
|
* Start the Process
|
||||||
*
|
*
|
||||||
* @param movementBoneData the MovementBoneData include all frame datas
|
* @param movementBoneData the CCMovementBoneData include all frame datas
|
||||||
* @param durationTo the frames between two animation changing-over.
|
* @param durationTo the frames between two animation changing-over.
|
||||||
* It's meaning is changing to this animation need how many frames
|
* It's meaning is changing to this animation need how many frames
|
||||||
*
|
*
|
||||||
* -1 : use the value from MovementData get from flash design panel
|
* -1 : use the value from CCMovementData get from flash design panel
|
||||||
* @param durationTween the frame count you want to play in the game.
|
* @param durationTween the frame count you want to play in the game.
|
||||||
* if _durationTween is 80, then the animation will played 80 frames in a loop
|
* if _durationTween is 80, then the animation will played 80 frames in a loop
|
||||||
*
|
*
|
||||||
* -1 : use the value from MovementData get from flash design panel
|
* -1 : use the value from CCMovementData get from flash design panel
|
||||||
*
|
*
|
||||||
* @param loop whether the animation is loop
|
* @param loop whether the animation is loop
|
||||||
*
|
*
|
||||||
* loop < 0 : use the value from MovementData get from flash design panel
|
* loop < 0 : use the value from CCMovementData get from flash design panel
|
||||||
* loop = 0 : this animation is not loop
|
* loop = 0 : this animation is not loop
|
||||||
* loop > 0 : this animation is loop
|
* loop > 0 : this animation is loop
|
||||||
*
|
*
|
||||||
* @param tweenEasing tween easing is used for calculate easing effect
|
* @param tweenEasing tween easing is used for calculate easing effect
|
||||||
*
|
*
|
||||||
* TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
|
* TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel
|
||||||
* -1 : fade out
|
* -1 : fade out
|
||||||
* 0 : line
|
* 0 : line
|
||||||
* 1 : fade in
|
* 1 : fade in
|
||||||
* 2 : fade in and out
|
* 2 : fade in and out
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual void play(MovementBoneData *movementBoneData, int durationTo, int durationTween, int loop, int tweenEasing);
|
virtual void play(CCMovementBoneData *movementBoneData, int durationTo, int durationTween, int loop, int tweenEasing);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -97,27 +97,27 @@ protected:
|
||||||
/**
|
/**
|
||||||
* Calculate the between value of _from and _to, and give it to between frame data
|
* Calculate the between value of _from and _to, and give it to between frame data
|
||||||
*/
|
*/
|
||||||
virtual void setBetween(FrameData *from, FrameData *to);
|
virtual void setBetween(CCFrameData *from, CCFrameData *to);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* According to the percent to calculate current FrameData with tween effect
|
* According to the percent to calculate current CCFrameData with tween effect
|
||||||
*/
|
*/
|
||||||
virtual FrameData *tweenNodeTo(float percent, FrameData *node = NULL);
|
virtual CCFrameData *tweenNodeTo(float percent, CCFrameData *node = NULL);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update display index and process the key frame event when arrived a key frame
|
* Update display index and process the key frame event when arrived a key frame
|
||||||
*/
|
*/
|
||||||
virtual void arriveKeyFrame(FrameData *keyFrameData);
|
virtual void arriveKeyFrame(CCFrameData *keyFrameData);
|
||||||
protected:
|
protected:
|
||||||
//! A weak reference to the current MovementBoneData. The data is in the data pool
|
//! A weak reference to the current CCMovementBoneData. The data is in the data pool
|
||||||
CC_SYNTHESIZE(MovementBoneData*, m_pMovementBoneData, MovementBoneData)
|
CC_SYNTHESIZE(CCMovementBoneData*, m_pMovementBoneData, MovementBoneData)
|
||||||
|
|
||||||
FrameData *m_pTweenData; //! The computational tween frame data, //! A weak reference to the CCBone's tweenData
|
CCFrameData *m_pTweenData; //! The computational tween frame data, //! A weak reference to the CCBone's tweenData
|
||||||
FrameData *m_pFrom; //! From frame data, used for calculate between value
|
CCFrameData *m_pFrom; //! From frame data, used for calculate between value
|
||||||
FrameData *m_pTo; //! To frame data, used for calculate between value
|
CCFrameData *m_pTo; //! To frame data, used for calculate between value
|
||||||
FrameData *m_pBetween; //! Between frame data, used for calculate current FrameData(m_pNode) value
|
CCFrameData *m_pBetween; //! Between frame data, used for calculate current CCFrameData(m_pNode) value
|
||||||
|
|
||||||
FrameData *m_pCurrentKeyFrame; //! A weak reference to the current FrameData. The data is in the data pool
|
CCFrameData *m_pCurrentKeyFrame; //! A weak reference to the current CCFrameData. The data is in the data pool
|
||||||
|
|
||||||
CCBone *m_pBone; //! A weak reference to the CCBone
|
CCBone *m_pBone; //! A weak reference to the CCBone
|
||||||
|
|
||||||
|
@ -130,11 +130,11 @@ protected:
|
||||||
int m_iTotalDuration;
|
int m_iTotalDuration;
|
||||||
|
|
||||||
|
|
||||||
int m_iFromIndex; //! The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex
|
int m_iFromIndex; //! The current frame index in FrameList of CCMovementBoneData, it's different from m_iFrameIndex
|
||||||
int m_iToIndex; //! The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex
|
int m_iToIndex; //! The next frame index in FrameList of CCMovementBoneData, it's different from m_iFrameIndex
|
||||||
|
|
||||||
|
|
||||||
FrameData *m_pEditKeyFrame;
|
CCFrameData *m_pEditKeyFrame;
|
||||||
|
|
||||||
CCAnimation *m_pAnimation;
|
CCAnimation *m_pAnimation;
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,8 +27,8 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
#pragma region DisplayData
|
#pragma region CCDisplayData
|
||||||
const char *DisplayData::changeDisplayToTexture(const char *displayName)
|
const char *CCDisplayData::changeDisplayToTexture(const char *displayName)
|
||||||
{
|
{
|
||||||
// remove .xxx
|
// remove .xxx
|
||||||
std::string textureName = displayName;
|
std::string textureName = displayName;
|
||||||
|
@ -42,75 +42,75 @@ const char *DisplayData::changeDisplayToTexture(const char *displayName)
|
||||||
return textureName.c_str();
|
return textureName.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayData::DisplayData(void)
|
CCDisplayData::CCDisplayData(void)
|
||||||
:displayType(CS_DISPLAY_SPRITE)
|
:displayType(CS_DISPLAY_SPRITE)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayData::~DisplayData(void)
|
CCDisplayData::~CCDisplayData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region SpriteDisplayData
|
#pragma region CCSpriteDisplayData
|
||||||
SpriteDisplayData::SpriteDisplayData(void)
|
CCSpriteDisplayData::CCSpriteDisplayData(void)
|
||||||
:displayName("")
|
:displayName("")
|
||||||
{
|
{
|
||||||
displayType = CS_DISPLAY_SPRITE;
|
displayType = CS_DISPLAY_SPRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteDisplayData::~SpriteDisplayData()
|
CCSpriteDisplayData::~CCSpriteDisplayData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteDisplayData::copy(SpriteDisplayData *displayData)
|
void CCSpriteDisplayData::copy(CCSpriteDisplayData *displayData)
|
||||||
{
|
{
|
||||||
displayName = displayData->displayName;
|
displayName = displayData->displayName;
|
||||||
displayType = displayData->displayType;
|
displayType = displayData->displayType;
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region ArmatureDisplayData
|
#pragma region CCArmatureDisplayData
|
||||||
ArmatureDisplayData::ArmatureDisplayData(void)
|
CCArmatureDisplayData::CCArmatureDisplayData(void)
|
||||||
:displayName("")
|
:displayName("")
|
||||||
{
|
{
|
||||||
displayType = CS_DISPLAY_ARMATURE;
|
displayType = CS_DISPLAY_ARMATURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArmatureDisplayData::~ArmatureDisplayData()
|
CCArmatureDisplayData::~CCArmatureDisplayData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArmatureDisplayData::copy(ArmatureDisplayData *displayData)
|
void CCArmatureDisplayData::copy(CCArmatureDisplayData *displayData)
|
||||||
{
|
{
|
||||||
displayName = displayData->displayName;
|
displayName = displayData->displayName;
|
||||||
displayType = displayData->displayType;
|
displayType = displayData->displayType;
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region ParticleDisplayData
|
#pragma region CCParticleDisplayData
|
||||||
ParticleDisplayData::ParticleDisplayData(void)
|
CCParticleDisplayData::CCParticleDisplayData(void)
|
||||||
:plist("")
|
:plist("")
|
||||||
{
|
{
|
||||||
displayType = CS_DISPLAY_PARTICLE;
|
displayType = CS_DISPLAY_PARTICLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParticleDisplayData::copy(ParticleDisplayData *displayData)
|
void CCParticleDisplayData::copy(CCParticleDisplayData *displayData)
|
||||||
{
|
{
|
||||||
plist = displayData->plist;
|
plist = displayData->plist;
|
||||||
displayType = displayData->displayType;
|
displayType = displayData->displayType;
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region ShaderDisplayData
|
#pragma region CCShaderDisplayData
|
||||||
ShaderDisplayData::ShaderDisplayData(void)
|
CCShaderDisplayData::CCShaderDisplayData(void)
|
||||||
:vert("")
|
:vert("")
|
||||||
,frag("")
|
,frag("")
|
||||||
{
|
{
|
||||||
displayType = CS_DISPLAY_SHADER;
|
displayType = CS_DISPLAY_SHADER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShaderDisplayData::copy(ShaderDisplayData *displayData)
|
void CCShaderDisplayData::copy(CCShaderDisplayData *displayData)
|
||||||
{
|
{
|
||||||
vert = displayData->vert;
|
vert = displayData->vert;
|
||||||
frag = displayData->frag;
|
frag = displayData->frag;
|
||||||
|
@ -118,8 +118,8 @@ void ShaderDisplayData::copy(ShaderDisplayData *displayData)
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region Node
|
#pragma region CCBaseData
|
||||||
Node::Node()
|
CCBaseData::CCBaseData()
|
||||||
:x(0.0f)
|
:x(0.0f)
|
||||||
,y(0.0f)
|
,y(0.0f)
|
||||||
,zOrder(0)
|
,zOrder(0)
|
||||||
|
@ -139,12 +139,12 @@ Node::Node()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Node::~Node()
|
CCBaseData::~CCBaseData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Node::copy(const Node* node )
|
void CCBaseData::copy(const CCBaseData* node )
|
||||||
{
|
{
|
||||||
x = node->x;
|
x = node->x;
|
||||||
y = node->y;
|
y = node->y;
|
||||||
|
@ -165,7 +165,7 @@ void Node::copy(const Node* node )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Node::subtract(Node *from, Node *to)
|
void CCBaseData::subtract(CCBaseData *from, CCBaseData *to)
|
||||||
{
|
{
|
||||||
x = to->x - from->x;
|
x = to->x - from->x;
|
||||||
y = to->y - from->y;
|
y = to->y - from->y;
|
||||||
|
@ -211,62 +211,62 @@ void Node::subtract(Node *from, Node *to)
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region BoneData
|
#pragma region CCBoneData
|
||||||
BoneData::BoneData(void)
|
CCBoneData::CCBoneData(void)
|
||||||
:name("")
|
:name("")
|
||||||
,parentName("")
|
,parentName("")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BoneData::~BoneData(void)
|
CCBoneData::~CCBoneData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BoneData::init()
|
bool CCBoneData::init()
|
||||||
{
|
{
|
||||||
displayDataList.init();
|
displayDataList.init();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoneData::addDisplayData(DisplayData *displayData)
|
void CCBoneData::addDisplayData(CCDisplayData *displayData)
|
||||||
{
|
{
|
||||||
displayDataList.addObject(displayData);
|
displayDataList.addObject(displayData);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayData *BoneData::getDisplayData(int index)
|
CCDisplayData *CCBoneData::getDisplayData(int index)
|
||||||
{
|
{
|
||||||
return (DisplayData*)displayDataList.objectAtIndex(index);
|
return (CCDisplayData*)displayDataList.objectAtIndex(index);
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region ArmatureData
|
#pragma region CCArmatureData
|
||||||
ArmatureData::ArmatureData()
|
CCArmatureData::CCArmatureData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ArmatureData::~ArmatureData()
|
CCArmatureData::~CCArmatureData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ArmatureData::init()
|
bool CCArmatureData::init()
|
||||||
{
|
{
|
||||||
return boneList.init();
|
return boneList.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArmatureData::addBoneData(BoneData *boneData)
|
void CCArmatureData::addBoneData(CCBoneData *boneData)
|
||||||
{
|
{
|
||||||
boneDataDic.setObject(boneData, boneData->name);
|
boneDataDic.setObject(boneData, boneData->name);
|
||||||
boneList.addObject(boneData);
|
boneList.addObject(boneData);
|
||||||
}
|
}
|
||||||
|
|
||||||
BoneData *ArmatureData::getBoneData(const char *boneName)
|
CCBoneData *CCArmatureData::getBoneData(const char *boneName)
|
||||||
{
|
{
|
||||||
return (BoneData*)boneDataDic.objectForKey(boneName);
|
return (CCBoneData*)boneDataDic.objectForKey(boneName);
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region FrameData
|
#pragma region CCFrameData
|
||||||
FrameData::FrameData(void)
|
CCFrameData::CCFrameData(void)
|
||||||
:duration(1)
|
:duration(1)
|
||||||
,tweenEasing(Linear)
|
,tweenEasing(Linear)
|
||||||
,displayIndex(0)
|
,displayIndex(0)
|
||||||
|
@ -278,13 +278,13 @@ FrameData::FrameData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameData::~FrameData(void)
|
CCFrameData::~CCFrameData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameData::copy(FrameData *frameData)
|
void CCFrameData::copy(CCFrameData *frameData)
|
||||||
{
|
{
|
||||||
Node::copy(frameData);
|
CCBaseData::copy(frameData);
|
||||||
|
|
||||||
duration = frameData->duration;
|
duration = frameData->duration;
|
||||||
displayIndex = frameData->displayIndex;
|
displayIndex = frameData->displayIndex;
|
||||||
|
@ -292,8 +292,8 @@ void FrameData::copy(FrameData *frameData)
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region MovementBoneData
|
#pragma region CCMovementBoneData
|
||||||
MovementBoneData::MovementBoneData()
|
CCMovementBoneData::CCMovementBoneData()
|
||||||
:delay(0.0f)
|
:delay(0.0f)
|
||||||
,scale(1.0f)
|
,scale(1.0f)
|
||||||
,duration(0)
|
,duration(0)
|
||||||
|
@ -301,31 +301,31 @@ MovementBoneData::MovementBoneData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementBoneData::~MovementBoneData(void)
|
CCMovementBoneData::~CCMovementBoneData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MovementBoneData::init()
|
bool CCMovementBoneData::init()
|
||||||
{
|
{
|
||||||
return frameList.init();
|
return frameList.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovementBoneData::addFrameData(FrameData *frameData)
|
void CCMovementBoneData::addFrameData(CCFrameData *frameData)
|
||||||
{
|
{
|
||||||
frameList.addObject(frameData);
|
frameList.addObject(frameData);
|
||||||
duration += frameData->duration;
|
duration += frameData->duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameData *MovementBoneData::getFrameData(int index)
|
CCFrameData *CCMovementBoneData::getFrameData(int index)
|
||||||
{
|
{
|
||||||
return (FrameData*)frameList.objectAtIndex(index);
|
return (CCFrameData*)frameList.objectAtIndex(index);
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma region MovementData
|
#pragma region CCMovementData
|
||||||
MovementData::MovementData(void)
|
CCMovementData::CCMovementData(void)
|
||||||
:name("")
|
:name("")
|
||||||
,duration(0)
|
,duration(0)
|
||||||
,durationTo(0)
|
,durationTo(0)
|
||||||
|
@ -335,54 +335,54 @@ MovementData::MovementData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementData::~MovementData(void)
|
CCMovementData::~CCMovementData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovementData::addMovementBoneData(MovementBoneData *movBoneData)
|
void CCMovementData::addMovementBoneData(CCMovementBoneData *movBoneData)
|
||||||
{
|
{
|
||||||
movBoneDataDic.setObject(movBoneData, movBoneData->name);
|
movBoneDataDic.setObject(movBoneData, movBoneData->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementBoneData *MovementData::getMovementBoneData(const char *boneName)
|
CCMovementBoneData *CCMovementData::getMovementBoneData(const char *boneName)
|
||||||
{
|
{
|
||||||
return (MovementBoneData*)movBoneDataDic.objectForKey(boneName);
|
return (CCMovementBoneData*)movBoneDataDic.objectForKey(boneName);
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma region AnimationData
|
#pragma region CCAnimationData
|
||||||
AnimationData::AnimationData(void)
|
CCAnimationData::CCAnimationData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimationData::~AnimationData(void)
|
CCAnimationData::~CCAnimationData(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationData::release()
|
void CCAnimationData::release()
|
||||||
{
|
{
|
||||||
CCObject::release();
|
CCObject::release();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationData::retain()
|
void CCAnimationData::retain()
|
||||||
{
|
{
|
||||||
CCObject::retain();
|
CCObject::retain();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationData::addMovement(MovementData *movData)
|
void CCAnimationData::addMovement(CCMovementData *movData)
|
||||||
{
|
{
|
||||||
movementDataDic.setObject(movData, movData->name);
|
movementDataDic.setObject(movData, movData->name);
|
||||||
movementNames.push_back(movData->name);
|
movementNames.push_back(movData->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementData *AnimationData::getMovement(const char *movementName)
|
CCMovementData *CCAnimationData::getMovement(const char *movementName)
|
||||||
{
|
{
|
||||||
return (MovementData*)movementDataDic.objectForKey(movementName);
|
return (CCMovementData*)movementDataDic.objectForKey(movementName);
|
||||||
}
|
}
|
||||||
|
|
||||||
int AnimationData::getMovementCount()
|
int CCAnimationData::getMovementCount()
|
||||||
{
|
{
|
||||||
return movementDataDic.count();
|
return movementDataDic.count();
|
||||||
}
|
}
|
||||||
|
@ -390,23 +390,23 @@ int AnimationData::getMovementCount()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma region ContourData
|
#pragma region CCContourData
|
||||||
ContourData::ContourData()
|
CCContourData::CCContourData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ContourData::~ContourData()
|
CCContourData::~CCContourData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContourData::init()
|
bool CCContourData::init()
|
||||||
{
|
{
|
||||||
return vertexList.init();
|
return vertexList.init();
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region TextureData
|
#pragma region CCTextureData
|
||||||
TextureData::TextureData()
|
CCTextureData::CCTextureData()
|
||||||
:height(0.0f)
|
:height(0.0f)
|
||||||
,width(0.0f)
|
,width(0.0f)
|
||||||
,pivotX(0.5f)
|
,pivotX(0.5f)
|
||||||
|
@ -415,23 +415,23 @@ TextureData::TextureData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureData::~TextureData()
|
CCTextureData::~CCTextureData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextureData::init()
|
bool CCTextureData::init()
|
||||||
{
|
{
|
||||||
return contourDataList.init();
|
return contourDataList.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureData::addContourData(ContourData *contourData)
|
void CCTextureData::addContourData(CCContourData *contourData)
|
||||||
{
|
{
|
||||||
contourDataList.addObject(contourData);
|
contourDataList.addObject(contourData);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContourData *TextureData::getContourData(int index)
|
CCContourData *CCTextureData::getContourData(int index)
|
||||||
{
|
{
|
||||||
return (ContourData*)contourDataList.objectAtIndex(index);
|
return (CCContourData*)contourDataList.objectAtIndex(index);
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
|
@ -57,31 +57,31 @@ public: \
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
#pragma region Node
|
#pragma region CCBaseData
|
||||||
/**
|
/**
|
||||||
* the base node include a lot of attribute.
|
* the base node include a lot of attribute.
|
||||||
*/
|
*/
|
||||||
class Node : public cocos2d::CCObject
|
class CCBaseData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(Node)
|
CS_CREATE_NO_PARAM_NO_INIT(CCBaseData)
|
||||||
public:
|
public:
|
||||||
Node();
|
CCBaseData();
|
||||||
~Node(void);
|
~CCBaseData(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy datas from node
|
* Copy datas from node
|
||||||
* @param node A Node to copy datas
|
* @param node A CCBaseData to copy datas
|
||||||
*/
|
*/
|
||||||
virtual void copy(const Node *_node);
|
virtual void copy(const CCBaseData *_node);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculate two Node's between value(_to - _from) and set to self
|
* Calculate two CCBaseData's between value(_to - _from) and set to self
|
||||||
*
|
*
|
||||||
* @param from from Node
|
* @param from from CCBaseData
|
||||||
* @param to to Node
|
* @param to to CCBaseData
|
||||||
*/
|
*/
|
||||||
virtual void subtract(Node *_from, Node *_to);
|
virtual void subtract(CCBaseData *_from, CCBaseData *_to);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* x y skewX skewY scaleX scaleY used to calculate transform matrix
|
* x y skewX skewY scaleX scaleY used to calculate transform matrix
|
||||||
|
@ -104,7 +104,7 @@ public:
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region DisplayData
|
#pragma region CCDisplayData
|
||||||
/**
|
/**
|
||||||
* DisplayType distinguish which type you display is.
|
* DisplayType distinguish which type you display is.
|
||||||
*/
|
*/
|
||||||
|
@ -117,15 +117,15 @@ enum DisplayType{
|
||||||
CS_DISPLAY_MAX
|
CS_DISPLAY_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
class DisplayData : public cocos2d::CCObject
|
class CCDisplayData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(DisplayData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCDisplayData)
|
||||||
|
|
||||||
static const char *changeDisplayToTexture(const char *);
|
static const char *changeDisplayToTexture(const char *);
|
||||||
public:
|
public:
|
||||||
DisplayData();
|
CCDisplayData();
|
||||||
virtual ~DisplayData(void);
|
virtual ~CCDisplayData(void);
|
||||||
|
|
||||||
DisplayType displayType; //! mark which type your display is
|
DisplayType displayType; //! mark which type your display is
|
||||||
};
|
};
|
||||||
|
@ -133,17 +133,17 @@ public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma region SpriteDisplayData
|
#pragma region CCSpriteDisplayData
|
||||||
class SpriteDisplayData : public DisplayData
|
class CCSpriteDisplayData : public CCDisplayData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCSpriteDisplayData)
|
||||||
public:
|
public:
|
||||||
SpriteDisplayData();
|
CCSpriteDisplayData();
|
||||||
virtual ~SpriteDisplayData();
|
virtual ~CCSpriteDisplayData();
|
||||||
|
|
||||||
inline void setParam(const char *displayName){ this->displayName = displayName; }
|
inline void setParam(const char *displayName){ this->displayName = displayName; }
|
||||||
void copy(SpriteDisplayData *displayData);
|
void copy(CCSpriteDisplayData *displayData);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* If DisplayType is CS_DISPLAY_SPRITE, then CCBone will use this image name to create a CCSprite from CCSpriteFrameCache.
|
* If DisplayType is CS_DISPLAY_SPRITE, then CCBone will use this image name to create a CCSprite from CCSpriteFrameCache.
|
||||||
|
@ -158,17 +158,17 @@ public:
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma region ArmatureDisplayData
|
#pragma region CCArmatureDisplayData
|
||||||
class ArmatureDisplayData : public DisplayData
|
class CCArmatureDisplayData : public CCDisplayData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCArmatureDisplayData)
|
||||||
public:
|
public:
|
||||||
ArmatureDisplayData();
|
CCArmatureDisplayData();
|
||||||
virtual ~ArmatureDisplayData();
|
virtual ~CCArmatureDisplayData();
|
||||||
|
|
||||||
inline void setParam(const char *displayName){ this->displayName = displayName; }
|
inline void setParam(const char *displayName){ this->displayName = displayName; }
|
||||||
void copy(ArmatureDisplayData *displayData);
|
void copy(CCArmatureDisplayData *displayData);
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* If DisplayType is CS_DISPLAY_SPRITE, then CCBone will use this image name to create a CCSprite from CCSpriteFrameCache.
|
* If DisplayType is CS_DISPLAY_SPRITE, then CCBone will use this image name to create a CCSprite from CCSpriteFrameCache.
|
||||||
|
@ -183,36 +183,36 @@ public:
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma region ParticleDisplayData
|
#pragma region CCParticleDisplayData
|
||||||
class ParticleDisplayData : public DisplayData
|
class CCParticleDisplayData : public CCDisplayData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCParticleDisplayData)
|
||||||
public:
|
public:
|
||||||
ParticleDisplayData();
|
CCParticleDisplayData();
|
||||||
virtual ~ParticleDisplayData(){};
|
virtual ~CCParticleDisplayData(){};
|
||||||
|
|
||||||
void setParam(const char *plist){ this->plist = plist; }
|
void setParam(const char *plist){ this->plist = plist; }
|
||||||
|
|
||||||
void copy(ParticleDisplayData *displayData);
|
void copy(CCParticleDisplayData *displayData);
|
||||||
public:
|
public:
|
||||||
std::string plist;
|
std::string plist;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma region ShaderDisplayData
|
#pragma region CCShaderDisplayData
|
||||||
class ShaderDisplayData : public DisplayData
|
class CCShaderDisplayData : public CCDisplayData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(ShaderDisplayData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCShaderDisplayData)
|
||||||
public:
|
public:
|
||||||
ShaderDisplayData();
|
CCShaderDisplayData();
|
||||||
virtual ~ShaderDisplayData(){};
|
virtual ~CCShaderDisplayData(){};
|
||||||
|
|
||||||
inline void setParam(const char *vert, const char *frag){ this->vert = vert; this->frag = frag;}
|
inline void setParam(const char *vert, const char *frag){ this->vert = vert; this->frag = frag;}
|
||||||
|
|
||||||
void copy(ShaderDisplayData *displayData);
|
void copy(CCShaderDisplayData *displayData);
|
||||||
public:
|
public:
|
||||||
std::string vert;
|
std::string vert;
|
||||||
std::string frag;
|
std::string frag;
|
||||||
|
@ -220,65 +220,65 @@ public:
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
#pragma region BoneData
|
#pragma region CCBoneData
|
||||||
/**
|
/**
|
||||||
* BoneData used to init a CCBone.
|
* CCBoneData used to init a CCBone.
|
||||||
* BoneData keeps a DisplayData list, a CCBone can have many display to change.
|
* CCBoneData keeps a CCDisplayData list, a CCBone can have many display to change.
|
||||||
* The display information saved in the DisplayData
|
* The display information saved in the CCDisplayData
|
||||||
*/
|
*/
|
||||||
class BoneData : public Node
|
class CCBoneData : public CCBaseData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM(BoneData)
|
CS_CREATE_NO_PARAM(CCBoneData)
|
||||||
public:
|
public:
|
||||||
BoneData(void);
|
CCBoneData(void);
|
||||||
~BoneData(void);
|
~CCBoneData(void);
|
||||||
|
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
|
|
||||||
void addDisplayData(DisplayData *displayData);
|
void addDisplayData(CCDisplayData *displayData);
|
||||||
DisplayData *getDisplayData(int index);
|
CCDisplayData *getDisplayData(int index);
|
||||||
public:
|
public:
|
||||||
std::string name; //! the bone's name
|
std::string name; //! the bone's name
|
||||||
std::string parentName; //! the bone parent's name
|
std::string parentName; //! the bone parent's name
|
||||||
cocos2d::CCArray displayDataList; //! save DisplayData informations for the CCBone
|
CCArray displayDataList; //! save CCDisplayData informations for the CCBone
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region ArmatureData
|
#pragma region CCArmatureData
|
||||||
/**
|
/**
|
||||||
* ArmatureData saved the CCArmature name and Bonedatas needed for the Bones in this CCArmature
|
* CCArmatureData saved the CCArmature name and Bonedatas needed for the Bones in this CCArmature
|
||||||
* When we create a CCArmature, we need to get each CCBone's BoneData as it's init information.
|
* When we create a CCArmature, we need to get each CCBone's CCBoneData as it's init information.
|
||||||
* So we can get a BoneData from the cocos2d::CCDictionary saved in the ArmatureData.
|
* So we can get a CCBoneData from the CCDictionary saved in the CCArmatureData.
|
||||||
*/
|
*/
|
||||||
class ArmatureData : public cocos2d::CCObject
|
class CCArmatureData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM(ArmatureData)
|
CS_CREATE_NO_PARAM(CCArmatureData)
|
||||||
public:
|
public:
|
||||||
ArmatureData();
|
CCArmatureData();
|
||||||
~ArmatureData();
|
~CCArmatureData();
|
||||||
|
|
||||||
bool init();
|
bool init();
|
||||||
void addBoneData(BoneData *boneData);
|
void addBoneData(CCBoneData *boneData);
|
||||||
BoneData *getBoneData(const char *boneName);
|
CCBoneData *getBoneData(const char *boneName);
|
||||||
public:
|
public:
|
||||||
std::string name;
|
std::string name;
|
||||||
cocos2d::CCDictionary boneDataDic;
|
CCDictionary boneDataDic;
|
||||||
cocos2d::CCArray boneList;
|
CCArray boneList;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region FrameData
|
#pragma region CCFrameData
|
||||||
class FrameData : public Node
|
class CCFrameData : public CCBaseData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(FrameData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCFrameData)
|
||||||
public:
|
public:
|
||||||
FrameData();
|
CCFrameData();
|
||||||
~FrameData();
|
~CCFrameData();
|
||||||
|
|
||||||
virtual void copy(FrameData *frameData);
|
virtual void copy(CCFrameData *frameData);
|
||||||
public:
|
public:
|
||||||
int duration; //! The frame will last m_iDuration frames
|
int duration; //! The frame will last m_iDuration frames
|
||||||
CCTweenType tweenEasing; //! Every frame's tween easing effect
|
CCTweenType tweenEasing; //! Every frame's tween easing effect
|
||||||
|
@ -299,40 +299,40 @@ public:
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region MovementBoneData
|
#pragma region CCMovementBoneData
|
||||||
class MovementBoneData : public cocos2d::CCObject
|
class CCMovementBoneData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM(MovementBoneData)
|
CS_CREATE_NO_PARAM(CCMovementBoneData)
|
||||||
public:
|
public:
|
||||||
MovementBoneData();
|
CCMovementBoneData();
|
||||||
~MovementBoneData(void);
|
~CCMovementBoneData(void);
|
||||||
|
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
|
|
||||||
void addFrameData(FrameData *frameData);
|
void addFrameData(CCFrameData *frameData);
|
||||||
FrameData *getFrameData(int index);
|
CCFrameData *getFrameData(int index);
|
||||||
public:
|
public:
|
||||||
float delay; //! movement delay percent, this value can produce a delay effect
|
float delay; //! movement delay percent, this value can produce a delay effect
|
||||||
float scale; //! scale this movement
|
float scale; //! scale this movement
|
||||||
float duration; //! this CCBone in this movement will last m_iDuration frames
|
float duration; //! this CCBone in this movement will last m_iDuration frames
|
||||||
std::string name; //! bone name
|
std::string name; //! bone name
|
||||||
|
|
||||||
cocos2d::CCArray frameList;
|
CCArray frameList;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region MovementData
|
#pragma region CCMovementData
|
||||||
class MovementData : public cocos2d::CCObject
|
class CCMovementData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(MovementData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCMovementData)
|
||||||
public:
|
public:
|
||||||
MovementData(void);
|
CCMovementData(void);
|
||||||
~MovementData(void);
|
~CCMovementData(void);
|
||||||
|
|
||||||
void addMovementBoneData(MovementBoneData *movBoneData);
|
void addMovementBoneData(CCMovementBoneData *movBoneData);
|
||||||
MovementBoneData *getMovementBoneData(const char *boneName);
|
CCMovementBoneData *getMovementBoneData(const char *boneName);
|
||||||
public:
|
public:
|
||||||
std::string name;
|
std::string name;
|
||||||
int duration; //! the frames this movement will last
|
int duration; //! the frames this movement will last
|
||||||
|
@ -355,50 +355,50 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Which tween easing effect the movement use
|
* Which tween easing effect the movement use
|
||||||
* TWEEN_EASING_MAX : use the value from MovementData get from flash design panel
|
* TWEEN_EASING_MAX : use the value from CCMovementData get from flash design panel
|
||||||
*/
|
*/
|
||||||
CCTweenType tweenEasing;
|
CCTweenType tweenEasing;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief save movment bone datas
|
* @brief save movment bone datas
|
||||||
* @key std::string
|
* @key std::string
|
||||||
* @value MovementBoneData *
|
* @value CCMovementBoneData *
|
||||||
*/
|
*/
|
||||||
cocos2d::CCDictionary movBoneDataDic;
|
CCDictionary movBoneDataDic;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region AnimationData
|
#pragma region CCAnimationData
|
||||||
/**
|
/**
|
||||||
* AnimationData include all movement infomation for the CCArmature
|
* CCAnimationData include all movement infomation for the CCArmature
|
||||||
* The struct is AnimationData -> MovementData -> MovementBoneData -> FrameData
|
* The struct is CCAnimationData -> CCMovementData -> CCMovementBoneData -> CCFrameData
|
||||||
* -> MovementFrameData
|
* -> MovementFrameData
|
||||||
*/
|
*/
|
||||||
class AnimationData : public cocos2d::CCObject
|
class CCAnimationData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM_NO_INIT(AnimationData)
|
CS_CREATE_NO_PARAM_NO_INIT(CCAnimationData)
|
||||||
public:
|
public:
|
||||||
AnimationData(void);
|
CCAnimationData(void);
|
||||||
~AnimationData(void);
|
~CCAnimationData(void);
|
||||||
|
|
||||||
void release();
|
void release();
|
||||||
void retain();
|
void retain();
|
||||||
|
|
||||||
void addMovement(MovementData* movData);
|
void addMovement(CCMovementData* movData);
|
||||||
MovementData *getMovement(const char *movementName);
|
CCMovementData *getMovement(const char *movementName);
|
||||||
int getMovementCount();
|
int getMovementCount();
|
||||||
public:
|
public:
|
||||||
std::string name;
|
std::string name;
|
||||||
cocos2d::CCDictionary movementDataDic;
|
CCDictionary movementDataDic;
|
||||||
std::vector<std::string> movementNames;
|
std::vector<std::string> movementNames;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region ContourData
|
#pragma region CCContourData
|
||||||
struct ContourVertex2 : public cocos2d::CCObject
|
struct CCContourVertex2 : public CCObject
|
||||||
{
|
{
|
||||||
ContourVertex2(float x, float y)
|
CCContourVertex2(float x, float y)
|
||||||
{
|
{
|
||||||
this->x = x;
|
this->x = x;
|
||||||
this->y = y;
|
this->y = y;
|
||||||
|
@ -409,41 +409,41 @@ struct ContourVertex2 : public cocos2d::CCObject
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ContourData include a contour vertex information
|
* CCContourData include a contour vertex information
|
||||||
*/
|
*/
|
||||||
class ContourData : public cocos2d::CCObject
|
class CCContourData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM(ContourData)
|
CS_CREATE_NO_PARAM(CCContourData)
|
||||||
public:
|
public:
|
||||||
ContourData();
|
CCContourData();
|
||||||
~ContourData(void);
|
~CCContourData(void);
|
||||||
|
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
public:
|
public:
|
||||||
cocos2d::CCArray vertexList; //! Save contour vertex info, vertex saved in a CCPoint
|
CCArray vertexList; //! Save contour vertex info, vertex saved in a CCPoint
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#pragma region TextureData
|
#pragma region CCTextureData
|
||||||
/*
|
/*
|
||||||
* TextureData include a texture's information
|
* CCTextureData include a texture's information
|
||||||
*/
|
*/
|
||||||
class TextureData : public cocos2d::CCObject
|
class CCTextureData : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CS_CREATE_NO_PARAM(TextureData)
|
CS_CREATE_NO_PARAM(CCTextureData)
|
||||||
public:
|
public:
|
||||||
TextureData();
|
CCTextureData();
|
||||||
~TextureData(void);
|
~CCTextureData(void);
|
||||||
|
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
|
|
||||||
void addContourData(ContourData *contourData);
|
void addContourData(CCContourData *contourData);
|
||||||
ContourData *getContourData(int index);
|
CCContourData *getContourData(int index);
|
||||||
public:
|
public:
|
||||||
std::string name; //! The texture's name
|
std::string name; //! The texture's name
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ public:
|
||||||
float width; //! The texture's width, height
|
float width; //! The texture's width, height
|
||||||
float height;
|
float height;
|
||||||
|
|
||||||
cocos2d::CCArray contourDataList;
|
CCArray contourDataList;
|
||||||
};
|
};
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
CC_SYNTHESIZE_RETAIN(CCNode*, m_pDisplay, Display);
|
CC_SYNTHESIZE_RETAIN(CCNode*, m_pDisplay, Display);
|
||||||
CC_SYNTHESIZE_RETAIN(DisplayData*, m_pDisplayData, DisplayData);
|
CC_SYNTHESIZE_RETAIN(CCDisplayData*, m_pDisplayData, DisplayData);
|
||||||
|
|
||||||
#if ENABLE_PHYSICS_DETECT
|
#if ENABLE_PHYSICS_DETECT
|
||||||
CC_SYNTHESIZE_RETAIN(CCColliderDetector*, m_pColliderDetector, ColliderDetector);
|
CC_SYNTHESIZE_RETAIN(CCColliderDetector*, m_pColliderDetector, ColliderDetector);
|
||||||
|
|
|
@ -33,7 +33,7 @@ THE SOFTWARE.
|
||||||
|
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
void CS_DISPLAY_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData)
|
void CS_DISPLAY_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData)
|
||||||
{
|
{
|
||||||
switch(displayData->displayType)
|
switch(displayData->displayType)
|
||||||
{
|
{
|
||||||
|
@ -95,10 +95,10 @@ void CS_DISPLAY_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CS_DISPLAY_SPRITE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData)
|
void CS_DISPLAY_SPRITE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData)
|
||||||
{
|
{
|
||||||
SpriteDisplayData *sdp = SpriteDisplayData::create();
|
CCSpriteDisplayData *sdp = CCSpriteDisplayData::create();
|
||||||
sdp->copy((SpriteDisplayData*)displayData);
|
sdp->copy((CCSpriteDisplayData*)displayData);
|
||||||
decoDisplay->setDisplayData(sdp);
|
decoDisplay->setDisplayData(sdp);
|
||||||
CS_DISPLAY_SPRITE_CREATE(bone, decoDisplay);
|
CS_DISPLAY_SPRITE_CREATE(bone, decoDisplay);
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ void CS_DISPLAY_SPRITE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
||||||
{
|
{
|
||||||
CCSkin *skin = NULL;
|
CCSkin *skin = NULL;
|
||||||
|
|
||||||
SpriteDisplayData *displayData = (SpriteDisplayData*)decoDisplay->getDisplayData();
|
CCSpriteDisplayData *displayData = (CCSpriteDisplayData*)decoDisplay->getDisplayData();
|
||||||
|
|
||||||
//! remove .xxx
|
//! remove .xxx
|
||||||
std::string textureName = displayData->displayName;
|
std::string textureName = displayData->displayName;
|
||||||
|
@ -131,7 +131,7 @@ void CS_DISPLAY_SPRITE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
||||||
CCTextureAtlas *atlas = CCSpriteFrameCacheHelper::sharedSpriteFrameCacheHelper()->getTextureAtlas((textureName + ".png").c_str());
|
CCTextureAtlas *atlas = CCSpriteFrameCacheHelper::sharedSpriteFrameCacheHelper()->getTextureAtlas((textureName + ".png").c_str());
|
||||||
skin->setTextureAtlas(atlas);
|
skin->setTextureAtlas(atlas);
|
||||||
|
|
||||||
TextureData *textureData = CCArmatureDataManager::sharedArmatureDataManager()->getTextureData(textureName.c_str());
|
CCTextureData *textureData = CCArmatureDataManager::sharedArmatureDataManager()->getTextureData(textureName.c_str());
|
||||||
if(textureData)
|
if(textureData)
|
||||||
{
|
{
|
||||||
//! Init display anchorPointŁŹ every Texture have a anchor point
|
//! Init display anchorPointŁŹ every Texture have a anchor point
|
||||||
|
@ -163,17 +163,17 @@ void CS_DISPLAY_SPRITE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, fl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CS_DISPLAY_ARMATURE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData)
|
void CS_DISPLAY_ARMATURE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData)
|
||||||
{
|
{
|
||||||
ArmatureDisplayData *adp = ArmatureDisplayData::create(); ;
|
CCArmatureDisplayData *adp = CCArmatureDisplayData::create(); ;
|
||||||
adp->copy((ArmatureDisplayData*)displayData);
|
adp->copy((CCArmatureDisplayData*)displayData);
|
||||||
decoDisplay->setDisplayData(adp);
|
decoDisplay->setDisplayData(adp);
|
||||||
|
|
||||||
CS_DISPLAY_ARMATURE_CREATE(bone, decoDisplay);
|
CS_DISPLAY_ARMATURE_CREATE(bone, decoDisplay);
|
||||||
}
|
}
|
||||||
void CS_DISPLAY_ARMATURE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
void CS_DISPLAY_ARMATURE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
||||||
{
|
{
|
||||||
ArmatureDisplayData *displayData = (ArmatureDisplayData*)decoDisplay->getDisplayData();
|
CCArmatureDisplayData *displayData = (CCArmatureDisplayData*)decoDisplay->getDisplayData();
|
||||||
|
|
||||||
CCArmature *armature = CCArmature::create(displayData->displayName.c_str(), bone);
|
CCArmature *armature = CCArmature::create(displayData->displayName.c_str(), bone);
|
||||||
|
|
||||||
|
@ -199,24 +199,24 @@ void CS_DISPLAY_ARMATURE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CS_DISPLAY_PARTICLE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData)
|
void CS_DISPLAY_PARTICLE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData)
|
||||||
{
|
{
|
||||||
ParticleDisplayData *adp = ParticleDisplayData::create(); ;
|
CCParticleDisplayData *adp = CCParticleDisplayData::create(); ;
|
||||||
adp->copy((ParticleDisplayData*)displayData);
|
adp->copy((CCParticleDisplayData*)displayData);
|
||||||
decoDisplay->setDisplayData(adp);
|
decoDisplay->setDisplayData(adp);
|
||||||
|
|
||||||
CS_DISPLAY_PARTICLE_CREATE(bone, decoDisplay);
|
CS_DISPLAY_PARTICLE_CREATE(bone, decoDisplay);
|
||||||
}
|
}
|
||||||
void CS_DISPLAY_PARTICLE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
void CS_DISPLAY_PARTICLE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
||||||
{
|
{
|
||||||
ParticleDisplayData *displayData = (ParticleDisplayData*)decoDisplay->getDisplayData();
|
CCParticleDisplayData *displayData = (CCParticleDisplayData*)decoDisplay->getDisplayData();
|
||||||
CCParticleSystem *system = CCParticleSystemQuad::create(displayData->plist.c_str());
|
CCParticleSystem *system = CCParticleSystemQuad::create(displayData->plist.c_str());
|
||||||
decoDisplay->setDisplay(system);
|
decoDisplay->setDisplay(system);
|
||||||
}
|
}
|
||||||
void CS_DISPLAY_PARTICLE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty)
|
void CS_DISPLAY_PARTICLE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty)
|
||||||
{
|
{
|
||||||
CCParticleSystem *system = (CCParticleSystem*)decoDisplay->getDisplay();
|
CCParticleSystem *system = (CCParticleSystem*)decoDisplay->getDisplay();
|
||||||
Node node;
|
CCBaseData node;
|
||||||
CCTransformHelp::matrixToNode(bone->nodeToArmatureTransform(), node);
|
CCTransformHelp::matrixToNode(bone->nodeToArmatureTransform(), node);
|
||||||
system->setPosition(node.x, node.y);
|
system->setPosition(node.x, node.y);
|
||||||
system->setScaleX(node.scaleX);
|
system->setScaleX(node.scaleX);
|
||||||
|
@ -226,17 +226,17 @@ void CS_DISPLAY_PARTICLE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CS_DISPLAY_SHADER_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData)
|
void CS_DISPLAY_SHADER_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData)
|
||||||
{
|
{
|
||||||
ShaderDisplayData *sdp = ShaderDisplayData::create();
|
CCShaderDisplayData *sdp = CCShaderDisplayData::create();
|
||||||
sdp->copy((ShaderDisplayData*)displayData);
|
sdp->copy((CCShaderDisplayData*)displayData);
|
||||||
decoDisplay->setDisplayData(sdp);
|
decoDisplay->setDisplayData(sdp);
|
||||||
|
|
||||||
CS_DISPLAY_SHADER_CREATE(bone, decoDisplay);
|
CS_DISPLAY_SHADER_CREATE(bone, decoDisplay);
|
||||||
}
|
}
|
||||||
void CS_DISPLAY_SHADER_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
void CS_DISPLAY_SHADER_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay)
|
||||||
{
|
{
|
||||||
ShaderDisplayData *displayData = (ShaderDisplayData*)decoDisplay->getDisplayData();
|
CCShaderDisplayData *displayData = (CCShaderDisplayData*)decoDisplay->getDisplayData();
|
||||||
CCShaderNode *sn = CCShaderNode::shaderNodeWithVertex(displayData->vert.c_str(), displayData->frag.c_str());
|
CCShaderNode *sn = CCShaderNode::shaderNodeWithVertex(displayData->vert.c_str(), displayData->frag.c_str());
|
||||||
decoDisplay->setDisplay(sn);
|
decoDisplay->setDisplay(sn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,26 +33,26 @@ NS_CC_EXT_BEGIN
|
||||||
class CCSkin;
|
class CCSkin;
|
||||||
class CCBone;
|
class CCBone;
|
||||||
class CCDecorativeDisplay;
|
class CCDecorativeDisplay;
|
||||||
class DisplayData;
|
class CCDisplayData;
|
||||||
|
|
||||||
|
|
||||||
void CS_DISPLAY_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData);
|
void CS_DISPLAY_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData);
|
||||||
void CS_DISPLAY_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
void CS_DISPLAY_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
||||||
void CS_DISPLAY_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
void CS_DISPLAY_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
||||||
|
|
||||||
void CS_DISPLAY_SPRITE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData);
|
void CS_DISPLAY_SPRITE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData);
|
||||||
void CS_DISPLAY_SPRITE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
void CS_DISPLAY_SPRITE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
||||||
void CS_DISPLAY_SPRITE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
void CS_DISPLAY_SPRITE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
||||||
|
|
||||||
void CS_DISPLAY_ARMATURE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData);
|
void CS_DISPLAY_ARMATURE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData);
|
||||||
void CS_DISPLAY_ARMATURE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
void CS_DISPLAY_ARMATURE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
||||||
void CS_DISPLAY_ARMATURE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
void CS_DISPLAY_ARMATURE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
||||||
|
|
||||||
void CS_DISPLAY_PARTICLE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData);
|
void CS_DISPLAY_PARTICLE_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData);
|
||||||
void CS_DISPLAY_PARTICLE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
void CS_DISPLAY_PARTICLE_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
||||||
void CS_DISPLAY_PARTICLE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
void CS_DISPLAY_PARTICLE_UPDATE(CCBone *bone, CCDecorativeDisplay *decoDisplay, float dt, bool dirty);
|
||||||
|
|
||||||
void CS_DISPLAY_SHADER_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, DisplayData *displayData);
|
void CS_DISPLAY_SHADER_ADD(CCBone *bone, CCDecorativeDisplay *decoDisplay, CCDisplayData *displayData);
|
||||||
void CS_DISPLAY_SHADER_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
void CS_DISPLAY_SHADER_CREATE(CCBone *bone, CCDecorativeDisplay *decoDisplay);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ bool CCDisplayManager::init(CCBone *bone)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CCDisplayManager::addDisplay(DisplayData *_displayData, int _index)
|
void CCDisplayManager::addDisplay(CCDisplayData *_displayData, int _index)
|
||||||
{
|
{
|
||||||
CCDecorativeDisplay *decoDisplay = NULL;
|
CCDecorativeDisplay *decoDisplay = NULL;
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ CCDecorativeDisplay *CCDisplayManager::getDecorativeDisplayByIndex( int index)
|
||||||
return (CCDecorativeDisplay*)m_pDecoDisplayList->objectAtIndex(index);
|
return (CCDecorativeDisplay*)m_pDecoDisplayList->objectAtIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCDisplayManager::initDisplayList(BoneData *boneData)
|
void CCDisplayManager::initDisplayList(CCBoneData *boneData)
|
||||||
{
|
{
|
||||||
CC_SAFE_DELETE(m_pDecoDisplayList);
|
CC_SAFE_DELETE(m_pDecoDisplayList);
|
||||||
m_pDecoDisplayList = CCArray::create();
|
m_pDecoDisplayList = CCArray::create();
|
||||||
|
@ -223,7 +223,7 @@ void CCDisplayManager::initDisplayList(BoneData *boneData)
|
||||||
CCArray *displayDataList = &boneData->displayDataList;
|
CCArray *displayDataList = &boneData->displayDataList;
|
||||||
CCARRAY_FOREACH(displayDataList, object)
|
CCARRAY_FOREACH(displayDataList, object)
|
||||||
{
|
{
|
||||||
DisplayData *displayData = (DisplayData*)object;
|
CCDisplayData *displayData = (CCDisplayData*)object;
|
||||||
|
|
||||||
CCDecorativeDisplay *decoDisplay = CCDecorativeDisplay::create();
|
CCDecorativeDisplay *decoDisplay = CCDecorativeDisplay::create();
|
||||||
decoDisplay->setDisplayData(displayData);
|
decoDisplay->setDisplayData(displayData);
|
||||||
|
|
|
@ -46,11 +46,11 @@ public:
|
||||||
bool init(CCBone *bone);
|
bool init(CCBone *bone);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use BoneData to init the display list.
|
* Use CCBoneData to init the display list.
|
||||||
* If display is a sprite, and it have texture info in the TexutreData, then use TexutreData to init the display's anchor point
|
* If display is a sprite, and it have texture info in the TexutreData, then use TexutreData to init the display's anchor point
|
||||||
* If the display is a CCArmature, then create a new CCArmature
|
* If the display is a CCArmature, then create a new CCArmature
|
||||||
*/
|
*/
|
||||||
void initDisplayList(BoneData *_boneData);
|
void initDisplayList(CCBoneData *_boneData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add display and use _DisplayData init the display.
|
* Add display and use _DisplayData init the display.
|
||||||
|
@ -58,12 +58,12 @@ public:
|
||||||
* If _index is current display index, then also change display to _index
|
* If _index is current display index, then also change display to _index
|
||||||
*
|
*
|
||||||
* @param displayData it include the display information, like DisplayType.
|
* @param displayData it include the display information, like DisplayType.
|
||||||
* If you want to create a sprite display, then create a SpriteDisplayData param
|
* If you want to create a sprite display, then create a CCSpriteDisplayData param
|
||||||
*
|
*
|
||||||
* @param index the index of the display you want to replace or add to
|
* @param index the index of the display you want to replace or add to
|
||||||
* -1 : append display from back
|
* -1 : append display from back
|
||||||
*/
|
*/
|
||||||
void addDisplay(DisplayData *displayData, int index);
|
void addDisplay(CCDisplayData *displayData, int index);
|
||||||
|
|
||||||
void removeDisplay(int index);
|
void removeDisplay(int index);
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ CCSkin::CCSkin()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCSkin::setSkinData(const Node& var)
|
void CCSkin::setSkinData(const CCBaseData& var)
|
||||||
{
|
{
|
||||||
m_sSkinData = var;
|
m_sSkinData = var;
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ void CCSkin::setSkinData(const Node& var)
|
||||||
m_tSkinTransform = nodeToParentTransform();
|
m_tSkinTransform = nodeToParentTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Node &CCSkin::getSkinData()
|
const CCBaseData &CCSkin::getSkinData()
|
||||||
{
|
{
|
||||||
return m_sSkinData;
|
return m_sSkinData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
void updateTransform();
|
void updateTransform();
|
||||||
void draw();
|
void draw();
|
||||||
|
|
||||||
CC_PROPERTY_PASS_BY_REF(Node, m_sSkinData, SkinData);
|
CC_PROPERTY_PASS_BY_REF(CCBaseData, m_sSkinData, SkinData);
|
||||||
CC_SYNTHESIZE(CCBone*, m_pBone, Bone);
|
CC_SYNTHESIZE(CCBone*, m_pBone, Bone);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -64,7 +64,7 @@ CCColliderDetector::~CCColliderDetector()
|
||||||
{
|
{
|
||||||
ColliderBody *colliderBody = (ColliderBody*)object;
|
ColliderBody *colliderBody = (ColliderBody*)object;
|
||||||
|
|
||||||
ContourData *contourData = colliderBody->getContourData();
|
CCContourData *contourData = colliderBody->getContourData();
|
||||||
b2Body *body = colliderBody->getB2Body();
|
b2Body *body = colliderBody->getB2Body();
|
||||||
CCPhysicsWorld::sharedPhysicsWorld()->getNoGravityWorld()->DestroyBody(body);
|
CCPhysicsWorld::sharedPhysicsWorld()->getNoGravityWorld()->DestroyBody(body);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ bool CCColliderDetector::init(CCBone *bone)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCColliderDetector::addContourData(ContourData *contourData)
|
void CCColliderDetector::addContourData(CCContourData *contourData)
|
||||||
{
|
{
|
||||||
const CCArray *array = &contourData->vertexList;
|
const CCArray *array = &contourData->vertexList;
|
||||||
CCObject *object = NULL;
|
CCObject *object = NULL;
|
||||||
|
@ -101,7 +101,7 @@ void CCColliderDetector::addContourData(ContourData *contourData)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
CCARRAY_FOREACH(array, object)
|
CCARRAY_FOREACH(array, object)
|
||||||
{
|
{
|
||||||
ContourVertex2 *v = (ContourVertex2*)object;
|
CCContourVertex2 *v = (CCContourVertex2*)object;
|
||||||
b2bv[i].Set(v->x/PT_RATIO, v->y/PT_RATIO);
|
b2bv[i].Set(v->x/PT_RATIO, v->y/PT_RATIO);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -134,11 +134,11 @@ void CCColliderDetector::addContourDataList(CCArray *contourDataList)
|
||||||
CCObject *object = NULL;
|
CCObject *object = NULL;
|
||||||
CCARRAY_FOREACH(contourDataList,object)
|
CCARRAY_FOREACH(contourDataList,object)
|
||||||
{
|
{
|
||||||
addContourData((ContourData*)object);
|
addContourData((CCContourData*)object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCColliderDetector::removeContourData(ContourData *_contourData)
|
void CCColliderDetector::removeContourData(CCContourData *_contourData)
|
||||||
{
|
{
|
||||||
m_pColliderBodyList->removeObject(_contourData);
|
m_pColliderBodyList->removeObject(_contourData);
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ void CCColliderDetector::updateTransform(CCAffineTransform &t)
|
||||||
{
|
{
|
||||||
ColliderBody *colliderBody = (ColliderBody*)object;
|
ColliderBody *colliderBody = (ColliderBody*)object;
|
||||||
|
|
||||||
ContourData *contourData = colliderBody->getContourData();
|
CCContourData *contourData = colliderBody->getContourData();
|
||||||
b2Body *body = colliderBody->getB2Body();
|
b2Body *body = colliderBody->getB2Body();
|
||||||
|
|
||||||
b2PolygonShape *shape = (b2PolygonShape *)body->GetFixtureList()->GetShape();
|
b2PolygonShape *shape = (b2PolygonShape *)body->GetFixtureList()->GetShape();
|
||||||
|
@ -188,7 +188,7 @@ void CCColliderDetector::updateTransform(CCAffineTransform &t)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
CCARRAY_FOREACH(array, object)
|
CCARRAY_FOREACH(array, object)
|
||||||
{
|
{
|
||||||
ContourVertex2 *cv = (ContourVertex2*)object;
|
CCContourVertex2 *cv = (CCContourVertex2*)object;
|
||||||
b2Vec2 &bv = shape->m_vertices[i];
|
b2Vec2 &bv = shape->m_vertices[i];
|
||||||
|
|
||||||
helpPoint.setPoint(cv->x, cv->y);
|
helpPoint.setPoint(cv->x, cv->y);
|
||||||
|
|
|
@ -36,7 +36,7 @@ class CCBone;
|
||||||
class ColliderBody : public CCObject
|
class ColliderBody : public CCObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ColliderBody(b2Body *b2b, ContourData *contourData)
|
ColliderBody(b2Body *b2b, CCContourData *contourData)
|
||||||
:m_pB2b(NULL)
|
:m_pB2b(NULL)
|
||||||
,m_pContourData(NULL)
|
,m_pContourData(NULL)
|
||||||
{
|
{
|
||||||
|
@ -55,14 +55,14 @@ public:
|
||||||
return m_pB2b;
|
return m_pB2b;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ContourData *getContourData()
|
inline CCContourData *getContourData()
|
||||||
{
|
{
|
||||||
return m_pContourData;
|
return m_pContourData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
b2Body *m_pB2b;
|
b2Body *m_pB2b;
|
||||||
ContourData *m_pContourData;
|
CCContourData *m_pContourData;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -80,10 +80,10 @@ public:
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
virtual bool init(CCBone *bone);
|
virtual bool init(CCBone *bone);
|
||||||
|
|
||||||
void addContourData(ContourData *contourData);
|
void addContourData(CCContourData *contourData);
|
||||||
void addContourDataList(CCArray *contourDataList);
|
void addContourDataList(CCArray *contourDataList);
|
||||||
|
|
||||||
void removeContourData(ContourData *contourData);
|
void removeContourData(CCContourData *contourData);
|
||||||
void removeAll();
|
void removeAll();
|
||||||
|
|
||||||
void updateTransform(CCAffineTransform &t);
|
void updateTransform(CCAffineTransform &t);
|
||||||
|
|
|
@ -96,7 +96,7 @@ bool CCArmatureDataManager::init()
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCArmatureDataManager::addArmatureData(const char *id, ArmatureData *armatureData)
|
void CCArmatureDataManager::addArmatureData(const char *id, CCArmatureData *armatureData)
|
||||||
{
|
{
|
||||||
if(m_pArmarureDatas)
|
if(m_pArmarureDatas)
|
||||||
{
|
{
|
||||||
|
@ -104,17 +104,17 @@ void CCArmatureDataManager::addArmatureData(const char *id, ArmatureData *armatu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArmatureData *CCArmatureDataManager::getArmatureData(const char* id)
|
CCArmatureData *CCArmatureDataManager::getArmatureData(const char* id)
|
||||||
{
|
{
|
||||||
ArmatureData * armatureData = NULL;
|
CCArmatureData * armatureData = NULL;
|
||||||
if (m_pArmarureDatas)
|
if (m_pArmarureDatas)
|
||||||
{
|
{
|
||||||
armatureData = (ArmatureData*)m_pArmarureDatas->objectForKey(id);
|
armatureData = (CCArmatureData*)m_pArmarureDatas->objectForKey(id);
|
||||||
}
|
}
|
||||||
return armatureData;
|
return armatureData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCArmatureDataManager::addAnimationData(const char *id, AnimationData *animationData)
|
void CCArmatureDataManager::addAnimationData(const char *id, CCAnimationData *animationData)
|
||||||
{
|
{
|
||||||
if(m_pAnimationDatas)
|
if(m_pAnimationDatas)
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@ void CCArmatureDataManager::addAnimationData(const char *id, AnimationData *anim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCArmatureDataManager::addTextureData(const char *id, TextureData *textureData)
|
void CCArmatureDataManager::addTextureData(const char *id, CCTextureData *textureData)
|
||||||
{
|
{
|
||||||
if(m_pTextureDatas)
|
if(m_pTextureDatas)
|
||||||
{
|
{
|
||||||
|
@ -130,22 +130,22 @@ void CCArmatureDataManager::addTextureData(const char *id, TextureData *textureD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimationData* CCArmatureDataManager::getAnimationData(const char* id)
|
CCAnimationData* CCArmatureDataManager::getAnimationData(const char* id)
|
||||||
{
|
{
|
||||||
AnimationData *animationData = NULL;
|
CCAnimationData *animationData = NULL;
|
||||||
if (m_pAnimationDatas)
|
if (m_pAnimationDatas)
|
||||||
{
|
{
|
||||||
animationData = (AnimationData*)m_pAnimationDatas->objectForKey(id);
|
animationData = (CCAnimationData*)m_pAnimationDatas->objectForKey(id);
|
||||||
}
|
}
|
||||||
return animationData;
|
return animationData;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureData *CCArmatureDataManager::getTextureData(const char* id)
|
CCTextureData *CCArmatureDataManager::getTextureData(const char* id)
|
||||||
{
|
{
|
||||||
TextureData *textureData = NULL;
|
CCTextureData *textureData = NULL;
|
||||||
if (m_pTextureDatas)
|
if (m_pTextureDatas)
|
||||||
{
|
{
|
||||||
textureData = (TextureData*)m_pTextureDatas->objectForKey(id);
|
textureData = (CCTextureData*)m_pTextureDatas->objectForKey(id);
|
||||||
}
|
}
|
||||||
return textureData;
|
return textureData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,54 +54,54 @@ public:
|
||||||
/**
|
/**
|
||||||
* Add armature data
|
* Add armature data
|
||||||
* @param id The id of the armature data
|
* @param id The id of the armature data
|
||||||
* @param armatureData ArmatureData *
|
* @param armatureData CCArmatureData *
|
||||||
*/
|
*/
|
||||||
void addArmatureData(const char *id, ArmatureData *armatureData);
|
void addArmatureData(const char *id, CCArmatureData *armatureData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get armature data
|
* @brief get armature data
|
||||||
*
|
*
|
||||||
* @param id the id of the armature data you want to get
|
* @param id the id of the armature data you want to get
|
||||||
*
|
*
|
||||||
* @return ArmatureData *
|
* @return CCArmatureData *
|
||||||
*/
|
*/
|
||||||
ArmatureData *getArmatureData(const char *id);
|
CCArmatureData *getArmatureData(const char *id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief add animation data
|
* @brief add animation data
|
||||||
*
|
*
|
||||||
* @param id the id of the animation data
|
* @param id the id of the animation data
|
||||||
*
|
*
|
||||||
* @return AnimationData *
|
* @return CCAnimationData *
|
||||||
*/
|
*/
|
||||||
void addAnimationData(const char *id, AnimationData *animationData);
|
void addAnimationData(const char *id, CCAnimationData *animationData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get animation data from m_pAnimationDatas(CCDictionary)
|
* @brief get animation data from m_pAnimationDatas(CCDictionary)
|
||||||
*
|
*
|
||||||
* @param id the id of the animation data you want to get
|
* @param id the id of the animation data you want to get
|
||||||
*
|
*
|
||||||
* @return AnimationData *
|
* @return CCAnimationData *
|
||||||
*/
|
*/
|
||||||
AnimationData *getAnimationData(const char *id);
|
CCAnimationData *getAnimationData(const char *id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief add texture data
|
* @brief add texture data
|
||||||
*
|
*
|
||||||
* @param id the id of the texture data
|
* @param id the id of the texture data
|
||||||
*
|
*
|
||||||
* @return TextureData *
|
* @return CCTextureData *
|
||||||
*/
|
*/
|
||||||
void addTextureData(const char *id, TextureData *textureData);
|
void addTextureData(const char *id, CCTextureData *textureData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get texture data
|
* @brief get texture data
|
||||||
*
|
*
|
||||||
* @param _id the id of the texture data you want to get
|
* @param _id the id of the texture data you want to get
|
||||||
*
|
*
|
||||||
* @return TextureData *
|
* @return CCTextureData *
|
||||||
*/
|
*/
|
||||||
TextureData *getTextureData(const char *id);
|
CCTextureData *getTextureData(const char *id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add ArmatureFileInfo, it is managed by CCArmatureDataManager.
|
* @brief Add ArmatureFileInfo, it is managed by CCArmatureDataManager.
|
||||||
|
@ -128,21 +128,21 @@ private:
|
||||||
/**
|
/**
|
||||||
* @brief save amature datas
|
* @brief save amature datas
|
||||||
* @key std::string
|
* @key std::string
|
||||||
* @value ArmatureData *
|
* @value CCArmatureData *
|
||||||
*/
|
*/
|
||||||
CC_SYNTHESIZE_READONLY(CCDictionary *, m_pArmarureDatas, ArmarureDatas);
|
CC_SYNTHESIZE_READONLY(CCDictionary *, m_pArmarureDatas, ArmarureDatas);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief save animation datas
|
* @brief save animation datas
|
||||||
* @key std::string
|
* @key std::string
|
||||||
* @value AnimationData *
|
* @value CCAnimationData *
|
||||||
*/
|
*/
|
||||||
CC_SYNTHESIZE_READONLY(CCDictionary *, m_pAnimationDatas, AnimationDatas);
|
CC_SYNTHESIZE_READONLY(CCDictionary *, m_pAnimationDatas, AnimationDatas);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief save texture datas
|
* @brief save texture datas
|
||||||
* @key std::string
|
* @key std::string
|
||||||
* @value TextureData *
|
* @value CCTextureData *
|
||||||
*/
|
*/
|
||||||
CC_SYNTHESIZE_READONLY(CCDictionary *, m_pTextureDatas, TextureDatas);
|
CC_SYNTHESIZE_READONLY(CCDictionary *, m_pTextureDatas, TextureDatas);
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ void CCDataReaderHelper::addDataFromCache(const char *_pFileContent)
|
||||||
tinyxml2::XMLElement *armatureXML = armaturesXML->FirstChildElement(ARMATURE);
|
tinyxml2::XMLElement *armatureXML = armaturesXML->FirstChildElement(ARMATURE);
|
||||||
while(armatureXML)
|
while(armatureXML)
|
||||||
{
|
{
|
||||||
ArmatureData *armatureData = CCDataReaderHelper::decodeArmature(armatureXML);
|
CCArmatureData *armatureData = CCDataReaderHelper::decodeArmature(armatureXML);
|
||||||
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureData(armatureData->name.c_str(), armatureData);
|
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureData(armatureData->name.c_str(), armatureData);
|
||||||
|
|
||||||
armatureXML = armatureXML->NextSiblingElement(ARMATURE);
|
armatureXML = armatureXML->NextSiblingElement(ARMATURE);
|
||||||
|
@ -147,7 +147,7 @@ void CCDataReaderHelper::addDataFromCache(const char *_pFileContent)
|
||||||
tinyxml2::XMLElement *animationXML = animationsXML->FirstChildElement(ANIMATION);
|
tinyxml2::XMLElement *animationXML = animationsXML->FirstChildElement(ANIMATION);
|
||||||
while(animationXML)
|
while(animationXML)
|
||||||
{
|
{
|
||||||
AnimationData *animationData = CCDataReaderHelper::decodeAnimation(animationXML);
|
CCAnimationData *animationData = CCDataReaderHelper::decodeAnimation(animationXML);
|
||||||
CCArmatureDataManager::sharedArmatureDataManager()->addAnimationData(animationData->name.c_str(), animationData);
|
CCArmatureDataManager::sharedArmatureDataManager()->addAnimationData(animationData->name.c_str(), animationData);
|
||||||
|
|
||||||
animationXML = animationXML->NextSiblingElement(ANIMATION);
|
animationXML = animationXML->NextSiblingElement(ANIMATION);
|
||||||
|
@ -160,7 +160,7 @@ void CCDataReaderHelper::addDataFromCache(const char *_pFileContent)
|
||||||
tinyxml2::XMLElement *textureXML = texturesXML->FirstChildElement(SUB_TEXTURE);
|
tinyxml2::XMLElement *textureXML = texturesXML->FirstChildElement(SUB_TEXTURE);
|
||||||
while(textureXML)
|
while(textureXML)
|
||||||
{
|
{
|
||||||
TextureData *textureData = CCDataReaderHelper::decodeTexture(textureXML);
|
CCTextureData *textureData = CCDataReaderHelper::decodeTexture(textureXML);
|
||||||
CCArmatureDataManager::sharedArmatureDataManager()->addTextureData(textureData->name.c_str(), textureData);
|
CCArmatureDataManager::sharedArmatureDataManager()->addTextureData(textureData->name.c_str(), textureData);
|
||||||
|
|
||||||
textureXML = textureXML->NextSiblingElement(SUB_TEXTURE);
|
textureXML = textureXML->NextSiblingElement(SUB_TEXTURE);
|
||||||
|
@ -168,12 +168,12 @@ void CCDataReaderHelper::addDataFromCache(const char *_pFileContent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ArmatureData *CCDataReaderHelper::decodeArmature(tinyxml2::XMLElement *armatureXML)
|
CCArmatureData *CCDataReaderHelper::decodeArmature(tinyxml2::XMLElement *armatureXML)
|
||||||
{
|
{
|
||||||
const char* name = armatureXML->Attribute(A_NAME);
|
const char* name = armatureXML->Attribute(A_NAME);
|
||||||
|
|
||||||
|
|
||||||
ArmatureData *armatureData = ArmatureData::create();
|
CCArmatureData *armatureData = CCArmatureData::create();
|
||||||
armatureData->name = name;
|
armatureData->name = name;
|
||||||
|
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ ArmatureData *CCDataReaderHelper::decodeArmature(tinyxml2::XMLElement *armatureX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BoneData *boneData = decodeBone(boneXML, parentXML);
|
CCBoneData *boneData = decodeBone(boneXML, parentXML);
|
||||||
armatureData->addBoneData(boneData);
|
armatureData->addBoneData(boneData);
|
||||||
|
|
||||||
boneXML = boneXML->NextSiblingElement(BONE);
|
boneXML = boneXML->NextSiblingElement(BONE);
|
||||||
|
@ -209,7 +209,7 @@ ArmatureData *CCDataReaderHelper::decodeArmature(tinyxml2::XMLElement *armatureX
|
||||||
return armatureData;
|
return armatureData;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoneData *CCDataReaderHelper::decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXml)
|
CCBoneData *CCDataReaderHelper::decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXml)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string name = boneXML->Attribute(A_NAME);
|
std::string name = boneXML->Attribute(A_NAME);
|
||||||
|
@ -217,7 +217,7 @@ BoneData *CCDataReaderHelper::decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2
|
||||||
CCAssert(name.compare("") != 0, "");
|
CCAssert(name.compare("") != 0, "");
|
||||||
|
|
||||||
|
|
||||||
BoneData *boneData = BoneData::create();
|
CCBoneData *boneData = CCBoneData::create();
|
||||||
|
|
||||||
boneData->name = name;
|
boneData->name = name;
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ BoneData *CCDataReaderHelper::decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2
|
||||||
// /*
|
// /*
|
||||||
// * recalculate bone data from parent bone data, use for translate matrix
|
// * recalculate bone data from parent bone data, use for translate matrix
|
||||||
// */
|
// */
|
||||||
// Node _helpNode;
|
// CCBaseData _helpNode;
|
||||||
// parentXml->QueryFloatAttribute(A_X, &_helpNode.x);
|
// parentXml->QueryFloatAttribute(A_X, &_helpNode.x);
|
||||||
// parentXml->QueryFloatAttribute(A_Y, &_helpNode.y);
|
// parentXml->QueryFloatAttribute(A_Y, &_helpNode.y);
|
||||||
// parentXml->QueryFloatAttribute(A_SKEW_X, &_helpNode.skewX);
|
// parentXml->QueryFloatAttribute(A_SKEW_X, &_helpNode.skewX);
|
||||||
|
@ -279,7 +279,7 @@ BoneData *CCDataReaderHelper::decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2
|
||||||
tinyxml2::XMLElement *displayXML = boneXML->FirstChildElement(DISPLAY);
|
tinyxml2::XMLElement *displayXML = boneXML->FirstChildElement(DISPLAY);
|
||||||
while(displayXML)
|
while(displayXML)
|
||||||
{
|
{
|
||||||
DisplayData *displayData = decodeBoneDisplay(displayXML);
|
CCDisplayData *displayData = decodeBoneDisplay(displayXML);
|
||||||
boneData->addDisplayData(displayData);
|
boneData->addDisplayData(displayData);
|
||||||
|
|
||||||
displayXML = displayXML->NextSiblingElement(DISPLAY);
|
displayXML = displayXML->NextSiblingElement(DISPLAY);
|
||||||
|
@ -289,28 +289,28 @@ BoneData *CCDataReaderHelper::decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2
|
||||||
return boneData;
|
return boneData;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayData *CCDataReaderHelper::decodeBoneDisplay(tinyxml2::XMLElement *displayXML)
|
CCDisplayData *CCDataReaderHelper::decodeBoneDisplay(tinyxml2::XMLElement *displayXML)
|
||||||
{
|
{
|
||||||
int _isArmature = 0;
|
int _isArmature = 0;
|
||||||
|
|
||||||
DisplayData *displayData;
|
CCDisplayData *displayData;
|
||||||
|
|
||||||
|
|
||||||
if( displayXML->QueryIntAttribute(A_IS_ARMATURE, &(_isArmature)) == tinyxml2::XML_SUCCESS )
|
if( displayXML->QueryIntAttribute(A_IS_ARMATURE, &(_isArmature)) == tinyxml2::XML_SUCCESS )
|
||||||
{
|
{
|
||||||
if(!_isArmature)
|
if(!_isArmature)
|
||||||
{
|
{
|
||||||
displayData = SpriteDisplayData::create();
|
displayData = CCSpriteDisplayData::create();
|
||||||
displayData->displayType = CS_DISPLAY_SPRITE;
|
displayData->displayType = CS_DISPLAY_SPRITE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displayData = ArmatureDisplayData::create();
|
displayData = CCArmatureDisplayData::create();
|
||||||
displayData->displayType = CS_DISPLAY_ARMATURE;
|
displayData->displayType = CS_DISPLAY_ARMATURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
displayData = SpriteDisplayData::create();
|
displayData = CCSpriteDisplayData::create();
|
||||||
displayData->displayType = CS_DISPLAY_SPRITE;
|
displayData->displayType = CS_DISPLAY_SPRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,11 +318,11 @@ DisplayData *CCDataReaderHelper::decodeBoneDisplay(tinyxml2::XMLElement *display
|
||||||
{
|
{
|
||||||
if(!_isArmature)
|
if(!_isArmature)
|
||||||
{
|
{
|
||||||
((SpriteDisplayData*)displayData)->displayName = displayXML->Attribute(A_NAME);
|
((CCSpriteDisplayData*)displayData)->displayName = displayXML->Attribute(A_NAME);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
((ArmatureDisplayData*)displayData)->displayName = displayXML->Attribute(A_NAME);
|
((CCArmatureDisplayData*)displayData)->displayName = displayXML->Attribute(A_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -331,14 +331,14 @@ DisplayData *CCDataReaderHelper::decodeBoneDisplay(tinyxml2::XMLElement *display
|
||||||
return displayData;
|
return displayData;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimationData *CCDataReaderHelper::decodeAnimation(tinyxml2::XMLElement *animationXML)
|
CCAnimationData *CCDataReaderHelper::decodeAnimation(tinyxml2::XMLElement *animationXML)
|
||||||
{
|
{
|
||||||
const char* name = animationXML->Attribute(A_NAME);
|
const char* name = animationXML->Attribute(A_NAME);
|
||||||
|
|
||||||
|
|
||||||
AnimationData *aniData = AnimationData::create();
|
CCAnimationData *aniData = CCAnimationData::create();
|
||||||
|
|
||||||
ArmatureData *armatureData = CCArmatureDataManager::sharedArmatureDataManager()->getArmatureData(name);
|
CCArmatureData *armatureData = CCArmatureDataManager::sharedArmatureDataManager()->getArmatureData(name);
|
||||||
|
|
||||||
aniData->name = name;
|
aniData->name = name;
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ AnimationData *CCDataReaderHelper::decodeAnimation(tinyxml2::XMLElement *animati
|
||||||
|
|
||||||
while( movementXML )
|
while( movementXML )
|
||||||
{
|
{
|
||||||
MovementData *movementData = decodeMovement(movementXML, armatureData);
|
CCMovementData *movementData = decodeMovement(movementXML, armatureData);
|
||||||
aniData->addMovement(movementData);
|
aniData->addMovement(movementData);
|
||||||
|
|
||||||
movementXML = movementXML->NextSiblingElement(MOVEMENT);
|
movementXML = movementXML->NextSiblingElement(MOVEMENT);
|
||||||
|
@ -356,11 +356,11 @@ AnimationData *CCDataReaderHelper::decodeAnimation(tinyxml2::XMLElement *animati
|
||||||
return aniData;
|
return aniData;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementData *CCDataReaderHelper::decodeMovement(tinyxml2::XMLElement *movementXML, ArmatureData *armatureData)
|
CCMovementData *CCDataReaderHelper::decodeMovement(tinyxml2::XMLElement *movementXML, CCArmatureData *armatureData)
|
||||||
{
|
{
|
||||||
const char* _movName = movementXML->Attribute(A_NAME);
|
const char* _movName = movementXML->Attribute(A_NAME);
|
||||||
|
|
||||||
MovementData *movementData = MovementData::create();
|
CCMovementData *movementData = CCMovementData::create();
|
||||||
|
|
||||||
movementData->name = _movName;
|
movementData->name = _movName;
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ MovementData *CCDataReaderHelper::decodeMovement(tinyxml2::XMLElement *movementX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BoneData *boneData = (BoneData*)armatureData->getBoneData(_boneName);
|
CCBoneData *boneData = (CCBoneData*)armatureData->getBoneData(_boneName);
|
||||||
|
|
||||||
std::string _parentName = boneData->parentName;
|
std::string _parentName = boneData->parentName;
|
||||||
|
|
||||||
|
@ -431,7 +431,7 @@ MovementData *CCDataReaderHelper::decodeMovement(tinyxml2::XMLElement *movementX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementBoneData *_moveBoneData = decodeMovementBone(movBoneXml, parentXml, boneData);
|
CCMovementBoneData *_moveBoneData = decodeMovementBone(movBoneXml, parentXml, boneData);
|
||||||
movementData->addMovementBoneData(_moveBoneData);
|
movementData->addMovementBoneData(_moveBoneData);
|
||||||
|
|
||||||
movBoneXml = movBoneXml->NextSiblingElement(BONE);
|
movBoneXml = movBoneXml->NextSiblingElement(BONE);
|
||||||
|
@ -441,9 +441,9 @@ MovementData *CCDataReaderHelper::decodeMovement(tinyxml2::XMLElement *movementX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MovementBoneData *CCDataReaderHelper::decodeMovementBone(tinyxml2::XMLElement* movBoneXml, tinyxml2::XMLElement* parentXml, BoneData *boneData)
|
CCMovementBoneData *CCDataReaderHelper::decodeMovementBone(tinyxml2::XMLElement* movBoneXml, tinyxml2::XMLElement* parentXml, CCBoneData *boneData)
|
||||||
{
|
{
|
||||||
MovementBoneData* movBoneData = MovementBoneData::create();
|
CCMovementBoneData* movBoneData = CCMovementBoneData::create();
|
||||||
float _scale, _delay;
|
float _scale, _delay;
|
||||||
|
|
||||||
if( movBoneXml )
|
if( movBoneXml )
|
||||||
|
@ -514,7 +514,7 @@ MovementBoneData *CCDataReaderHelper::decodeMovementBone(tinyxml2::XMLElement* m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameData * _frameData = decodeFrame( frameXML, parentFrameXML, boneData);
|
CCFrameData * _frameData = decodeFrame( frameXML, parentFrameXML, boneData);
|
||||||
movBoneData->addFrameData(_frameData);
|
movBoneData->addFrameData(_frameData);
|
||||||
|
|
||||||
_totalDuration += _frameData->duration;
|
_totalDuration += _frameData->duration;
|
||||||
|
@ -526,12 +526,12 @@ MovementBoneData *CCDataReaderHelper::decodeMovementBone(tinyxml2::XMLElement* m
|
||||||
return movBoneData;
|
return movBoneData;
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameData * CCDataReaderHelper::decodeFrame(tinyxml2::XMLElement* frameXML, tinyxml2::XMLElement* parentFrameXml, BoneData *boneData)
|
CCFrameData * CCDataReaderHelper::decodeFrame(tinyxml2::XMLElement* frameXML, tinyxml2::XMLElement* parentFrameXml, CCBoneData *boneData)
|
||||||
{
|
{
|
||||||
float _x, _y, _scale_x, _scale_y, _skew_x, _skew_y = 0;
|
float _x, _y, _scale_x, _scale_y, _skew_x, _skew_y = 0;
|
||||||
int _duration, _displayIndex, _zOrder, _tweenEasing = 0;
|
int _duration, _displayIndex, _zOrder, _tweenEasing = 0;
|
||||||
|
|
||||||
FrameData* frameData = FrameData::create();
|
CCFrameData* frameData = CCFrameData::create();
|
||||||
|
|
||||||
|
|
||||||
if(frameXML->Attribute(A_MOVEMENT) != NULL)
|
if(frameXML->Attribute(A_MOVEMENT) != NULL)
|
||||||
|
@ -655,7 +655,7 @@ FrameData * CCDataReaderHelper::decodeFrame(tinyxml2::XMLElement* frameXML, tin
|
||||||
/*
|
/*
|
||||||
* recalculate frame data from parent frame data, use for translate matrix
|
* recalculate frame data from parent frame data, use for translate matrix
|
||||||
*/
|
*/
|
||||||
Node _helpNode;
|
CCBaseData _helpNode;
|
||||||
if (s_FlashToolVersion >= VERSION_2_0)
|
if (s_FlashToolVersion >= VERSION_2_0)
|
||||||
{
|
{
|
||||||
parentFrameXml->QueryFloatAttribute(A_COCOS2DX_X, &_helpNode.x);
|
parentFrameXml->QueryFloatAttribute(A_COCOS2DX_X, &_helpNode.x);
|
||||||
|
@ -687,9 +687,9 @@ FrameData * CCDataReaderHelper::decodeFrame(tinyxml2::XMLElement* frameXML, tin
|
||||||
return frameData;
|
return frameData;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureData *CCDataReaderHelper::decodeTexture(tinyxml2::XMLElement *textureXML)
|
CCTextureData *CCDataReaderHelper::decodeTexture(tinyxml2::XMLElement *textureXML)
|
||||||
{
|
{
|
||||||
TextureData *textureData = TextureData::create();
|
CCTextureData *textureData = CCTextureData::create();
|
||||||
|
|
||||||
if( textureXML->Attribute(A_NAME) != NULL)
|
if( textureXML->Attribute(A_NAME) != NULL)
|
||||||
{
|
{
|
||||||
|
@ -723,7 +723,7 @@ TextureData *CCDataReaderHelper::decodeTexture(tinyxml2::XMLElement *textureXML)
|
||||||
|
|
||||||
while (contourXML) {
|
while (contourXML) {
|
||||||
|
|
||||||
ContourData *contourData = decodeContour(contourXML);
|
CCContourData *contourData = decodeContour(contourXML);
|
||||||
textureData->addContourData(contourData);
|
textureData->addContourData(contourData);
|
||||||
|
|
||||||
contourXML = contourXML->NextSiblingElement(CONTOUR);
|
contourXML = contourXML->NextSiblingElement(CONTOUR);
|
||||||
|
@ -733,15 +733,15 @@ TextureData *CCDataReaderHelper::decodeTexture(tinyxml2::XMLElement *textureXML)
|
||||||
return textureData;
|
return textureData;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContourData *CCDataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML)
|
CCContourData *CCDataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML)
|
||||||
{
|
{
|
||||||
ContourData *contourData = ContourData::create();
|
CCContourData *contourData = CCContourData::create();
|
||||||
|
|
||||||
tinyxml2::XMLElement *vertexDataXML = contourXML->FirstChildElement(CONTOUR_VERTEX);
|
tinyxml2::XMLElement *vertexDataXML = contourXML->FirstChildElement(CONTOUR_VERTEX);
|
||||||
|
|
||||||
while (vertexDataXML) {
|
while (vertexDataXML) {
|
||||||
|
|
||||||
ContourVertex2 *vertex = new ContourVertex2(0, 0);
|
CCContourVertex2 *vertex = new CCContourVertex2(0, 0);
|
||||||
vertex->autorelease();
|
vertex->autorelease();
|
||||||
|
|
||||||
vertexDataXML->QueryFloatAttribute(A_X, &vertex->x);
|
vertexDataXML->QueryFloatAttribute(A_X, &vertex->x);
|
||||||
|
@ -782,7 +782,7 @@ void CCDataReaderHelper::addDataFromJsonCache(const char *fileContent)
|
||||||
for (int i = 0; i<length; i++)
|
for (int i = 0; i<length; i++)
|
||||||
{
|
{
|
||||||
cs::CSJsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i);
|
cs::CSJsonDictionary *armatureDic = json.getSubItemFromArray(ARMATURE_DATA, i);
|
||||||
ArmatureData *armatureData = decodeArmature(*armatureDic);
|
CCArmatureData *armatureData = decodeArmature(*armatureDic);
|
||||||
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureData(armatureData->name.c_str(), armatureData);
|
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureData(armatureData->name.c_str(), armatureData);
|
||||||
|
|
||||||
delete armatureDic;
|
delete armatureDic;
|
||||||
|
@ -793,7 +793,7 @@ void CCDataReaderHelper::addDataFromJsonCache(const char *fileContent)
|
||||||
for (int i = 0; i<length; i++)
|
for (int i = 0; i<length; i++)
|
||||||
{
|
{
|
||||||
cs::CSJsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i);
|
cs::CSJsonDictionary *animationDic = json.getSubItemFromArray(ANIMATION_DATA, i);
|
||||||
AnimationData *animationData = decodeAnimation(*animationDic);
|
CCAnimationData *animationData = decodeAnimation(*animationDic);
|
||||||
CCArmatureDataManager::sharedArmatureDataManager()->addAnimationData(animationData->name.c_str(), animationData);
|
CCArmatureDataManager::sharedArmatureDataManager()->addAnimationData(animationData->name.c_str(), animationData);
|
||||||
|
|
||||||
delete animationDic;
|
delete animationDic;
|
||||||
|
@ -804,16 +804,16 @@ void CCDataReaderHelper::addDataFromJsonCache(const char *fileContent)
|
||||||
for (int i = 0; i<length; i++)
|
for (int i = 0; i<length; i++)
|
||||||
{
|
{
|
||||||
cs::CSJsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i);
|
cs::CSJsonDictionary *textureDic = json.getSubItemFromArray(TEXTURE_DATA, i);
|
||||||
TextureData *textureData = decodeTexture(*textureDic);
|
CCTextureData *textureData = decodeTexture(*textureDic);
|
||||||
CCArmatureDataManager::sharedArmatureDataManager()->addTextureData(textureData->name.c_str(), textureData);
|
CCArmatureDataManager::sharedArmatureDataManager()->addTextureData(textureData->name.c_str(), textureData);
|
||||||
|
|
||||||
delete textureDic;
|
delete textureDic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArmatureData *CCDataReaderHelper::decodeArmature(cs::CSJsonDictionary &json)
|
CCArmatureData *CCDataReaderHelper::decodeArmature(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
ArmatureData *armatureData = ArmatureData::create();
|
CCArmatureData *armatureData = CCArmatureData::create();
|
||||||
|
|
||||||
const char * name = json.getItemStringValue(A_NAME);
|
const char * name = json.getItemStringValue(A_NAME);
|
||||||
if(name != NULL)
|
if(name != NULL)
|
||||||
|
@ -833,9 +833,9 @@ ArmatureData *CCDataReaderHelper::decodeArmature(cs::CSJsonDictionary &json)
|
||||||
return armatureData;
|
return armatureData;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoneData *CCDataReaderHelper::decodeBone(cs::CSJsonDictionary &json)
|
CCBoneData *CCDataReaderHelper::decodeBone(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
BoneData *boneData = BoneData::create();
|
CCBoneData *boneData = CCBoneData::create();
|
||||||
|
|
||||||
DecodeNode(boneData, json);
|
DecodeNode(boneData, json);
|
||||||
|
|
||||||
|
@ -864,63 +864,63 @@ BoneData *CCDataReaderHelper::decodeBone(cs::CSJsonDictionary &json)
|
||||||
return boneData;
|
return boneData;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayData *CCDataReaderHelper::decodeBoneDisplay(cs::CSJsonDictionary &json)
|
CCDisplayData *CCDataReaderHelper::decodeBoneDisplay(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
DisplayType displayType = (DisplayType)json.getItemIntValue(A_DISPLAY_TYPE, CS_DISPLAY_SPRITE);
|
DisplayType displayType = (DisplayType)json.getItemIntValue(A_DISPLAY_TYPE, CS_DISPLAY_SPRITE);
|
||||||
|
|
||||||
DisplayData *displayData = NULL;
|
CCDisplayData *displayData = NULL;
|
||||||
|
|
||||||
switch (displayType) {
|
switch (displayType) {
|
||||||
case CS_DISPLAY_SPRITE:
|
case CS_DISPLAY_SPRITE:
|
||||||
{
|
{
|
||||||
displayData = SpriteDisplayData::create();
|
displayData = CCSpriteDisplayData::create();
|
||||||
const char *name = json.getItemStringValue(A_NAME);
|
const char *name = json.getItemStringValue(A_NAME);
|
||||||
if(name != NULL)
|
if(name != NULL)
|
||||||
{
|
{
|
||||||
((SpriteDisplayData*)displayData)->displayName = name;
|
((CCSpriteDisplayData*)displayData)->displayName = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case CS_DISPLAY_ARMATURE:
|
case CS_DISPLAY_ARMATURE:
|
||||||
{
|
{
|
||||||
displayData = ArmatureDisplayData::create();
|
displayData = CCArmatureDisplayData::create();
|
||||||
const char *name = json.getItemStringValue(A_NAME);
|
const char *name = json.getItemStringValue(A_NAME);
|
||||||
if(name != NULL)
|
if(name != NULL)
|
||||||
{
|
{
|
||||||
((ArmatureDisplayData*)displayData)->displayName = name;
|
((CCArmatureDisplayData*)displayData)->displayName = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CS_DISPLAY_PARTICLE:
|
case CS_DISPLAY_PARTICLE:
|
||||||
{
|
{
|
||||||
displayData = ParticleDisplayData::create();
|
displayData = CCParticleDisplayData::create();
|
||||||
const char *plist = json.getItemStringValue(A_PLIST);
|
const char *plist = json.getItemStringValue(A_PLIST);
|
||||||
if(plist != NULL)
|
if(plist != NULL)
|
||||||
{
|
{
|
||||||
((ParticleDisplayData*)displayData)->plist = plist;
|
((CCParticleDisplayData*)displayData)->plist = plist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CS_DISPLAY_SHADER:
|
case CS_DISPLAY_SHADER:
|
||||||
{
|
{
|
||||||
displayData = ShaderDisplayData::create();
|
displayData = CCShaderDisplayData::create();
|
||||||
const char *vert = json.getItemStringValue(A_VERT);
|
const char *vert = json.getItemStringValue(A_VERT);
|
||||||
if(vert != NULL)
|
if(vert != NULL)
|
||||||
{
|
{
|
||||||
((ShaderDisplayData*)displayData)->vert = vert;
|
((CCShaderDisplayData*)displayData)->vert = vert;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *frag = json.getItemStringValue(A_FRAG);
|
const char *frag = json.getItemStringValue(A_FRAG);
|
||||||
if(frag != NULL)
|
if(frag != NULL)
|
||||||
{
|
{
|
||||||
((ShaderDisplayData*)displayData)->frag = vert;
|
((CCShaderDisplayData*)displayData)->frag = vert;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
displayData = SpriteDisplayData::create();
|
displayData = CCSpriteDisplayData::create();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -929,9 +929,9 @@ DisplayData *CCDataReaderHelper::decodeBoneDisplay(cs::CSJsonDictionary &json)
|
||||||
return displayData;
|
return displayData;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimationData *CCDataReaderHelper::decodeAnimation(cs::CSJsonDictionary &json)
|
CCAnimationData *CCDataReaderHelper::decodeAnimation(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
AnimationData *aniData = AnimationData::create();
|
CCAnimationData *aniData = CCAnimationData::create();
|
||||||
|
|
||||||
const char * name = json.getItemStringValue(A_NAME);
|
const char * name = json.getItemStringValue(A_NAME);
|
||||||
if(name != NULL)
|
if(name != NULL)
|
||||||
|
@ -952,9 +952,9 @@ AnimationData *CCDataReaderHelper::decodeAnimation(cs::CSJsonDictionary &json)
|
||||||
return aniData;
|
return aniData;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementData *CCDataReaderHelper::decodeMovement(cs::CSJsonDictionary &json)
|
CCMovementData *CCDataReaderHelper::decodeMovement(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
MovementData *movementData = MovementData::create();
|
CCMovementData *movementData = CCMovementData::create();
|
||||||
|
|
||||||
movementData->loop = json.getItemBoolvalue(A_LOOP, true);
|
movementData->loop = json.getItemBoolvalue(A_LOOP, true);
|
||||||
movementData->durationTween = json.getItemIntValue(A_DURATION_TWEEN, 0);
|
movementData->durationTween = json.getItemIntValue(A_DURATION_TWEEN, 0);
|
||||||
|
@ -980,9 +980,9 @@ MovementData *CCDataReaderHelper::decodeMovement(cs::CSJsonDictionary &json)
|
||||||
return movementData;
|
return movementData;
|
||||||
}
|
}
|
||||||
|
|
||||||
MovementBoneData *CCDataReaderHelper::decodeMovementBone(cs::CSJsonDictionary &json)
|
CCMovementBoneData *CCDataReaderHelper::decodeMovementBone(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
MovementBoneData *movementBoneData = MovementBoneData::create();
|
CCMovementBoneData *movementBoneData = CCMovementBoneData::create();
|
||||||
|
|
||||||
movementBoneData->delay = json.getItemFloatValue(A_MOVEMENT_DELAY, 0);
|
movementBoneData->delay = json.getItemFloatValue(A_MOVEMENT_DELAY, 0);
|
||||||
movementBoneData->scale = json.getItemFloatValue(A_MOVEMENT_SCALE, 1);
|
movementBoneData->scale = json.getItemFloatValue(A_MOVEMENT_SCALE, 1);
|
||||||
|
@ -997,7 +997,7 @@ MovementBoneData *CCDataReaderHelper::decodeMovementBone(cs::CSJsonDictionary &j
|
||||||
for (int i = 0; i<length; i++)
|
for (int i = 0; i<length; i++)
|
||||||
{
|
{
|
||||||
cs::CSJsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i);
|
cs::CSJsonDictionary *dic = json.getSubItemFromArray(FRAME_DATA, i);
|
||||||
FrameData *frameData = decodeFrame(*dic);
|
CCFrameData *frameData = decodeFrame(*dic);
|
||||||
movementBoneData->addFrameData(frameData);
|
movementBoneData->addFrameData(frameData);
|
||||||
//movementBoneData->duration += frameData->duration;
|
//movementBoneData->duration += frameData->duration;
|
||||||
|
|
||||||
|
@ -1007,9 +1007,9 @@ MovementBoneData *CCDataReaderHelper::decodeMovementBone(cs::CSJsonDictionary &j
|
||||||
return movementBoneData;
|
return movementBoneData;
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameData *CCDataReaderHelper::decodeFrame(cs::CSJsonDictionary &json)
|
CCFrameData *CCDataReaderHelper::decodeFrame(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
FrameData *frameData = FrameData::create();
|
CCFrameData *frameData = CCFrameData::create();
|
||||||
|
|
||||||
DecodeNode(frameData, json);
|
DecodeNode(frameData, json);
|
||||||
|
|
||||||
|
@ -1026,9 +1026,9 @@ FrameData *CCDataReaderHelper::decodeFrame(cs::CSJsonDictionary &json)
|
||||||
return frameData;
|
return frameData;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureData *CCDataReaderHelper::decodeTexture(cs::CSJsonDictionary &json)
|
CCTextureData *CCDataReaderHelper::decodeTexture(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
TextureData *textureData = TextureData::create();
|
CCTextureData *textureData = CCTextureData::create();
|
||||||
|
|
||||||
const char *name = json.getItemStringValue(A_NAME);
|
const char *name = json.getItemStringValue(A_NAME);
|
||||||
if(name != NULL)
|
if(name != NULL)
|
||||||
|
@ -1053,16 +1053,16 @@ TextureData *CCDataReaderHelper::decodeTexture(cs::CSJsonDictionary &json)
|
||||||
return textureData;
|
return textureData;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContourData *CCDataReaderHelper::decodeContour(cs::CSJsonDictionary &json)
|
CCContourData *CCDataReaderHelper::decodeContour(cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
ContourData *contourData = ContourData::create();
|
CCContourData *contourData = CCContourData::create();
|
||||||
|
|
||||||
int length = json.getArrayItemCount(VERTEX_POINT);
|
int length = json.getArrayItemCount(VERTEX_POINT);
|
||||||
for (int i = length - 1; i>=0; i--)
|
for (int i = length - 1; i>=0; i--)
|
||||||
{
|
{
|
||||||
cs::CSJsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i);
|
cs::CSJsonDictionary *dic = json.getSubItemFromArray(VERTEX_POINT, i);
|
||||||
|
|
||||||
ContourVertex2 *vertex = new ContourVertex2(0, 0);
|
CCContourVertex2 *vertex = new CCContourVertex2(0, 0);
|
||||||
|
|
||||||
vertex->x = dic->getItemFloatValue(A_X, 0);
|
vertex->x = dic->getItemFloatValue(A_X, 0);
|
||||||
vertex->y = dic->getItemFloatValue(A_Y, 0);
|
vertex->y = dic->getItemFloatValue(A_Y, 0);
|
||||||
|
@ -1076,7 +1076,7 @@ ContourData *CCDataReaderHelper::decodeContour(cs::CSJsonDictionary &json)
|
||||||
return contourData;
|
return contourData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCDataReaderHelper::DecodeNode(Node *node, cs::CSJsonDictionary &json)
|
void CCDataReaderHelper::DecodeNode(CCBaseData *node, cs::CSJsonDictionary &json)
|
||||||
{
|
{
|
||||||
node->x = json.getItemFloatValue(A_X, 0) * s_PositionReadScale;
|
node->x = json.getItemFloatValue(A_X, 0) * s_PositionReadScale;
|
||||||
node->y = json.getItemFloatValue(A_Y, 0) * s_PositionReadScale;
|
node->y = json.getItemFloatValue(A_Y, 0) * s_PositionReadScale;
|
||||||
|
|
|
@ -82,29 +82,29 @@ public:
|
||||||
/**
|
/**
|
||||||
* Decode CCArmature Datas from xml export from Dragon CCBone flash tool
|
* Decode CCArmature Datas from xml export from Dragon CCBone flash tool
|
||||||
*/
|
*/
|
||||||
static ArmatureData *decodeArmature(tinyxml2::XMLElement *armatureXML);
|
static CCArmatureData *decodeArmature(tinyxml2::XMLElement *armatureXML);
|
||||||
static BoneData *decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXML);
|
static CCBoneData *decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXML);
|
||||||
static DisplayData *decodeBoneDisplay(tinyxml2::XMLElement *displayXML);
|
static CCDisplayData *decodeBoneDisplay(tinyxml2::XMLElement *displayXML);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode CCAnimation Datas from xml export from Dragon CCBone flash tool
|
* Decode CCAnimation Datas from xml export from Dragon CCBone flash tool
|
||||||
*/
|
*/
|
||||||
static AnimationData *decodeAnimation(tinyxml2::XMLElement *animationXML);
|
static CCAnimationData *decodeAnimation(tinyxml2::XMLElement *animationXML);
|
||||||
static MovementData *decodeMovement(tinyxml2::XMLElement *movementXML, ArmatureData *armatureData);
|
static CCMovementData *decodeMovement(tinyxml2::XMLElement *movementXML, CCArmatureData *armatureData);
|
||||||
static MovementBoneData *decodeMovementBone(tinyxml2::XMLElement* movBoneXml, tinyxml2::XMLElement* parentXml, BoneData *boneData);
|
static CCMovementBoneData *decodeMovementBone(tinyxml2::XMLElement* movBoneXml, tinyxml2::XMLElement* parentXml, CCBoneData *boneData);
|
||||||
static FrameData *decodeFrame(tinyxml2::XMLElement* frameXML, tinyxml2::XMLElement* parentFrameXml, BoneData *boneData);
|
static CCFrameData *decodeFrame(tinyxml2::XMLElement* frameXML, tinyxml2::XMLElement* parentFrameXml, CCBoneData *boneData);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Texture Datas from xml export from Dragon CCBone flash tool
|
* Decode Texture Datas from xml export from Dragon CCBone flash tool
|
||||||
*/
|
*/
|
||||||
static TextureData *decodeTexture(tinyxml2::XMLElement *textureXML);
|
static CCTextureData *decodeTexture(tinyxml2::XMLElement *textureXML);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Contour Datas from xml export from Dragon CCBone flash tool
|
* Decode Contour Datas from xml export from Dragon CCBone flash tool
|
||||||
*/
|
*/
|
||||||
static ContourData *decodeContour(tinyxml2::XMLElement *contourXML);
|
static CCContourData *decodeContour(tinyxml2::XMLElement *contourXML);
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
#pragma region Decode Data From JSON
|
#pragma region Decode Data From JSON
|
||||||
|
@ -112,20 +112,20 @@ public:
|
||||||
static void addDataFromJson(const char *filePath);
|
static void addDataFromJson(const char *filePath);
|
||||||
static void addDataFromJsonCache(const char *fileContent);
|
static void addDataFromJsonCache(const char *fileContent);
|
||||||
|
|
||||||
static ArmatureData *decodeArmature(cs::CSJsonDictionary &json);
|
static CCArmatureData *decodeArmature(cs::CSJsonDictionary &json);
|
||||||
static BoneData *decodeBone(cs::CSJsonDictionary &json);
|
static CCBoneData *decodeBone(cs::CSJsonDictionary &json);
|
||||||
static DisplayData *decodeBoneDisplay(cs::CSJsonDictionary &json);
|
static CCDisplayData *decodeBoneDisplay(cs::CSJsonDictionary &json);
|
||||||
|
|
||||||
static AnimationData *decodeAnimation(cs::CSJsonDictionary &json);
|
static CCAnimationData *decodeAnimation(cs::CSJsonDictionary &json);
|
||||||
static MovementData *decodeMovement(cs::CSJsonDictionary &json);
|
static CCMovementData *decodeMovement(cs::CSJsonDictionary &json);
|
||||||
static MovementBoneData *decodeMovementBone(cs::CSJsonDictionary &json);
|
static CCMovementBoneData *decodeMovementBone(cs::CSJsonDictionary &json);
|
||||||
static FrameData *decodeFrame(cs::CSJsonDictionary &json);
|
static CCFrameData *decodeFrame(cs::CSJsonDictionary &json);
|
||||||
|
|
||||||
static TextureData *decodeTexture(cs::CSJsonDictionary &json);
|
static CCTextureData *decodeTexture(cs::CSJsonDictionary &json);
|
||||||
|
|
||||||
static ContourData *decodeContour(cs::CSJsonDictionary &json);
|
static CCContourData *decodeContour(cs::CSJsonDictionary &json);
|
||||||
|
|
||||||
static void DecodeNode(Node *node, cs::CSJsonDictionary &json);
|
static void DecodeNode(CCBaseData *node, cs::CSJsonDictionary &json);
|
||||||
//static std::string convertFlashToSP(const char *fileName);
|
//static std::string convertFlashToSP(const char *fileName);
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
|
@ -33,13 +33,13 @@ CCAffineTransform CCTransformHelp::helpMatrix2;
|
||||||
CCPoint CCTransformHelp::helpPoint1;
|
CCPoint CCTransformHelp::helpPoint1;
|
||||||
CCPoint CCTransformHelp::helpPoint2;
|
CCPoint CCTransformHelp::helpPoint2;
|
||||||
|
|
||||||
Node helpParentNode;
|
CCBaseData helpParentNode;
|
||||||
|
|
||||||
CCTransformHelp::CCTransformHelp()
|
CCTransformHelp::CCTransformHelp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTransformHelp::transformFromParent(Node &node, const Node &parentNode)
|
void CCTransformHelp::transformFromParent(CCBaseData &node, const CCBaseData &parentNode)
|
||||||
{
|
{
|
||||||
nodeToMatrix(node, helpMatrix1);
|
nodeToMatrix(node, helpMatrix1);
|
||||||
nodeToMatrix(parentNode, helpMatrix2);
|
nodeToMatrix(parentNode, helpMatrix2);
|
||||||
|
@ -50,7 +50,7 @@ void CCTransformHelp::transformFromParent(Node &node, const Node &parentNode)
|
||||||
matrixToNode(helpMatrix1, node);
|
matrixToNode(helpMatrix1, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTransformHelp::transformToParent(Node &node, const Node &parentNode)
|
void CCTransformHelp::transformToParent(CCBaseData &node, const CCBaseData &parentNode)
|
||||||
{
|
{
|
||||||
|
|
||||||
nodeToMatrix(node, helpMatrix1);
|
nodeToMatrix(node, helpMatrix1);
|
||||||
|
@ -61,7 +61,7 @@ void CCTransformHelp::transformToParent(Node &node, const Node &parentNode)
|
||||||
matrixToNode(helpMatrix1, node);
|
matrixToNode(helpMatrix1, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTransformHelp::transformFromParentWithoutScale(Node &node, const Node &parentNode)
|
void CCTransformHelp::transformFromParentWithoutScale(CCBaseData &node, const CCBaseData &parentNode)
|
||||||
{
|
{
|
||||||
|
|
||||||
helpParentNode.copy(&parentNode);
|
helpParentNode.copy(&parentNode);
|
||||||
|
@ -77,7 +77,7 @@ void CCTransformHelp::transformFromParentWithoutScale(Node &node, const Node &pa
|
||||||
matrixToNode(helpMatrix1, node);
|
matrixToNode(helpMatrix1, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTransformHelp::transformToParentWithoutScale(Node &node, const Node &parentNode)
|
void CCTransformHelp::transformToParentWithoutScale(CCBaseData &node, const CCBaseData &parentNode)
|
||||||
{
|
{
|
||||||
|
|
||||||
helpParentNode.copy(&parentNode);
|
helpParentNode.copy(&parentNode);
|
||||||
|
@ -92,7 +92,7 @@ void CCTransformHelp::transformToParentWithoutScale(Node &node, const Node &pare
|
||||||
matrixToNode(helpMatrix1, node);
|
matrixToNode(helpMatrix1, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTransformHelp::nodeToMatrix(const Node &node, CCAffineTransform &matrix)
|
void CCTransformHelp::nodeToMatrix(const CCBaseData &node, CCAffineTransform &matrix)
|
||||||
{
|
{
|
||||||
matrix.a = node.scaleX * cos(node.skewY);
|
matrix.a = node.scaleX * cos(node.skewY);
|
||||||
matrix.b = node.scaleX * sin(node.skewY);
|
matrix.b = node.scaleX * sin(node.skewY);
|
||||||
|
@ -103,7 +103,7 @@ void CCTransformHelp::nodeToMatrix(const Node &node, CCAffineTransform &matrix)
|
||||||
matrix.ty = node.y;
|
matrix.ty = node.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTransformHelp::matrixToNode(const CCAffineTransform &matrix, Node &node)
|
void CCTransformHelp::matrixToNode(const CCAffineTransform &matrix, CCBaseData &node)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* In as3 language, there is a function called "deltaTransformPoint", it calculate a point used give Transform
|
* In as3 language, there is a function called "deltaTransformPoint", it calculate a point used give Transform
|
||||||
|
@ -129,7 +129,7 @@ void CCTransformHelp::matrixToNode(const CCAffineTransform &matrix, Node &node)
|
||||||
node.y = matrix.ty;
|
node.y = matrix.ty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCTransformHelp::nodeConcat(Node &target, Node &source)
|
void CCTransformHelp::nodeConcat(CCBaseData &target, CCBaseData &source)
|
||||||
{
|
{
|
||||||
target.x += source.x;
|
target.x += source.x;
|
||||||
target.y += source.y;
|
target.y += source.y;
|
||||||
|
|
|
@ -38,16 +38,16 @@ class CCTransformHelp
|
||||||
public:
|
public:
|
||||||
CCTransformHelp();
|
CCTransformHelp();
|
||||||
|
|
||||||
static void transformFromParent(Node &node, const Node &parentNode);
|
static void transformFromParent(CCBaseData &node, const CCBaseData &parentNode);
|
||||||
static void transformToParent(Node &node, const Node &parentNode);
|
static void transformToParent(CCBaseData &node, const CCBaseData &parentNode);
|
||||||
|
|
||||||
static void transformFromParentWithoutScale(Node &node, const Node &parentNode);
|
static void transformFromParentWithoutScale(CCBaseData &node, const CCBaseData &parentNode);
|
||||||
static void transformToParentWithoutScale(Node &node, const Node &parentNode);
|
static void transformToParentWithoutScale(CCBaseData &node, const CCBaseData &parentNode);
|
||||||
|
|
||||||
static void nodeToMatrix(const Node &_node, CCAffineTransform &_matrix);
|
static void nodeToMatrix(const CCBaseData &_node, CCAffineTransform &_matrix);
|
||||||
static void matrixToNode(const CCAffineTransform &_matrix, Node &_node);
|
static void matrixToNode(const CCAffineTransform &_matrix, CCBaseData &_node);
|
||||||
|
|
||||||
static void nodeConcat(Node &target, Node &source);
|
static void nodeConcat(CCBaseData &target, CCBaseData &source);
|
||||||
public:
|
public:
|
||||||
static CCAffineTransform helpMatrix1;
|
static CCAffineTransform helpMatrix1;
|
||||||
static CCAffineTransform helpMatrix2;
|
static CCAffineTransform helpMatrix2;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
NS_CC_EXT_BEGIN
|
NS_CC_EXT_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A Node that draws the components of a physics engine.
|
A CCBaseData that draws the components of a physics engine.
|
||||||
|
|
||||||
Supported physics engines:
|
Supported physics engines:
|
||||||
- Chipmunk
|
- Chipmunk
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="AssetsManager">
|
<Filter Include="AssetsManager">
|
||||||
<UniqueIdentifier>{49487dbe-5758-436a-b014-8e2edc6b33ae}</UniqueIdentifier>
|
<UniqueIdentifier>{49487dbe-5758-436a-b014-8e2edc6b33ae}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<<<<<<< HEAD
|
|
||||||
<Filter Include="CCArmature">
|
<Filter Include="CCArmature">
|
||||||
<UniqueIdentifier>{0f60f39f-9b10-4467-a225-185f3f415178}</UniqueIdentifier>
|
<UniqueIdentifier>{0f60f39f-9b10-4467-a225-185f3f415178}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
@ -51,17 +50,15 @@
|
||||||
<UniqueIdentifier>{fac95429-e767-428f-ad2e-61b02693c747}</UniqueIdentifier>
|
<UniqueIdentifier>{fac95429-e767-428f-ad2e-61b02693c747}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="CCArmature\external_tool\Json\lib_json">
|
<Filter Include="CCArmature\external_tool\Json\lib_json">
|
||||||
<UniqueIdentifier>{d04cf376-7450-4b6a-a055-1db18f8d65de}</UniqueIdentifier>
|
<UniqueIdentifier>{d04cf376-7450-4b6a-a055-1db18f8d65de}</UniqueIdentifier>
|
||||||
=======
|
</Filter> <Filter Include="spine">
|
||||||
<Filter Include="spine">
|
|
||||||
<UniqueIdentifier>{ff4b5934-99d4-4ea7-9f50-a774192d9ca9}</UniqueIdentifier>
|
<UniqueIdentifier>{ff4b5934-99d4-4ea7-9f50-a774192d9ca9}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="network">
|
<Filter Include="network">
|
||||||
<UniqueIdentifier>{2a7741ff-87a5-41c8-8e51-d7a1cf0c8e4d}</UniqueIdentifier>
|
<UniqueIdentifier>{2a7741ff-87a5-41c8-8e51-d7a1cf0c8e4d}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Components">
|
<Filter Include="Components">
|
||||||
<UniqueIdentifier>{e82b14bf-eb08-4a40-a9a2-cc92a154d9b9}</UniqueIdentifier>
|
<UniqueIdentifier>{e82b14bf-eb08-4a40-a9a2-cc92a154d9b9}</UniqueIdentifier>
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -208,8 +205,7 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\AssetsManager\AssetsManager.cpp">
|
<ClCompile Include="..\AssetsManager\AssetsManager.cpp">
|
||||||
<Filter>AssetsManager</Filter>
|
<Filter>AssetsManager</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<<<<<<< HEAD
|
|
||||||
<ClCompile Include="..\CCArmature\animation\CCAnimation.cpp">
|
<ClCompile Include="..\CCArmature\animation\CCAnimation.cpp">
|
||||||
<Filter>CCArmature\animation</Filter>
|
<Filter>CCArmature\animation</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -287,7 +283,7 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\CCArmature\external_tool\Json\lib_json\json_writer.cpp">
|
<ClCompile Include="..\CCArmature\external_tool\Json\lib_json\json_writer.cpp">
|
||||||
<Filter>CCArmature\external_tool\Json\lib_json</Filter>
|
<Filter>CCArmature\external_tool\Json\lib_json</Filter>
|
||||||
=======
|
</ClCompile>
|
||||||
<ClCompile Include="..\spine\Animation.cpp">
|
<ClCompile Include="..\spine\Animation.cpp">
|
||||||
<Filter>spine</Filter>
|
<Filter>spine</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -364,8 +360,7 @@
|
||||||
<Filter>Components</Filter>
|
<Filter>Components</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Components\CCInputDelegate.cpp">
|
<ClCompile Include="..\Components\CCInputDelegate.cpp">
|
||||||
<Filter>Components</Filter>
|
<Filter>Components</Filter>
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -538,8 +533,7 @@
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\AssetsManager\AssetsManager.h">
|
<ClInclude Include="..\AssetsManager\AssetsManager.h">
|
||||||
<Filter>AssetsManager</Filter>
|
<Filter>AssetsManager</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<<<<<<< HEAD
|
|
||||||
<ClInclude Include="..\CCArmature\animation\CCAnimation.h">
|
<ClInclude Include="..\CCArmature\animation\CCAnimation.h">
|
||||||
<Filter>CCArmature\animation</Filter>
|
<Filter>CCArmature\animation</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -661,8 +655,7 @@
|
||||||
</None>
|
</None>
|
||||||
<None Include="..\CCArmature\external_tool\Json\lib_json\sconscript">
|
<None Include="..\CCArmature\external_tool\Json\lib_json\sconscript">
|
||||||
<Filter>CCArmature\external_tool\Json\lib_json</Filter>
|
<Filter>CCArmature\external_tool\Json\lib_json</Filter>
|
||||||
</None>
|
</None>
|
||||||
=======
|
|
||||||
<ClInclude Include="..\spine\Animation.h">
|
<ClInclude Include="..\spine\Animation.h">
|
||||||
<Filter>spine</Filter>
|
<Filter>spine</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -743,7 +736,6 @@
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Components\CCInputDelegate.h">
|
<ClInclude Include="..\Components\CCInputDelegate.h">
|
||||||
<Filter>Components</Filter>
|
<Filter>Components</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -59,9 +59,7 @@ Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \
|
||||||
Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \
|
Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \
|
||||||
Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \
|
Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \
|
||||||
Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \
|
Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \
|
||||||
<<<<<<< HEAD
|
|
||||||
Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp \
|
Classes/ExtensionsTest/ArmatureTest/ArmatureScene.cpp \
|
||||||
=======
|
|
||||||
\
|
\
|
||||||
Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp \
|
Classes/ExtensionsTest/ComponentsTest/ComponentsTestScene.cpp \
|
||||||
Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp \
|
Classes/ExtensionsTest/ComponentsTest/EnemyController.cpp \
|
||||||
|
@ -70,7 +68,6 @@ Classes/ExtensionsTest/ComponentsTest/PlayerController.cpp \
|
||||||
Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp \
|
Classes/ExtensionsTest/ComponentsTest/ProjectileController.cpp \
|
||||||
Classes/ExtensionsTest/ComponentsTest/SceneController.cpp \
|
Classes/ExtensionsTest/ComponentsTest/SceneController.cpp \
|
||||||
\
|
\
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
Classes/FontTest/FontTest.cpp \
|
Classes/FontTest/FontTest.cpp \
|
||||||
Classes/IntervalTest/IntervalTest.cpp \
|
Classes/IntervalTest/IntervalTest.cpp \
|
||||||
Classes/KeypadTest/KeypadTest.cpp \
|
Classes/KeypadTest/KeypadTest.cpp \
|
||||||
|
|
|
@ -448,7 +448,7 @@ void TestParticleDisplay::onEnter()
|
||||||
armature->setScale(0.6f);
|
armature->setScale(0.6f);
|
||||||
addChild(armature);
|
addChild(armature);
|
||||||
|
|
||||||
ParticleDisplayData displayData;
|
CCParticleDisplayData displayData;
|
||||||
displayData.setParam("Particles/SmallSun.plist");
|
displayData.setParam("Particles/SmallSun.plist");
|
||||||
|
|
||||||
cocos2d::extension::CCBone *bone = cocos2d::extension::CCBone::create("p1");
|
cocos2d::extension::CCBone *bone = cocos2d::extension::CCBone::create("p1");
|
||||||
|
@ -505,7 +505,7 @@ void TestUseMutiplePicture::onEnter()
|
||||||
|
|
||||||
char* weapon[] = {"weapon_f-sword.png", "weapon_f-sword2.png", "weapon_f-sword3.png", "weapon_f-sword4.png", "weapon_f-sword5.png", "weapon_f-knife.png", "weapon_f-hammer.png"};
|
char* weapon[] = {"weapon_f-sword.png", "weapon_f-sword2.png", "weapon_f-sword3.png", "weapon_f-sword4.png", "weapon_f-sword5.png", "weapon_f-knife.png", "weapon_f-hammer.png"};
|
||||||
|
|
||||||
SpriteDisplayData displayData;
|
CCSpriteDisplayData displayData;
|
||||||
for (int i = 0; i < 7; i++)
|
for (int i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
displayData.setParam(weapon[i]);
|
displayData.setParam(weapon[i]);
|
||||||
|
|
|
@ -7,15 +7,12 @@
|
||||||
#include "NetworkTest/HttpClientTest.h"
|
#include "NetworkTest/HttpClientTest.h"
|
||||||
#endif
|
#endif
|
||||||
#include "TableViewTest/TableViewTestScene.h"
|
#include "TableViewTest/TableViewTestScene.h"
|
||||||
<<<<<<< HEAD
|
|
||||||
#include "ArmatureTest/ArmatureScene.h"
|
#include "ArmatureTest/ArmatureScene.h"
|
||||||
=======
|
|
||||||
#include "ComponentsTest/ComponentsTestScene.h"
|
#include "ComponentsTest/ComponentsTestScene.h"
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
#include "NetworkTest/WebSocketTest.h"
|
#include "NetworkTest/WebSocketTest.h"
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
|
|
||||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN)
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN)
|
||||||
#include "EditBoxTest/EditBoxTest.h"
|
#include "EditBoxTest/EditBoxTest.h"
|
||||||
|
@ -40,11 +37,8 @@ enum
|
||||||
TEST_EDITBOX,
|
TEST_EDITBOX,
|
||||||
#endif
|
#endif
|
||||||
TEST_TABLEVIEW,
|
TEST_TABLEVIEW,
|
||||||
<<<<<<< HEAD
|
TEST_COMPONENTS,
|
||||||
TEST_ARMATURE,
|
TEST_ARMATURE,
|
||||||
=======
|
|
||||||
TEST_COMPONENTS,
|
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
TEST_MAX_COUNT,
|
TEST_MAX_COUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,11 +57,8 @@ static const std::string testsName[TEST_MAX_COUNT] =
|
||||||
"EditBoxTest",
|
"EditBoxTest",
|
||||||
#endif
|
#endif
|
||||||
"TableViewTest",
|
"TableViewTest",
|
||||||
<<<<<<< HEAD
|
"ComponentsTest",
|
||||||
"ArmatureTest"
|
"ArmatureTest"
|
||||||
=======
|
|
||||||
"ComponentsTest"
|
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
@ -156,7 +147,10 @@ void ExtensionsMainLayer::menuCallback(CCObject* pSender)
|
||||||
runTableViewTest();
|
runTableViewTest();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
<<<<<<< HEAD
|
case TEST_COMPONENTS:
|
||||||
|
{
|
||||||
|
runComponentsTestLayerTest();
|
||||||
|
}
|
||||||
case TEST_ARMATURE:
|
case TEST_ARMATURE:
|
||||||
{
|
{
|
||||||
ArmatureTestScene *pScene = new ArmatureTestScene();
|
ArmatureTestScene *pScene = new ArmatureTestScene();
|
||||||
|
@ -167,12 +161,6 @@ void ExtensionsMainLayer::menuCallback(CCObject* pSender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
=======
|
|
||||||
case TEST_COMPONENTS:
|
|
||||||
{
|
|
||||||
runComponentsTestLayerTest();
|
|
||||||
}
|
|
||||||
>>>>>>> 150b91074a57ae0345c03541b533c46a017b0d13
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,6 +133,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O
|
||||||
<ClCompile Include="..\Classes\ClippingNodeTest\ClippingNodeTest.cpp" />
|
<ClCompile Include="..\Classes\ClippingNodeTest\ClippingNodeTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\ConfigurationTest\ConfigurationTest.cpp" />
|
<ClCompile Include="..\Classes\ConfigurationTest\ConfigurationTest.cpp" />
|
||||||
<ClCompile Include="..\Classes\DataVisitorTest\DataVisitorTest.cpp" />
|
<ClCompile Include="..\Classes\DataVisitorTest\DataVisitorTest.cpp" />
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\ArmatureTest\ArmatureScene.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest\TimelineCallbackTestLayer.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest\TimelineCallbackTestLayer.cpp" />
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\ComponentsTest\ComponentsTestScene.cpp" />
|
<ClCompile Include="..\Classes\ExtensionsTest\ComponentsTest\ComponentsTestScene.cpp" />
|
||||||
|
@ -236,6 +237,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O
|
||||||
<ClInclude Include="..\Classes\ClippingNodeTest\ClippingNodeTest.h" />
|
<ClInclude Include="..\Classes\ClippingNodeTest\ClippingNodeTest.h" />
|
||||||
<ClInclude Include="..\Classes\ConfigurationTest\ConfigurationTest.h" />
|
<ClInclude Include="..\Classes\ConfigurationTest\ConfigurationTest.h" />
|
||||||
<ClInclude Include="..\Classes\DataVisitorTest\DataVisitorTest.h" />
|
<ClInclude Include="..\Classes\DataVisitorTest\DataVisitorTest.h" />
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\ArmatureTest\ArmatureScene.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsLayerLoader.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsLayerLoader.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\AnimationsTest\AnimationsTestLayer.h" />
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest\TimelineCallbackLayerLoader.h" />
|
<ClInclude Include="..\Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest\TimelineCallbackLayerLoader.h" />
|
||||||
|
|
|
@ -229,6 +229,9 @@
|
||||||
<Filter Include="Classes\ExtensionsTest\ComponentsTest">
|
<Filter Include="Classes\ExtensionsTest\ComponentsTest">
|
||||||
<UniqueIdentifier>{90142ee3-1b3c-4bc6-a353-986231a58a17}</UniqueIdentifier>
|
<UniqueIdentifier>{90142ee3-1b3c-4bc6-a353-986231a58a17}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Classes\ExtensionsTest\ArmatureTest">
|
||||||
|
<UniqueIdentifier>{710d484c-0bf8-4024-a1e7-43258671b4cd}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="main.cpp">
|
<ClCompile Include="main.cpp">
|
||||||
|
@ -534,6 +537,9 @@
|
||||||
<ClCompile Include="..\Classes\ExtensionsTest\ComponentsTest\SceneController.cpp">
|
<ClCompile Include="..\Classes\ExtensionsTest\ComponentsTest\SceneController.cpp">
|
||||||
<Filter>Classes\ExtensionsTest\ComponentsTest</Filter>
|
<Filter>Classes\ExtensionsTest\ComponentsTest</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Classes\ExtensionsTest\ArmatureTest\ArmatureScene.cpp">
|
||||||
|
<Filter>Classes\ExtensionsTest\ArmatureTest</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="main.h">
|
<ClInclude Include="main.h">
|
||||||
|
@ -1019,5 +1025,8 @@
|
||||||
<ClInclude Include="..\Classes\ExtensionsTest\ComponentsTest\SceneController.h">
|
<ClInclude Include="..\Classes\ExtensionsTest\ComponentsTest\SceneController.h">
|
||||||
<Filter>Classes\ExtensionsTest\ComponentsTest</Filter>
|
<Filter>Classes\ExtensionsTest\ComponentsTest</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Classes\ExtensionsTest\ArmatureTest\ArmatureScene.h">
|
||||||
|
<Filter>Classes\ExtensionsTest\ArmatureTest</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue