コード例 #1
0
void CGUILargeTextureManager::OnJobComplete(unsigned int jobID, bool success, CJob *job)
{
  // see if we still have this job id
  CSingleLock lock(m_listSection);
  for (queueIterator it = m_queued.begin(); it != m_queued.end(); ++it)
  {
    if (it->first == jobID)
    { // found our job
      CImageLoader *loader = (CImageLoader *)job;
      CLargeTexture *image = it->second;
      image->SetTexture(loader->m_texture);
      loader->m_texture = NULL; // we want to keep the texture, and jobs are auto-deleted.
      m_queued.erase(it);
      m_allocated.push_back(image);
      return;
    }
  }
}
コード例 #2
0
ファイル: GUILargeTextureManager.cpp プロジェクト: xsedo/xbmc
void CGUILargeTextureManager::OnJobComplete(unsigned int jobID, bool success, CJob *job)
{
  // see if we still have this job id
  CSingleLock lock(m_listSection);

  for (queueIterator it = m_queued.begin(); it != m_queued.end(); ++it)
  {
    if (it->first == jobID)
    { // found our job
      CImageLoader *loader = (CImageLoader *)job;
      CLargeTexture *image = it->second;
      image->SetTexture(loader->m_texture);
      loader->m_texture = NULL; // we want to keep the texture, and jobs are auto-deleted.
      m_queued.erase(it);
      m_allocated.push_back(image);
#if defined(__VIDONME_MEDIACENTER__)
      break;
#else
      return;
#endif
    }
  }

#if defined(__VIDONME_MEDIACENTER__)
  if (!m_queImageLoaders.empty())
  {
    typedef std::pair<CImageLoader*, int> LoaderPair;
    LoaderPair loaderPair = *m_queImageLoaders.begin();
    
    unsigned int jobID = CJobManager::GetInstance().AddJob(loaderPair.first, this, CJob::PRIORITY_NORMAL);
    CLargeTexture *image = new CLargeTexture(loaderPair.first->m_path);
    while (loaderPair.second-- > 1)
    {
      image->AddRef();
    }

    m_queued.push_back(make_pair(jobID, image));
    m_queImageLoaders.pop_front();
  }
#endif
}