本文整理汇总了C++中CCParticleSystem::getTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ CCParticleSystem::getTexture方法的具体用法?C++ CCParticleSystem::getTexture怎么用?C++ CCParticleSystem::getTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCParticleSystem
的用法示例。
在下文中一共展示了CCParticleSystem::getTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addParticleSystem
CCParticleSystem* ADParticleSystemCache::addParticleSystem( const char *pFileName )
{
CCParticleSystem *pRetPart = NULL;
ParticleSystemBatchMap::iterator iter = m_particleBatchesIdle.find( pFileName );
if( iter == m_particleBatchesIdle.end() )
{
pRetPart = CCParticleSystemQuad::create( pFileName );
CCParticleBatchNode *pNode = CCParticleBatchNode::createWithTexture( pRetPart->getTexture(), 100 );
m_pRootNode->addChild( pNode );
pNode->addChild( pRetPart );
m_particleBatchesUsed[pFileName]._pBatchNode = pNode;
m_particleBatchesIdle[pFileName]._pBatchNode = pNode;
}
else
{
if( iter->second._particleSystems.empty() )
{
pRetPart = _createNewParticleSystem( pFileName, iter->second._pBatchNode );
iter->second._particleSystems.push_back( pRetPart );
}
else
{
pRetPart = iter->second._particleSystems.front();
iter->second._particleSystems.pop_front();
}
}
CCAssert( pRetPart != NULL, " add particle system error " );
m_particleBatchesUsed[pFileName]._particleSystems.push_back( pRetPart );
return pRetPart;
}
示例2: addChild
void CCParticleBatchNode::addChild(CCNode * child, int zOrder, int tag)
{
CCAssert( child != NULL, "Argument must be non-NULL");
CCAssert( dynamic_cast<CCParticleSystem*>(child) != NULL, "CCParticleBatchNode only supports CCQuadParticleSystems as children");
CCParticleSystem* pChild = (CCParticleSystem*)child;
CCAssert( pChild->getTexture()->getName() == m_pTextureAtlas->getTexture()->getName(), "CCParticleSystem is not using the same texture id");
// If this is the 1st children, then copy blending function
if( m_pChildren->count() == 0 )
{
setBlendFunc(pChild->getBlendFunc());
}
CCAssert( m_tBlendFunc.src == pChild->getBlendFunc().src && m_tBlendFunc.dst == pChild->getBlendFunc().dst, "Can't add a PaticleSystem that uses a different blending function");
//no lazy sorting, so don't call super addChild, call helper instead
unsigned int pos = addChildHelper(pChild,zOrder,tag);
//get new atlasIndex
unsigned int atlasIndex = 0;
if (pos != 0)
{
CCParticleSystem* p = (CCParticleSystem*)m_pChildren->objectAtIndex(pos-1);
atlasIndex = p->getAtlasIndex() + p->getTotalParticles();
}
else
{
atlasIndex = 0;
}
insertChild(pChild, atlasIndex);
// update quad info
pChild->setBatchNode(this);
}