mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-18 18:11:13 +00:00
Fixed, Things mode, curved event lines: in some cases IsCurved property was not applied to all InterpolationPoints in a path.
This commit is contained in:
parent
527d3cf5dc
commit
1b26fa35f1
1 changed files with 26 additions and 11 deletions
|
@ -53,6 +53,23 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||||
nextnodes = new Dictionary<int, PathNode>();
|
nextnodes = new Dictionary<int, PathNode>();
|
||||||
prevnodes = new Dictionary<int, PathNode>();
|
prevnodes = new Dictionary<int, PathNode>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void PropagateCurvedFlag()
|
||||||
|
{
|
||||||
|
if(!IsCurved) return;
|
||||||
|
foreach(PathNode node in nextnodes.Values)
|
||||||
|
{
|
||||||
|
if(node.IsCurved) continue;
|
||||||
|
node.IsCurved = true;
|
||||||
|
node.PropagateCurvedFlag();
|
||||||
|
}
|
||||||
|
foreach(PathNode node in prevnodes.Values)
|
||||||
|
{
|
||||||
|
if(node.IsCurved) continue;
|
||||||
|
node.IsCurved = true;
|
||||||
|
node.PropagateCurvedFlag();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Line3D> GetThingLinks(IEnumerable<VisualThing> visualthings)
|
public static List<Line3D> GetThingLinks(IEnumerable<VisualThing> visualthings)
|
||||||
|
@ -296,21 +313,19 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
||||||
foreach(PathNode targetnode in result.InterpolationPoints[targettag])
|
foreach(PathNode targetnode in result.InterpolationPoints[targettag])
|
||||||
{
|
{
|
||||||
// Connect both ways
|
// Connect both ways
|
||||||
if(!node.NextNodes.ContainsKey(targetnode.Thing.Index))
|
if(!node.NextNodes.ContainsKey(targetnode.Thing.Index)) node.NextNodes.Add(targetnode.Thing.Index, targetnode);
|
||||||
{
|
if(!targetnode.PreviousNodes.ContainsKey(node.Thing.Index)) targetnode.PreviousNodes.Add(node.Thing.Index, node);
|
||||||
node.NextNodes.Add(targetnode.Thing.Index, targetnode);
|
|
||||||
if(targetnode.IsCurved) node.IsCurved = true;
|
|
||||||
}
|
|
||||||
if(!targetnode.PreviousNodes.ContainsKey(node.Thing.Index))
|
|
||||||
{
|
|
||||||
targetnode.PreviousNodes.Add(node.Thing.Index, node);
|
|
||||||
if(node.IsCurved) targetnode.IsCurved = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Make lines
|
// 2. Propagate IsCurved flag
|
||||||
|
foreach(KeyValuePair<int, List<PathNode>> group in result.InterpolationPoints)
|
||||||
|
{
|
||||||
|
foreach(PathNode node in group.Value) node.PropagateCurvedFlag();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Make lines
|
||||||
HashSet<int> processedindices = new HashSet<int>();
|
HashSet<int> processedindices = new HashSet<int>();
|
||||||
foreach(KeyValuePair<int, List<PathNode>> group in result.InterpolationPoints)
|
foreach(KeyValuePair<int, List<PathNode>> group in result.InterpolationPoints)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue