mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-21 19:40:58 +00:00
Restore classic pasting mode quirks & undo some optimizations for it to fix bugs
This commit is contained in:
parent
3c176d2178
commit
1415309079
3 changed files with 26 additions and 14 deletions
|
@ -1095,11 +1095,16 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
map.EndAddRemove();
|
||||
|
||||
// Filter old lines and vertices by edited area
|
||||
RectangleF editarea = MapSet.CreateArea(newlines);
|
||||
editarea = MapSet.IncreaseArea(editarea, mergeverts);
|
||||
editarea.Inflate(1.0f, 1.0f);
|
||||
List<Linedef> oldlines = new List<Linedef>(MapSet.FilterByArea(alllines, ref editarea));
|
||||
nonmergeverts = new List<Vertex>(MapSet.FilterByArea(nonmergeverts, ref editarea));
|
||||
List<Linedef> oldlines = alllines;
|
||||
|
||||
if (General.Settings.MergeGeometryMode != MergeGeometryMode.CLASSIC)
|
||||
{
|
||||
RectangleF editarea = MapSet.CreateArea(newlines);
|
||||
editarea = MapSet.IncreaseArea(editarea, mergeverts);
|
||||
editarea.Inflate(1.0f, 1.0f);
|
||||
oldlines = new List<Linedef>(MapSet.FilterByArea(alllines, ref editarea));
|
||||
nonmergeverts = new List<Vertex>(MapSet.FilterByArea(nonmergeverts, ref editarea));
|
||||
}
|
||||
|
||||
/***************************************************\
|
||||
Find a way to close the drawing
|
||||
|
|
|
@ -2182,9 +2182,8 @@ namespace CodeImp.DoomBuilder.Map
|
|||
/// <summary>
|
||||
/// Stitches marked geometry with non-marked geometry. Returns false when the operation failed.
|
||||
/// </summary>
|
||||
public bool StitchGeometry() { return StitchGeometry(MergeGeometryMode.CLASSIC, false); } //mxd. Compatibility TODO: figure out why this is needed and kill it
|
||||
public bool StitchGeometry(MergeGeometryMode mergemode) { return StitchGeometry(mergemode, true); } //sphere: Compatibility
|
||||
public bool StitchGeometry(MergeGeometryMode mergemode, bool fixsectors)
|
||||
public bool StitchGeometry() { return StitchGeometry(MergeGeometryMode.CLASSIC); } //mxd. Compatibility
|
||||
public bool StitchGeometry(MergeGeometryMode mergemode)
|
||||
{
|
||||
// Find vertices
|
||||
HashSet<Vertex> movingverts = new HashSet<Vertex>(General.Map.Map.GetMarkedVertices(true));
|
||||
|
@ -2200,7 +2199,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
RectangleF editarea = CreateArea(movinglines);
|
||||
editarea = IncreaseArea(editarea, movingverts);
|
||||
editarea.Inflate(1.0f, 1.0f);
|
||||
fixedverts = FilterByArea(fixedverts, ref editarea);
|
||||
|
||||
if (mergemode != MergeGeometryMode.CLASSIC)
|
||||
fixedverts = FilterByArea(fixedverts, ref editarea);
|
||||
|
||||
// Join nearby vertices
|
||||
BeginAddRemove();
|
||||
|
@ -2293,7 +2294,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
}
|
||||
|
||||
//mxd. Correct sector references
|
||||
if (fixsectors)
|
||||
if (mergemode != MergeGeometryMode.CLASSIC)
|
||||
{
|
||||
// Linedefs cache needs to be up to date...
|
||||
Update(true, false);
|
||||
|
@ -2310,6 +2311,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
else
|
||||
{
|
||||
FlipBackwardLinedefs(changedlines);
|
||||
CorrectOuterSides(new HashSet<Linedef>(changedlines));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1815,11 +1815,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
HashSet<Sidedef> newsides = new HashSet<Sidedef>(General.Map.Map.GetMarkedSidedefs(true));
|
||||
HashSet<Linedef> oldlines = new HashSet<Linedef>(General.Map.Map.GetMarkedLinedefs(false));
|
||||
|
||||
RectangleF editarea = MapSet.CreateArea(oldlines);
|
||||
|
||||
// Determine area in which we are editing
|
||||
RectangleF editarea = MapSet.CreateArea(General.Map.Map.GetMarkedLinedefs(true));
|
||||
editarea = MapSet.IncreaseArea(editarea, General.Map.Map.GetMarkedVertices(true));
|
||||
editarea.Inflate(1.0f, 1.0f);
|
||||
//oldlines = MapSet.FilterByArea(oldlines, ref editarea);
|
||||
if (General.Settings.MergeGeometryMode != MergeGeometryMode.CLASSIC)
|
||||
{
|
||||
editarea = MapSet.CreateArea(General.Map.Map.GetMarkedLinedefs(true));
|
||||
editarea = MapSet.IncreaseArea(editarea, General.Map.Map.GetMarkedVertices(true));
|
||||
editarea.Inflate(1.0f, 1.0f);
|
||||
//oldlines = MapSet.FilterByArea(oldlines, ref editarea);
|
||||
}
|
||||
|
||||
//mxd. Let's use a blockmap...
|
||||
BlockMap<BlockEntry> blockmap = new BlockMap<BlockEntry>(editarea);
|
||||
|
|
Loading…
Reference in a new issue