Ejemplo n.º 1
0
void CResourceManager::OnDownloadGroupFinished( void )
{
    // Clear downloading flags
    for ( std::list < CResource* > ::const_iterator iter = m_resources.begin() ; iter != m_resources.end(); ++iter )
    {
        CResource* pResource = *iter;
        if ( pResource->IsDownloading() )
            pResource->SetIsDownloading( false );
    }

    // Start next download group
    UpdatePendingDownloads();

    // Try to load newly ready resources
    for ( std::list < CResource* > ::const_iterator iter = m_resources.begin() ; iter != m_resources.end(); ++iter )
    {
        CResource* pResource = *iter;
        if ( !pResource->IsActive() )
        {
            // Stop as soon as we hit a resource which hasn't downloaded yet (as per previous behaviour)
            if ( pResource->HasPendingFileDownloads() || pResource->IsDownloading() )
                break;
            pResource->Load();
        }
    }
}