本文整理汇总了C++中CCArmature::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ CCArmature::draw方法的具体用法?C++ CCArmature::draw怎么用?C++ CCArmature::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCArmature
的用法示例。
在下文中一共展示了CCArmature::draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void CBArmature::draw()
{
if(m_preDrawFunction)
m_preDrawFunction->execute();
if (m_pParentBone == NULL && m_pBatchNode == NULL)
{
CC_NODE_DRAW_SETUP();
ccGLBlendFunc(m_sBlendFunc.src, m_sBlendFunc.dst);
}
CCObject *object = NULL;
CCARRAY_FOREACH(m_pChildren, object)
{
if (CCBone *bone = dynamic_cast<CCBone *>(object))
{
CCNode *node = bone->getDisplayRenderNode();
if (NULL == node)
continue;
switch (bone->getDisplayRenderNodeType())
{
case CS_DISPLAY_SPRITE:
{
CCSkin *skin = (CCSkin *)node;
CCTextureAtlas *textureAtlas = skin->getTextureAtlas();
bool blendDirty = bone->isBlendDirty();
if(m_pAtlas != textureAtlas || blendDirty)
{
if (m_pAtlas)
{
if(CBTextureAtlas* pAtlas = dynamic_cast<CBTextureAtlas *>(m_pAtlas)) {
pAtlas->drawQuadsEx();
} else {
m_pAtlas->drawQuads();
}
m_pAtlas->removeAllQuads();
}
}
m_pAtlas = textureAtlas;
if (m_pAtlas->getCapacity() == m_pAtlas->getTotalQuads() && !m_pAtlas->resizeCapacity(m_pAtlas->getCapacity() * 2))
return;
skin->updateTransform();
if (blendDirty)
{
ccBlendFunc func = bone->getBlendFunc();
ccGLBlendFunc(func.src, func.dst);
if(CBTextureAtlas* pAtlas = dynamic_cast<CBTextureAtlas *>(m_pAtlas)) {
pAtlas->drawQuadsEx();
} else {
m_pAtlas->drawQuads();
}
m_pAtlas->removeAllQuads();
ccGLBlendFunc(m_sBlendFunc.src, m_sBlendFunc.dst);
bone->setBlendDirty(false);
}
}
break;
case CS_DISPLAY_ARMATURE:
{
CCArmature *armature = (CCArmature *)(node);
CCTextureAtlas *textureAtlas = armature->getTextureAtlas();
if(m_pAtlas != textureAtlas)
{
if (m_pAtlas)
{
if(CBTextureAtlas* pAtlas = dynamic_cast<CBTextureAtlas *>(m_pAtlas)) {
pAtlas->drawQuadsEx();
} else {
m_pAtlas->drawQuads();
}
m_pAtlas->removeAllQuads();
}
}
armature->draw();
m_pAtlas = armature->getTextureAtlas();
}
break;
default:
{
if (m_pAtlas)
{
if(CBTextureAtlas* pAtlas = dynamic_cast<CBTextureAtlas *>(m_pAtlas)) {
pAtlas->drawQuadsEx();
} else {
m_pAtlas->drawQuads();
}
m_pAtlas->removeAllQuads();
}
node->visit();
//.........这里部分代码省略.........