public void CompleteBackgroundLoading()
{
idImage image;
BackgroundDownload backgroundDownload;
List<idImage> complete = new List<idImage>();
foreach(KeyValuePair<idImage, BackgroundDownload> kvp in _backgroundImageLoads)
{
image = kvp.Key;
backgroundDownload = kvp.Value;
if(backgroundDownload.Completed == true)
{
backgroundDownload.Stream.Dispose();
backgroundDownload.Stream = null;
// upload the image
idConsole.Warning("TODO: image.UploadPrecompressedImage");
/*image->UploadPrecompressedImage( (byte *)image->bgl.file.buffer, image->bgl.file.length );
R_StaticFree( image->bgl.file.buffer );*/
complete.Add(image);
if(idE.CvarSystem.GetBool("image_showBackgroundLoads") == true)
{
idConsole.WriteLine("idImageManager.CompleteBackgroundLoading: {0}", image.Name);
}
}
}
foreach(idImage tmp in complete)
{
_backgroundImageLoads.Remove(tmp);
}
// TODO
/*if ( image_showBackgroundLoads.GetBool() ) {
static int prev;
if ( numActiveBackgroundImageLoads != prev ) {
prev = numActiveBackgroundImageLoads;
common->Printf( "background Loads: %i\n", numActiveBackgroundImageLoads );
}
}*/
}