Fatal crash (Texture name input) #367

This commit is contained in:
Magnus Norddahl 2020-01-13 19:11:10 +01:00
parent a2b18f1893
commit 7ea64f910b
3 changed files with 5 additions and 5 deletions

View file

@ -230,7 +230,7 @@ namespace CodeImp.DoomBuilder.Data
// Load special images (mxd: the rest is loaded in LoadInternalTextures())
whitetexture = new ResourceImage("CodeImp.DoomBuilder.Resources.White.png") { UseColorCorrection = false };
blacktexture = new ResourceImage("CodeImp.DoomBuilder.Resources.Black.png") { UseColorCorrection = false }; //mxd
unknownimage = new UnknownImage(Properties.Resources.UnknownImage); //mxd. There should be only one!
unknownimage = new UnknownImage(); //mxd. There should be only one!
//mxd. Textures browser images
foldertexture = new ResourceImage("CodeImp.DoomBuilder.Resources.Folder96.png") { UseColorCorrection = false };

View file

@ -34,12 +34,12 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Constructor / Disposer
// Constructor
public UnknownImage(Bitmap image)
public UnknownImage()
{
// Initialize
this.width = 0;
this.height = 0;
this.loadbitmap = image;
this.loadbitmap = Properties.Resources.UnknownImage;
SetName("");
LoadImageNow();
@ -52,7 +52,7 @@ namespace CodeImp.DoomBuilder.Data
// This 'loads' the image
protected override LocalLoadResult LocalLoadImage()
{
return new LocalLoadResult(loadbitmap);
return new LocalLoadResult(new Bitmap(loadbitmap));
}
// This returns a preview image

View file

@ -55,7 +55,7 @@ namespace CodeImp.DoomBuilder.Editing
// Background
private string background = "";
private int backsource;
private ImageData backimage = new UnknownImage(null);
private ImageData backimage = new UnknownImage();
private int backoffsetx, backoffsety;
private float backscalex, backscaley;