mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
Do not try to continuously reload failed textures
This commit is contained in:
parent
30819b3b0c
commit
58d2d67e77
4 changed files with 27 additions and 11 deletions
|
@ -812,12 +812,16 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Fetch next image to process
|
||||
if(imageque.Count > 0) image = imageque.Dequeue();
|
||||
}
|
||||
|
||||
|
||||
// Any image to process?
|
||||
if(image != null)
|
||||
{
|
||||
// Load this image?
|
||||
if(image.IsReferenced && (image.ImageState != ImageLoadState.Ready))
|
||||
// If image was already loaded during this "resource epoch" and failed, don't reload it
|
||||
if (image.LoadFailed)
|
||||
continue;
|
||||
|
||||
// Load this image?
|
||||
if (image.IsReferenced && (image.ImageState != ImageLoadState.Ready))
|
||||
{
|
||||
image.LoadImage();
|
||||
}
|
||||
|
@ -904,6 +908,9 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (image == null)
|
||||
Thread.Sleep(1);
|
||||
}
|
||||
while (true);
|
||||
}
|
||||
|
@ -3182,14 +3189,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Set used on all textures
|
||||
foreach(KeyValuePair<long, ImageData> i in textures)
|
||||
{
|
||||
if (i.Value.LoadFailed)
|
||||
continue;
|
||||
i.Value.SetUsedInMap(usedtextures.ContainsKey(i.Key));
|
||||
if(i.Value.IsImageLoaded != i.Value.IsReferenced) ProcessImage(i.Value);
|
||||
if(i.Value.LoadFailed && i.Value.IsImageLoaded != i.Value.IsReferenced) ProcessImage(i.Value);
|
||||
}
|
||||
|
||||
// Set used on all flats
|
||||
foreach(KeyValuePair<long, ImageData> i in flats)
|
||||
{
|
||||
i.Value.SetUsedInMap(usedtextures.ContainsKey(i.Key));
|
||||
if (i.Value.LoadFailed)
|
||||
continue;
|
||||
i.Value.SetUsedInMap(usedtextures.ContainsKey(i.Key));
|
||||
if(i.Value.IsImageLoaded != i.Value.IsReferenced) ProcessImage(i.Value);
|
||||
}
|
||||
}
|
||||
|
@ -3199,14 +3210,18 @@ namespace CodeImp.DoomBuilder.Data
|
|||
// Set used on all textures
|
||||
foreach(KeyValuePair<long, ImageData> i in textures)
|
||||
{
|
||||
i.Value.SetUsedInMap(usedtextures.ContainsKey(i.Key));
|
||||
if (i.Value.LoadFailed)
|
||||
continue;
|
||||
i.Value.SetUsedInMap(usedtextures.ContainsKey(i.Key));
|
||||
if(i.Value.IsImageLoaded != i.Value.IsReferenced) ProcessImage(i.Value);
|
||||
}
|
||||
|
||||
// Set used on all flats
|
||||
foreach(KeyValuePair<long, ImageData> i in flats)
|
||||
{
|
||||
i.Value.SetUsedInMap(usedflats.ContainsKey(i.Key));
|
||||
if (i.Value.LoadFailed)
|
||||
continue;
|
||||
i.Value.SetUsedInMap(usedflats.ContainsKey(i.Key));
|
||||
if(i.Value.IsImageLoaded != i.Value.IsReferenced) ProcessImage(i.Value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
lock(img)
|
||||
{
|
||||
// Load image if needed
|
||||
if(!img.IsImageLoaded) img.LoadImage(false);
|
||||
if(!img.IsImageLoaded && !img.LoadFailed) img.LoadImage(false);
|
||||
int imagewidth, imageheight;
|
||||
Bitmap image = img.GetBitmap(); //mxd
|
||||
Bitmap preview;
|
||||
|
|
|
@ -123,7 +123,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
catch(Exception e)
|
||||
{
|
||||
// Unable to make bitmap
|
||||
messages.Add(new LogMessage(ErrorType.Warning, "Unable to load texture image \"" + this.Name + "\". " + e.GetType().Name + ": " + e.Message));
|
||||
messages.Add(new LogMessage(ErrorType.Error, "Unable to load texture image \"" + this.Name + "\". " + e.GetType().Name + ": " + e.Message));
|
||||
}
|
||||
|
||||
int missingpatches = 0; //mxd
|
||||
|
@ -136,7 +136,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
|
||||
// No patches!
|
||||
messages.Add(new LogMessage(ErrorType.Warning, "No patches are defined for texture \"" + this.Name + "\""));
|
||||
messages.Add(new LogMessage(ErrorType.Error, "No patches are defined for texture \"" + this.Name + "\""));
|
||||
}
|
||||
else if(!messages.Any(x => x.Type == ErrorType.Error))
|
||||
{
|
||||
|
|
|
@ -301,7 +301,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
// Check if the texture is loaded
|
||||
ImageData sprite = sprites[i];
|
||||
sprite.LoadImage();
|
||||
if (!sprite.IsImageLoaded && !sprite.LoadFailed)
|
||||
sprite.LoadImage();
|
||||
if(sprite.IsImageLoaded)
|
||||
{
|
||||
base.textures[i] = sprite;
|
||||
|
|
Loading…
Reference in a new issue