mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-04-22 01:10:57 +00:00
Merged in GZDB r2498.
This commit is contained in:
parent
6ad64c1cc0
commit
3e0adfbc4e
4 changed files with 54 additions and 32 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;
|
||||
|
|
|
@ -532,7 +532,8 @@ 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();
|
||||
palette = null;
|
||||
foreach (KeyValuePair<string, ImageData> i in internalsprites) i.Value.Dispose(); //mxd
|
||||
palette = null;
|
||||
|
||||
//mxd. Dispose models
|
||||
foreach(KeyValuePair<int, ModelData> i in modeldefentries) i.Value.Dispose();
|
||||
|
|
|
@ -462,8 +462,12 @@ 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This updates a dynamic texture
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -100,28 +100,42 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// Disposer
|
||||
public void Dispose()
|
||||
{
|
||||
// Not already disposed?
|
||||
if(!isdisposed)
|
||||
{
|
||||
// Clean up
|
||||
foreach(ID3DResource res in resources) res.UnloadResource();
|
||||
if(shaders != null) shaders.Dispose();
|
||||
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();
|
||||
}
|
||||
// Not already disposed?
|
||||
if (!isdisposed)
|
||||
{
|
||||
// Clean up
|
||||
foreach (ID3DResource res in resources) res.UnloadResource();
|
||||
if (shaders != null) shaders.Dispose();
|
||||
rendertarget = null;
|
||||
if (backbuffer != null) backbuffer.Dispose();
|
||||
if (depthbuffer != null) depthbuffer.Dispose();
|
||||
if (font != null) font.Dispose();
|
||||
if(fonttexture != null) fonttexture.Dispose();
|
||||
isrendering = false; //mxd
|
||||
|
||||
// Done
|
||||
isdisposed = true;
|
||||
}
|
||||
}
|
||||
if (fonttexture != null) fonttexture.Dispose();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -314,9 +328,9 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
displaypp.BackBufferWidth = rendertarget.ClientSize.Width;
|
||||
displaypp.BackBufferHeight = rendertarget.ClientSize.Height;
|
||||
displaypp.EnableAutoDepthStencil = true;
|
||||
displaypp.AutoDepthStencilFormat = Format.D16;
|
||||
displaypp.Multisample = MultisampleType.None;
|
||||
displaypp.PresentationInterval = PresentInterval.Immediate;
|
||||
displaypp.AutoDepthStencilFormat = Format.D24X8; //Format.D16;
|
||||
displaypp.Multisample = MultisampleType.None;
|
||||
displaypp.PresentationInterval = PresentInterval.Immediate;
|
||||
|
||||
// Return result
|
||||
return displaypp;
|
||||
|
|
Loading…
Reference in a new issue