Beispiel #1
0
void CCSceneBase::renderObjects(const CCCameraBase *inCamera, const CCRenderPass pass, const bool alpha)
{
#if defined PROFILEON
    CCProfiler profile( "CCSceneBase::renderObjects()" );
#endif

    for( int i=0; i<objects.length; ++i )
    {
        CCObject *object = objects.list[i];
        if( object->renderPass == pass )
        {
            if( object->isActive() && ( object->octreeRender == false ) )
            {
                object->renderObject( inCamera, alpha );
            }
        }
    }
}
Beispiel #2
0
bool CCSceneBase::updateScene(const CCTime &time)
{
    bool updated = false;

    for( int i=0; i<objects.length; ++i )
    {
        CCObject *object = objects.list[i];
        if( object->isActive() )
        {
            updated |= object->update( time );
        }
        else if( object->deleteMe > 0 )
        {
            if( --object->deleteMe == 0 )
            {
                DELETE_OBJECT( object );
                --i;
            }
        }
    }

    return updated;
}