Change CCAnimation to CCArmatureAnimation

This commit is contained in:
yinkaile 2013-06-08 11:16:17 +08:00
parent 7c924c714f
commit f2021982f4
14 changed files with 55 additions and 54 deletions

View File

@ -55,7 +55,7 @@ physics_nodes/CCPhysicsSprite.cpp \
LocalStorage/LocalStorageAndroid.cpp \
CCArmature/CCArmature.cpp \
CCArmature/CCBone.cpp \
CCArmature/animation/CCAnimation.cpp \
CCArmature/animation/CCArmatureAnimation.cpp \
CCArmature/animation/CCProcessBase.cpp \
CCArmature/animation/CCTween.cpp \
CCArmature/datas/CCDatas.cpp \

View File

@ -112,7 +112,7 @@ bool CCArmature::init(const char *name)
removeAllChildren();
CC_SAFE_DELETE(m_pAnimation);
m_pAnimation = new CCAnimation();
m_pAnimation = new CCArmatureAnimation();
m_pAnimation->init(this);
CC_SAFE_DELETE(m_pBoneDic);

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
#include "utils/CCArmatureDefine.h"
#include "CCBone.h"
#include "display/CCBatchNode.h"
#include "animation/CCAnimation.h"
#include "animation/CCArmatureAnimation.h"
NS_CC_EXT_BEGIN
@ -131,7 +131,7 @@ protected:
CCBone *createBone(const char *boneName );
CC_SYNTHESIZE_RETAIN(CCAnimation *, m_pAnimation, Animation);
CC_SYNTHESIZE_RETAIN(CCArmatureAnimation *, m_pAnimation, Animation);
CC_SYNTHESIZE(CCArmatureData *, m_pArmatureData, CCArmatureData);

View File

@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCAnimation.h"
#include "CCArmatureAnimation.h"
#include "../CCArmature.h"
#include "../CCBone.h"
#include "../utils/CCArmatureDefine.h"
@ -33,20 +33,20 @@ THE SOFTWARE.
NS_CC_EXT_BEGIN
CCAnimation *CCAnimation::create(CCArmature *armature)
CCArmatureAnimation *CCArmatureAnimation::create(CCArmature *armature)
{
CCAnimation *pARmatureAnimation = new CCAnimation();
if (pARmatureAnimation && pARmatureAnimation->init(armature))
CCArmatureAnimation *pArmatureAnimation = new CCArmatureAnimation();
if (pArmatureAnimation && pArmatureAnimation->init(armature))
{
pARmatureAnimation->autorelease();
return pARmatureAnimation;
pArmatureAnimation->autorelease();
return pArmatureAnimation;
}
CC_SAFE_DELETE(pARmatureAnimation);
CC_SAFE_DELETE(pArmatureAnimation);
return NULL;
}
CCAnimation::CCAnimation()
CCArmatureAnimation::CCArmatureAnimation()
: m_pAnimationData(NULL)
, m_pArmature(NULL)
, m_strMovementID("")
@ -55,13 +55,13 @@ CCAnimation::CCAnimation()
}
CCAnimation::~CCAnimation(void)
CCArmatureAnimation::~CCArmatureAnimation(void)
{
CC_SAFE_RELEASE_NULL(m_pTweenList);
CC_SAFE_RELEASE_NULL(m_pAnimationData);
}
bool CCAnimation::init(CCArmature *armature)
bool CCArmatureAnimation::init(CCArmature *armature)
{
bool bRet = false;
do
@ -79,7 +79,7 @@ bool CCAnimation::init(CCArmature *armature)
}
void CCAnimation:: pause()
void CCArmatureAnimation:: pause()
{
CCObject *object = NULL;
CCARRAY_FOREACH(m_pTweenList, object)
@ -89,7 +89,7 @@ void CCAnimation:: pause()
CCProcessBase::pause();
}
void CCAnimation::resume()
void CCArmatureAnimation::resume()
{
CCObject *object = NULL;
CCARRAY_FOREACH(m_pTweenList, object)
@ -99,7 +99,7 @@ void CCAnimation::resume()
CCProcessBase::resume();
}
void CCAnimation::stop()
void CCArmatureAnimation::stop()
{
CCObject *object = NULL;
CCARRAY_FOREACH(m_pTweenList, object)
@ -110,7 +110,7 @@ void CCAnimation::stop()
CCProcessBase::stop();
}
void CCAnimation::setAnimationScale(float animationScale )
void CCArmatureAnimation::setAnimationScale(float animationScale )
{
if(animationScale == m_fAnimationScale)
{
@ -133,7 +133,7 @@ void CCAnimation::setAnimationScale(float animationScale )
}
void CCAnimation::play(const char *animationName, int durationTo, int durationTween, int loop, int tweenEasing)
void CCArmatureAnimation::play(const char *animationName, int durationTo, int durationTween, int loop, int tweenEasing)
{
CCAssert(m_pAnimationData, "m_pAnimationData can not be null");
@ -215,7 +215,7 @@ void CCAnimation::play(const char *animationName, int durationTo, int durationTw
}
void CCAnimation::playByIndex(int animationIndex, int durationTo, int durationTween, int loop, int tweenEasing)
void CCArmatureAnimation::playByIndex(int animationIndex, int durationTo, int durationTween, int loop, int tweenEasing)
{
std::vector<std::string> &movName = m_pAnimationData->movementNames;
CC_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size()));
@ -226,12 +226,12 @@ void CCAnimation::playByIndex(int animationIndex, int durationTo, int durationTw
int CCAnimation::getMovementCount()
int CCArmatureAnimation::getMovementCount()
{
return m_pAnimationData->getMovementCount();
}
void CCAnimation::update(float dt)
void CCArmatureAnimation::update(float dt)
{
CCProcessBase::update(dt);
CCObject *object = NULL;
@ -241,7 +241,7 @@ void CCAnimation::update(float dt)
}
}
void CCAnimation::updateHandler()
void CCArmatureAnimation::updateHandler()
{
if (m_fCurrentPercent >= 1)
{
@ -304,7 +304,7 @@ void CCAnimation::updateHandler()
}
void CCAnimation::updateFrameData(float currentPercent)
void CCArmatureAnimation::updateFrameData(float currentPercent)
{
m_iPrevFrameIndex = m_iCurFrameIndex;
m_iCurFrameIndex = m_iRawDuration * currentPercent;

View File

@ -43,21 +43,21 @@ enum MovementEventType
class CCArmature;
class CCBone;
class CCAnimation : public CCProcessBase
class CCArmatureAnimation : public CCProcessBase
{
public:
/**
* Create with a CCArmature
* @param armature The CCArmature CCAnimation will bind to
* @param armature The CCArmature CCArmatureAnimation will bind to
*/
static CCAnimation *create(CCArmature *armature);
static CCArmatureAnimation *create(CCArmature *armature);
public:
CCAnimation();
virtual ~CCAnimation(void);
CCArmatureAnimation();
virtual ~CCArmatureAnimation(void);
/**
* Init with a CCArmature
* @param armature The CCArmature CCAnimation will bind to
* @param armature The CCArmature CCArmatureAnimation will bind to
*/
virtual bool init(CCArmature *armature);

View File

@ -24,7 +24,7 @@ THE SOFTWARE.
#include "CCTween.h"
#include "CCAnimation.h"
#include "CCArmatureAnimation.h"
#include "../CCBone.h"
#include "../CCArmature.h"
#include "../utils/CCUtilMath.h"

View File

@ -32,7 +32,7 @@ THE SOFTWARE.
NS_CC_EXT_BEGIN
class CCBone;
class CCAnimation;
class CCArmatureAnimation;
class CCTween : public CCProcessBase
{
@ -132,7 +132,7 @@ protected:
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 CCMovementBoneData, it's different from m_iFrameIndex
CCAnimation *m_pAnimation;
CCArmatureAnimation *m_pAnimation;
};
NS_CC_EXT_END

View File

@ -87,7 +87,7 @@ public:
/**
* Decode CCAnimation Datas from xml export from Dragon CCBone flash tool
* Decode CCArmatureAnimation Datas from xml export from Dragon CCBone flash tool
*/
static CCAnimationData *decodeAnimation(tinyxml2::XMLElement *animationXML);
static CCMovementData *decodeMovement(tinyxml2::XMLElement *movementXML, CCArmatureData *armatureData);

View File

@ -43,7 +43,7 @@
#include "CCArmature/CCArmature.h"
#include "CCArmature/CCBone.h"
#include "CCArmature/animation/CCAnimation.h"
#include "CCArmature/animation/CCArmatureAnimation.h"
#include "CCArmature/datas/CCDatas.h"
#include "CCArmature/display/CCBatchNode.h"
#include "CCArmature/display/CCDecorativeDisplay.h"

View File

@ -66,7 +66,7 @@ SOURCES = ../CCBReader/CCBFileLoader.cpp \
../Components/CCInputDelegate.cpp \
../CCArmature/CCArmature.cpp \
../CCArmature/CCBone.cpp \
../CCArmature/animation/CCAnimation.cpp \
../CCArmature/animation/CCArmatureAnimation.cpp \
../CCArmature/animation/CCProcessBase.cpp \
../CCArmature/animation/CCTween.cpp \
../CCArmature/datas/CCDatas.cpp \

View File

@ -85,7 +85,7 @@ SOURCES = ../CCBReader/CCBFileLoader.cpp \
../Components/CCInputDelegate.cpp \
../CCArmature/CCArmature.cpp \
../CCArmature/CCBone.cpp \
../CCArmature/animation/CCAnimation.cpp \
../CCArmature/animation/CCArmatureAnimation.cpp \
../CCArmature/animation/CCProcessBase.cpp \
../CCArmature/animation/CCTween.cpp \
../CCArmature/datas/CCDatas.cpp \

View File

@ -69,7 +69,7 @@ EXTENSIONS_SOURCES = ../CCBReader/CCBFileLoader.cpp \
../Components/CCInputDelegate.cpp \
../CCArmature/CCArmature.cpp \
../CCArmature/CCBone.cpp \
../CCArmature/animation/CCAnimation.cpp \
../CCArmature/animation/CCArmatureAnimation.cpp \
../CCArmature/animation/CCProcessBase.cpp \
../CCArmature/animation/CCTween.cpp \
../CCArmature/datas/CCDatas.cpp \

View File

@ -92,7 +92,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\AssetsManager\AssetsManager.cpp" />
<ClCompile Include="..\CCArmature\animation\CCAnimation.cpp" />
<ClCompile Include="..\CCArmature\animation\CCArmatureAnimation.cpp" />
<ClCompile Include="..\CCArmature\animation\CCProcessBase.cpp" />
<ClCompile Include="..\CCArmature\animation\CCTween.cpp" />
<ClCompile Include="..\CCArmature\CCArmature.cpp" />
@ -194,7 +194,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\AssetsManager\AssetsManager.h" />
<ClInclude Include="..\CCArmature\animation\CCAnimation.h" />
<ClInclude Include="..\CCArmature\animation\CCArmatureAnimation.h" />
<ClInclude Include="..\CCArmature\animation\CCProcessBase.h" />
<ClInclude Include="..\CCArmature\animation\CCTween.h" />
<ClInclude Include="..\CCArmature\CCArmature.h" />

View File

@ -51,7 +51,8 @@
</Filter>
<Filter Include="CCArmature\external_tool\Json\lib_json">
<UniqueIdentifier>{d04cf376-7450-4b6a-a055-1db18f8d65de}</UniqueIdentifier>
</Filter> <Filter Include="spine">
</Filter>
<Filter Include="spine">
<UniqueIdentifier>{ff4b5934-99d4-4ea7-9f50-a774192d9ca9}</UniqueIdentifier>
</Filter>
<Filter Include="network">
@ -206,9 +207,6 @@
<ClCompile Include="..\AssetsManager\AssetsManager.cpp">
<Filter>AssetsManager</Filter>
</ClCompile>
<ClCompile Include="..\CCArmature\animation\CCAnimation.cpp">
<Filter>CCArmature\animation</Filter>
</ClCompile>
<ClCompile Include="..\CCArmature\animation\CCProcessBase.cpp">
<Filter>CCArmature\animation</Filter>
</ClCompile>
@ -283,7 +281,7 @@
</ClCompile>
<ClCompile Include="..\CCArmature\external_tool\Json\lib_json\json_writer.cpp">
<Filter>CCArmature\external_tool\Json\lib_json</Filter>
</ClCompile>
</ClCompile>
<ClCompile Include="..\spine\Animation.cpp">
<Filter>spine</Filter>
</ClCompile>
@ -362,6 +360,9 @@
<ClCompile Include="..\Components\CCInputDelegate.cpp">
<Filter>Components</Filter>
</ClCompile>
<ClCompile Include="..\CCArmature\animation\CCArmatureAnimation.cpp">
<Filter>CCArmature\animation</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\GUI\CCScrollView\CCScrollView.h">
@ -534,9 +535,6 @@
<ClInclude Include="..\AssetsManager\AssetsManager.h">
<Filter>AssetsManager</Filter>
</ClInclude>
<ClInclude Include="..\CCArmature\animation\CCAnimation.h">
<Filter>CCArmature\animation</Filter>
</ClInclude>
<ClInclude Include="..\CCArmature\animation\CCProcessBase.h">
<Filter>CCArmature\animation</Filter>
</ClInclude>
@ -642,6 +640,9 @@
<ClInclude Include="..\CCArmature\external_tool\Json\lib_json\writer.h">
<Filter>CCArmature\external_tool\Json\lib_json</Filter>
</ClInclude>
<ClInclude Include="..\CCArmature\animation\CCArmatureAnimation.h">
<Filter>CCArmature\animation</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\CCArmature\external_tool\Json\lib_json\json_internalarray.inl">