few bugfixes

This commit is contained in:
codeimp 2008-05-08 13:44:48 +00:00
parent 8f8690aac3
commit 33d2af5417
3 changed files with 24 additions and 3 deletions

View file

@ -136,6 +136,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
List<Vertex> intersectverts = new List<Vertex>();
List<Linedef> newlines = new List<Linedef>();
List<Linedef> oldlines = new List<Linedef>(General.Map.Map.Linedefs);
List<Sidedef> insidesides = new List<Sidedef>();
List<Vertex> mergeverts = new List<Vertex>();
List<Vertex> nonmergeverts = new List<Vertex>(General.Map.Map.Vertices);
@ -420,6 +421,9 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
// Go for all sidedefs in this new sector
foreach(Sidedef sd in newsector.Sidedefs)
{
// Keep list of sides inside created sectors
insidesides.Add(sd);
// Side matches with a side of our new lines?
int lineindex = newlines.IndexOf(sd.Line);
if(lineindex > -1)
@ -486,6 +490,17 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
// Make corrections for backward linedefs
MapSet.FlipBackwardLinedefs(newlines);
// Remove all unneeded textures
foreach(Linedef ld in newlines)
{
if(ld.Front != null) ld.Front.RemoveUnneededTextures(true);
if(ld.Back != null) ld.Back.RemoveUnneededTextures(true);
}
foreach(Sidedef sd in insidesides)
{
sd.RemoveUnneededTextures(true);
}
// Snap to map format accuracy
General.Map.Map.SnapAllToAccuracy();

View file

@ -458,6 +458,7 @@ namespace CodeImp.DoomBuilder.Geometry
ls.Line.ApplySidedFlags();
}
original.CopyPropertiesTo(ls.Line.Front);
ApplyDefaultsToSidedef(ls.Line.Front);
}
else
{
@ -468,7 +469,11 @@ namespace CodeImp.DoomBuilder.Geometry
ls.Line.ApplySidedFlags();
}
original.CopyPropertiesTo(ls.Line.Back);
ApplyDefaultsToSidedef(ls.Line.Back);
}
// Update line
ls.Line.ApplySidedFlags();
}
// Return the new sector
@ -478,9 +483,9 @@ namespace CodeImp.DoomBuilder.Geometry
// This applies defaults to a sidedef
private static void ApplyDefaultsToSidedef(Sidedef sd)
{
if(sd.HighRequired()) sd.SetTextureHigh(General.Settings.DefaultTexture);
if(sd.MiddleRequired()) sd.SetTextureMid(General.Settings.DefaultTexture);
if(sd.LowRequired()) sd.SetTextureLow(General.Settings.DefaultTexture);
if(sd.HighRequired() && sd.HighTexture.StartsWith("-")) sd.SetTextureHigh(General.Settings.DefaultTexture);
if(sd.MiddleRequired() && sd.MiddleTexture.StartsWith("-")) sd.SetTextureMid(General.Settings.DefaultTexture);
if(sd.LowRequired() && sd.LowTexture.StartsWith("-")) sd.SetTextureLow(General.Settings.DefaultTexture);
}
// This applies defaults to a sector

View file

@ -298,6 +298,7 @@ namespace CodeImp.DoomBuilder.Interface
//
this.itemsavemapinto.Name = "itemsavemapinto";
this.itemsavemapinto.Size = new System.Drawing.Size(201, 22);
this.itemsavemapinto.Tag = "savemapinto";
this.itemsavemapinto.Text = "Save Map Into...";
this.itemsavemapinto.Click += new System.EventHandler(this.InvokeTaggedAction);
//