diff --git a/Source/Core/VisualModes/VisualThing.cs b/Source/Core/VisualModes/VisualThing.cs index faf98b83..dffd4f56 100644 --- a/Source/Core/VisualModes/VisualThing.cs +++ b/Source/Core/VisualModes/VisualThing.cs @@ -224,12 +224,6 @@ namespace CodeImp.DoomBuilder.VisualModes geobuffers = null; } - if(textures != null) //mxd - { - foreach(ImageData texture in textures) texture.Dispose(); - textures = null; - } - if(cagebuffer != null) cagebuffer.Dispose(); //mxd cagebuffer = null; //mxd updategeo = true; diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs index 97e57b91..5c165b1d 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs @@ -276,14 +276,14 @@ namespace CodeImp.DoomBuilder.BuilderModes //mxd. Create verts for all sprite angles WorldVertex[][] allverts = new WorldVertex[info.SpriteFrame.Length][]; base.textures = new ImageData[info.SpriteFrame.Length]; + isloaded = true; for(int i = 0; i < sprites.Length; i++) { // Check if the texture is loaded ImageData sprite = sprites[i]; sprite.LoadImage(); - isloaded = sprite.IsImageLoaded; - if(isloaded) + if(sprite.IsImageLoaded) { float offsetx = 0.0f; float offsety = 0.0f; @@ -337,6 +337,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } else { + isloaded = false; base.textures[i] = General.Map.Data.Hourglass3D; // Determine sprite size @@ -493,17 +494,17 @@ namespace CodeImp.DoomBuilder.BuilderModes if(!isloaded) { //mxd. Rebuild sprite geometry when all sprites are loaded - bool allloaded = true; + isloaded = true; foreach(ImageData sprite in sprites) { if(!sprite.IsImageLoaded) { - allloaded = false; + isloaded = false; break; } } - if(allloaded) Setup(); + if(isloaded) Setup(); } // Let the base update