本文整理汇总了C++中CAView::getAtlasIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ CAView::getAtlasIndex方法的具体用法?C++ CAView::getAtlasIndex怎么用?C++ CAView::getAtlasIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAView
的用法示例。
在下文中一共展示了CAView::getAtlasIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: atlasIndexForSubview
unsigned int CABatchView::atlasIndexForSubview(CAView *view, int nZ)
{
const CAVector<CAView*>& pBrothers = view->getSuperview()->getSubviews();
unsigned int uSubviewIndex = (unsigned int)pBrothers.getIndex(view);
bool bIgnoreParent = (CABatchView*)(view->getSuperview()) == this;
CAView *pPrevious = NULL;
if (uSubviewIndex > 0 && uSubviewIndex < UINT_MAX)
{
pPrevious = (CAView*)(pBrothers.at(uSubviewIndex - 1));
}
if (bIgnoreParent)
{
if (uSubviewIndex == 0)
{
return 0;
}
return highestAtlasIndexInSubview(pPrevious) + 1;
}
if (uSubviewIndex == 0)
{
CAView *p = (CAView*)(view->getSuperview());
if (nZ < 0)
{
return p->getAtlasIndex();
}
else
{
return p->getAtlasIndex() + 1;
}
}
else
{
if ((pPrevious->getZOrder() < 0 && nZ < 0) || (pPrevious->getZOrder() >= 0 && nZ >= 0))
{
return highestAtlasIndexInSubview(pPrevious) + 1;
}
CAView *p = (CAView*)(view->getSuperview());
return p->getAtlasIndex() + 1;
}
CCAssert(0, "should not run here");
return 0;
}
示例2: removeViewFromAtlas
void CABatchView::removeViewFromAtlas(CAView *view)
{
m_pobImageAtlas->removeQuadAtIndex(view->getAtlasIndex());
view->setBatch(NULL);
unsigned int uIndex = (unsigned int)m_obDescendants.getIndex(view);
if (uIndex != UINT_MAX)
{
m_obDescendants.erase(uIndex);
unsigned int count = (unsigned int)m_obDescendants.size();
for(; uIndex < count; ++uIndex)
{
CAView* s = m_obDescendants.at(uIndex);
s->setAtlasIndex(s->getAtlasIndex() - 1);
}
}
CAVector<CAView*>::const_iterator itr;
for (itr=view->getSubviews().begin(); itr!=view->getSubviews().end(); itr++)
{
removeViewFromAtlas(*itr);
}
}