mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
Re-fixed, Visual mode: in some cases some D3D textures were not disposed after closing a map, eventually resulting in E_OUTOFMEMORY crash.
Fixed, Preferences window: some folding settings were not applied in the Script Editor preview control. Changed, Visual mode: increased z-buffer depth to 24 bits. Z-fighting among far away but close to each other surfaces should be less noticeable now.
This commit is contained in:
parent
7691ec087e
commit
3b90d100ff
4 changed files with 34 additions and 12 deletions
|
@ -289,7 +289,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Instruct the lexer to calculate folding
|
||||
scriptedit.SetProperty("fold", "1");
|
||||
scriptedit.SetProperty("fold.compact", "1");
|
||||
scriptedit.SetProperty("fold.compact", "0"); // 1 = folds blank lines
|
||||
scriptedit.SetProperty("fold.comment", "1"); // Enable block comment folding
|
||||
scriptedit.SetProperty("fold.preprocessor", "1"); // Enable #region folding
|
||||
scriptedit.SetFoldFlags(FoldFlags.LineAfterContracted); // Draw line below if not expanded
|
||||
|
||||
// Configure a margin to display folding symbols
|
||||
scriptedit.Margins[2].Type = MarginType.Symbol;
|
||||
|
|
|
@ -530,6 +530,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
foreach(KeyValuePair<long, ImageData> i in textures) i.Value.Dispose();
|
||||
foreach(KeyValuePair<long, ImageData> i in flats) i.Value.Dispose();
|
||||
foreach(KeyValuePair<long, ImageData> i in sprites) i.Value.Dispose();
|
||||
foreach(KeyValuePair<string, ImageData> i in internalsprites) i.Value.Dispose(); //mxd
|
||||
palette = null;
|
||||
|
||||
//mxd. Dispose models
|
||||
|
|
|
@ -462,6 +462,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if((width != texture.GetLevelDescription(0).Width) || (height != texture.GetLevelDescription(0).Height))
|
||||
throw new Exception("Could not create a texture with the same size as the image.");
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
texture.Tag = name; //mxd. Helps with tracking undisposed resources...
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using SlimDX.Direct3D9;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Geometry;
|
||||
using SlimDX;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.Controls;
|
||||
using SlimDX.Direct3D9;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -109,16 +109,30 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
rendertarget = null;
|
||||
if(backbuffer != null) backbuffer.Dispose();
|
||||
if(depthbuffer != null) depthbuffer.Dispose();
|
||||
if(device != null)
|
||||
{
|
||||
device.Reset(new PresentParameters()); //mxd. Some video memory is not freed without this line if Visual mode was visited
|
||||
device.Dispose();
|
||||
}
|
||||
if(font != null) font.Dispose();
|
||||
if(fonttexture != null) fonttexture.Dispose();
|
||||
isrendering = false; //mxd
|
||||
if(device != null) device.Dispose();
|
||||
|
||||
if(ObjectTable.Objects.Count > 1) //mxd. Direct3D itself is not disposed while the editor is running
|
||||
{
|
||||
//mxd. Get rid of any remaining D3D objects...
|
||||
foreach(ComObject o in ObjectTable.Objects)
|
||||
{
|
||||
if(o is Direct3D) continue; // Don't dispose the device itself...
|
||||
General.WriteLogLine("WARNING: D3D resource " + o
|
||||
+ (o.Tag != null ? " (" + o.Tag + ")" : string.Empty) + " was not disposed properly!"
|
||||
+ (o.CreationSource != null ? " Stack trace: " + o.CreationSource : string.Empty));
|
||||
o.Dispose();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
General.ShowWarningMessage("Some D3D resources were not disposed properly! See the event log for more details.",
|
||||
MessageBoxButtons.OK);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Done
|
||||
isrendering = false; //mxd
|
||||
isdisposed = true;
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +327,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
displaypp.BackBufferWidth = rendertarget.ClientSize.Width;
|
||||
displaypp.BackBufferHeight = rendertarget.ClientSize.Height;
|
||||
displaypp.EnableAutoDepthStencil = true;
|
||||
displaypp.AutoDepthStencilFormat = Format.D16;
|
||||
displaypp.AutoDepthStencilFormat = Format.D24X8; //Format.D16;
|
||||
displaypp.Multisample = MultisampleType.None;
|
||||
displaypp.PresentationInterval = PresentInterval.Immediate;
|
||||
|
||||
|
|
Loading…
Reference in a new issue