public void RequestTexture(UUID textureID, ImageType type)
{
lock (syncObject)
{
if (client.Assets.Cache.HasImage(textureID))
{
// Add to rendering dictionary
if (!completedDownloads.ContainsKey(textureID))
{
completedDownloads.Add(textureID, client.Assets.Cache.GetCachedImage(textureID));
// Let any subscribers know about it
if (OnDownloadFinished != null)
OnDownloadFinished(textureID, true);
}
else
{
// This image has already been served up, ignore this request
}
}
else
{
// Make sure the request isn't already queued up
foreach (TaskInfo task in requestQueue)
{
if (task.RequestID == textureID)
return;
}
// Make sure we aren't already downloading the texture
if (!currentRequests.ContainsKey(textureID))
requestQueue.Add(new TaskInfo(textureID, 0, type));
}
}
}