void CCCatmullRomSprite::draw() {
    // at least we need two points
    if(m_controlPoints.getCount() < 2)
        return;
    
	// build atlas
	if(m_dirty) {
		updateAtlas();
		m_dirty = false;
	}
	
	// profile start
	CC_PROFILER_START_CATEGORY(kCCProfilerCategorySprite, "CCCatmullRomSprite - draw");
	
	// setup
    CC_NODE_DRAW_SETUP();
	
	// blend func
	ccBlendFunc bf = m_sprite->getBlendFunc();
    ccGLBlendFunc(bf.src, bf.dst);
	
    // draw
	if(m_atlas) {
        if(m_allVisible) {
            m_atlas->drawQuadsEx();
        } else {
            int startIndex = 0;
            int sc = getSegmentCount();
            for(int i = 0; i < sc; i++) {
                bool visible = isSegmentVisible(i);
                if(!visible) {
                    int endIndex = m_segmentQuadIndices[i];
                    m_atlas->drawNumberOfQuadsEx(endIndex - startIndex, startIndex);
                    startIndex = m_segmentQuadIndices[i + 1];
                }
            }
            
            // last
            if(m_atlas->getTotalQuads() > startIndex) {
                m_atlas->drawNumberOfQuadsEx(m_atlas->getTotalQuads() - startIndex, startIndex);
            }
        }
    }
	
	// profile end
    CC_PROFILER_STOP_CATEGORY(kCCProfilerCategorySprite, "CCCatmullRomSprite - draw");
}
Ejemplo n.º 2
0
void DelaunayChecker::checkEuler()
{
    const int v = getVertexCount();
    std::cout << "V: " << v;

    const int e = getSegmentCount();
    std::cout << " E: " << e;

    const int f = getTriangleCount();
    std::cout << " F: " << f;

    const int t = getTetraCount();
    std::cout << " T: " << t;

    const int euler = v - e + f - t;
    std::cout << " Euler: " << euler << std::endl;

    std::cout << "Euler check: " << ( ( 0 != euler ) ? " ***Fail***" : " Pass" ) << std::endl;

    return;
}