mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-19 06:51:09 +00:00
Fixed UI thread becoming unresponsible in case of missing textures
This commit is contained in:
parent
866facf80b
commit
78fe6c306e
4 changed files with 12 additions and 7 deletions
|
@ -246,14 +246,19 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
}
|
||||
|
||||
public void LoadImage()
|
||||
{
|
||||
LoadImage(true);
|
||||
}
|
||||
|
||||
// This loads the image
|
||||
public virtual void LoadImage()
|
||||
public virtual void LoadImage(bool notify)
|
||||
{
|
||||
// Do the loading
|
||||
LocalLoadImage();
|
||||
|
||||
// Notify the main thread about the change so that sectors can update their buffers
|
||||
General.MainWindow.ImageDataLoaded(this.name);
|
||||
if (notify) General.MainWindow.ImageDataLoaded(this.name);
|
||||
}
|
||||
|
||||
// This requests loading the image
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
lock(img)
|
||||
{
|
||||
// Load image if needed
|
||||
if(!img.IsImageLoaded) img.LoadImage();
|
||||
if(!img.IsImageLoaded) img.LoadImage(false);
|
||||
int imagewidth, imageheight;
|
||||
Bitmap image = img.GetBitmap(); //mxd
|
||||
Bitmap preview;
|
||||
|
|
|
@ -65,13 +65,13 @@ namespace CodeImp.DoomBuilder.Data
|
|||
#region ================== Methods
|
||||
|
||||
//mxd
|
||||
override public void LoadImage()
|
||||
override public void LoadImage(bool notify)
|
||||
{
|
||||
// Do the loading
|
||||
LocalLoadImage();
|
||||
|
||||
// Notify the main thread about the change to redraw display
|
||||
General.MainWindow.SpriteDataLoaded(this.Name);
|
||||
if (notify) General.MainWindow.SpriteDataLoaded(this.Name);
|
||||
}
|
||||
|
||||
// This loads the image
|
||||
|
|
|
@ -53,13 +53,13 @@ namespace CodeImp.DoomBuilder.Data
|
|||
|
||||
#region ================== Methods
|
||||
|
||||
override public void LoadImage()
|
||||
override public void LoadImage(bool notify)
|
||||
{
|
||||
// Do the loading
|
||||
LocalLoadImage();
|
||||
|
||||
// Notify the main thread about the change to redraw display
|
||||
General.MainWindow.SpriteDataLoaded(this.Name);
|
||||
if (notify) General.MainWindow.SpriteDataLoaded(this.Name);
|
||||
}
|
||||
|
||||
// This loads the image
|
||||
|
|
Loading…
Reference in a new issue