// if available, increment reference count, and return the image. // else, add to the queue list if appropriate. bool CGUILargeTextureManager::GetImage(const CStdString &path, CTextureArray &texture, bool firstRequest) { CSingleLock lock(m_listSection); if (path == "image://http%3a%2f%2fcf2.imgobject.com%2ft%2fp%2foriginal%2frXhuBgQyRKB7cW5BRImyVkO89K7.jpg/") { int a = 0; } for (listIterator it = m_allocated.begin(); it != m_allocated.end(); ++it) { CLargeTexture *image = *it; if (image->GetPath() == path) { if (firstRequest) image->AddRef(); texture = image->GetTexture(); return texture.size() > 0; } } if (firstRequest) QueueImage(path); return true; }
// if available, increment reference count, and return the image. // else, add to the queue list if appropriate. bool CGUILargeTextureManager::GetImage(const std::string &path, CTextureArray &texture, bool firstRequest, const bool useCache) { CSingleLock lock(m_listSection); for (listIterator it = m_allocated.begin(); it != m_allocated.end(); ++it) { CLargeTexture *image = *it; if (image->GetPath() == path) { if (firstRequest) image->AddRef(); texture = image->GetTexture(); return texture.size() > 0; } } if (firstRequest) QueueImage(path, useCache); return true; }
// if available, increment reference count, and return the image. // else, add to the queue list if appropriate. bool CGUILargeTextureManager::GetImage(const CStdString &path, CTextureArray &texture, bool firstRequest) { // note: max size to load images: 2048x1024? (8MB) CSingleLock lock(m_listSection); for (listIterator it = m_allocated.begin(); it != m_allocated.end(); ++it) { CLargeTexture *image = *it; if (image->GetPath() == path) { if (firstRequest) image->AddRef(); texture = image->GetTexture(); return texture.size() > 0; } } if (firstRequest) QueueImage(path); return true; }