//创建骨骼
CCBone* = CCBone::create(boneName);
CCBone* CCBone::create(const char* name)
{
CCBone* pBone = new CCBone();
{// 骨骼成员定义 骨骼==Layer
m_pTweenData = NULL;//m_pBoneData m_pNode m_pTweenData 影响Display's state
m_pBoneData = NULL;// Used To set_BoneData(CCBoneData* boneData)
m_pParentBone = NULL;// 其父级骨骼的若引用
m_pArmature = NULL;// 当前骨骼所处于的CCArmature
m_pChildArmature = NULL;// 当前骨骼所具有的子级CCArmature ????
m_pTween = NULL;// 计算瞬间效应
m_pChildren = NULL;//CCArray *m_pChildren; public CCNodeRGBA:public CCNode
// Used To set_DisplayManager(CCDisplayManager* displayManager)
// CCDisplayManager manages CCBone's display
// 骨骼应用 display list来管理每一帧的显示信息
m_pDisplayManager = NULL;CCDisplayManager* CCBone::m_pDisplayManager;
m_bIgnoreMovementBoneData = false;
m_tWorldTransform = CCAffineTransformMake(1, 0, 0, 1, 0, 0);
m_bBoneTransformDirty = true;
m_tWorldInfo = NULL;
m_pArmatureParentBone = NULL;//! Armature's 父级骨骼
m_fDataVersion = 0;//! Data version数据的版本--VI
m_sBlendFunc.src = CC_BLEND_SRC;
m_sBlendFunc.dst = CC_BLEND_DST;
m_bBlendDirty = false;// BlendDirty标识量
}
pBone->init(name);
{// 骨骼成员初始化数据 属性值
m_strName = name;
m_pTweenData = new CCFrameData();// CCFrameData* m_pTweenData;
{// 瞬间效应 数据
: frameID(0)
, duration(1)
, tweenEasing(Linear)
, easingParamNumber(0)
, easingParams(NULL)
, isTween(true)
, displayIndex(0)
, strEvent("")
, strMovement("")
, strSound("")
, strSoundEffect("")
}
m_pTween = new CCTween();//CCTween *m_pTween; -- Calculate tween effect
{// 瞬间效应 成员定义
: m_pMovementBoneData(NULL)
, m_pTweenData(NULL)
, m_pFrom(NULL)
, m_pTo(NULL)
, m_pBetween(NULL)
, m_pBone(NULL)
, m_eFrameTweenEasing(Linear)
, m_iFromIndex(0)
, m_iToIndex(0)
, m_pAnimation(NULL)
, m_bPassLastFrame(false)
}
m_pTween->init(this);
{// 瞬间效应 成员初始化数据
m_pFrom = new CCFrameData();
m_pBetween = new CCFrameData();
m_pBone = bone;
m_pTweenData = m_pBone->getTweenData();
m_pTweenData->displayIndex = -1;
m_pAnimation = m_pBone->getArmature() != NULL ? m_pBone->getArmature()->getAnimation() : NULL;
bRet = true;
}
m_pDisplayManager = new CCDisplayManager(); //CCDisplayManager* m_pDisplayManager;
{// 骨骼的 显示信息管理器
: m_pDecoDisplayList(NULL)
, m_pDisplayRenderNode(NULL)//! Display render node
, m_eDisplayType(CS_DISPLAY_MAX)//! Display render node type
, m_pCurrentDecoDisplay(NULL)//! Include current display information,
, m_iDisplayIndex(-1)//! Current display index
, m_bForceChangeDisplay(false)
, m_bVisible(true)// 当前骨骼是否可见 默认为 true
, m_pBone(NULL)// 当前CCDisplayManager的拥有者
}
m_pDisplayManager->init(this);
{// 初始化CCBone的数据显示管理器列表 IF NULL RETUREN!!!
// 存储当前CCDisplayManager的 所有者
// bone=="ct"_CCBone
m_pBone = bone;
// 使用所有者 bone=="ct"_CCBone的
// 信息数据CCBoneData来初始化CCDisplayManager
// Analysis as Belowed
initDisplayList(bone->getBoneData());
{// CCBoneData* boneData = bone->getBoneData();
// At Presently, boneData==NULL!!!
}
}
m_tWorldInfo = new CCBaseData();
// Allocates CCBone's CCBoneData MEMBER!!
// name, parentName
m_pBoneData = new CCBoneData();
bRet = true;
}
}
//
//
initDisplayList(bone->getBoneData());
void CCDisplayManager::initDisplayList(CCBoneData *boneData)
{
CC_SAFE_DELETE(m_pDecoDisplayList);
m_pDecoDisplayList = CCArray::create();
m_pDecoDisplayList->retain();
// IF boneData==NULL RETUREN!!!!
CS_RETURN_IF(!boneData);
CCObject *object = NULL;
CCArray *displayDataList = &boneData->displayDataList;
CCARRAY_FOREACH(displayDataList, object)
{
CCDisplayData *displayData = (CCDisplayData *)object;
CCDecorativeDisplay *decoDisplay = CCDecorativeDisplay::create();
decoDisplay->setDisplayData(displayData);
CCDisplayFactory::createDisplay(m_pBone, decoDisplay);
m_pDecoDisplayList->addObject(decoDisplay);
}
}
CCBone* = CCBone::create(boneName);
CCBone* CCBone::create(const char* name)
{
CCBone* pBone = new CCBone();
{// 骨骼成员定义 骨骼==Layer
m_pTweenData = NULL;//m_pBoneData m_pNode m_pTweenData 影响Display's state
m_pBoneData = NULL;// Used To set_BoneData(CCBoneData* boneData)
m_pParentBone = NULL;// 其父级骨骼的若引用
m_pArmature = NULL;// 当前骨骼所处于的CCArmature
m_pChildArmature = NULL;// 当前骨骼所具有的子级CCArmature ????
m_pTween = NULL;// 计算瞬间效应
m_pChildren = NULL;//CCArray *m_pChildren; public CCNodeRGBA:public CCNode
// Used To set_DisplayManager(CCDisplayManager* displayManager)
// CCDisplayManager manages CCBone's display
// 骨骼应用 display list来管理每一帧的显示信息
m_pDisplayManager = NULL;CCDisplayManager* CCBone::m_pDisplayManager;
m_bIgnoreMovementBoneData = false;
m_tWorldTransform = CCAffineTransformMake(1, 0, 0, 1, 0, 0);
m_bBoneTransformDirty = true;
m_tWorldInfo = NULL;
m_pArmatureParentBone = NULL;//! Armature's 父级骨骼
m_fDataVersion = 0;//! Data version数据的版本--VI
m_sBlendFunc.src = CC_BLEND_SRC;
m_sBlendFunc.dst = CC_BLEND_DST;
m_bBlendDirty = false;// BlendDirty标识量
}
pBone->init(name);
{// 骨骼成员初始化数据 属性值
m_strName = name;
m_pTweenData = new CCFrameData();// CCFrameData* m_pTweenData;
{// 瞬间效应 数据
: frameID(0)
, duration(1)
, tweenEasing(Linear)
, easingParamNumber(0)
, easingParams(NULL)
, isTween(true)
, displayIndex(0)
, strEvent("")
, strMovement("")
, strSound("")
, strSoundEffect("")
}
m_pTween = new CCTween();//CCTween *m_pTween; -- Calculate tween effect
{// 瞬间效应 成员定义
: m_pMovementBoneData(NULL)
, m_pTweenData(NULL)
, m_pFrom(NULL)
, m_pTo(NULL)
, m_pBetween(NULL)
, m_pBone(NULL)
, m_eFrameTweenEasing(Linear)
, m_iFromIndex(0)
, m_iToIndex(0)
, m_pAnimation(NULL)
, m_bPassLastFrame(false)
}
m_pTween->init(this);
{// 瞬间效应 成员初始化数据
m_pFrom = new CCFrameData();
m_pBetween = new CCFrameData();
m_pBone = bone;
m_pTweenData = m_pBone->getTweenData();
m_pTweenData->displayIndex = -1;
m_pAnimation = m_pBone->getArmature() != NULL ? m_pBone->getArmature()->getAnimation() : NULL;
bRet = true;
}
m_pDisplayManager = new CCDisplayManager(); //CCDisplayManager* m_pDisplayManager;
{// 骨骼的 显示信息管理器
: m_pDecoDisplayList(NULL)
, m_pDisplayRenderNode(NULL)//! Display render node
, m_eDisplayType(CS_DISPLAY_MAX)//! Display render node type
, m_pCurrentDecoDisplay(NULL)//! Include current display information,
, m_iDisplayIndex(-1)//! Current display index
, m_bForceChangeDisplay(false)
, m_bVisible(true)// 当前骨骼是否可见 默认为 true
, m_pBone(NULL)// 当前CCDisplayManager的拥有者
}
m_pDisplayManager->init(this);
{// 初始化CCBone的数据显示管理器列表 IF NULL RETUREN!!!
// 存储当前CCDisplayManager的 所有者
// bone=="ct"_CCBone
m_pBone = bone;
// 使用所有者 bone=="ct"_CCBone的
// 信息数据CCBoneData来初始化CCDisplayManager
// Analysis as Belowed
initDisplayList(bone->getBoneData());
{// CCBoneData* boneData = bone->getBoneData();
// At Presently, boneData==NULL!!!
}
}
m_tWorldInfo = new CCBaseData();
// Allocates CCBone's CCBoneData MEMBER!!
// name, parentName
m_pBoneData = new CCBoneData();
bRet = true;
}
}
//
//
initDisplayList(bone->getBoneData());
void CCDisplayManager::initDisplayList(CCBoneData *boneData)
{
CC_SAFE_DELETE(m_pDecoDisplayList);
m_pDecoDisplayList = CCArray::create();
m_pDecoDisplayList->retain();
// IF boneData==NULL RETUREN!!!!
CS_RETURN_IF(!boneData);
CCObject *object = NULL;
CCArray *displayDataList = &boneData->displayDataList;
CCARRAY_FOREACH(displayDataList, object)
{
CCDisplayData *displayData = (CCDisplayData *)object;
CCDecorativeDisplay *decoDisplay = CCDecorativeDisplay::create();
decoDisplay->setDisplayData(displayData);
CCDisplayFactory::createDisplay(m_pBone, decoDisplay);
m_pDecoDisplayList->addObject(decoDisplay);
}
}