mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Visual Mode: Store slope vertices in a separate list, to prevent iterating over all things for every single vertex slope linedef found.
This commit is contained in:
parent
34831d6042
commit
8ef05744f9
1 changed files with 27 additions and 20 deletions
|
@ -818,6 +818,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
Dictionary<int, List<Sector>> sectortags = new Dictionary<int, List<Sector>>();
|
||||
List<Thing> slopethings = new List<Thing>();
|
||||
sectordata = new Dictionary<Sector, SectorData>(General.Map.Map.Sectors.Count);
|
||||
thingdata = new Dictionary<Thing, ThingData>(General.Map.Map.Things.Count);
|
||||
|
||||
|
@ -847,6 +848,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
if (!General.Settings.GZDoomRenderingEffects) return; //mxd
|
||||
|
||||
if (General.Map.SRB2)
|
||||
{
|
||||
// Find all slope vertex things and store them
|
||||
foreach (Thing t in General.Map.Map.Things)
|
||||
{
|
||||
if (t.IsSlopeVertex) slopethings.Add(t);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Sector s in General.Map.Map.Sectors)
|
||||
{
|
||||
// Find all sector whose tag is not 0 and hash them so that we can find them quickly
|
||||
|
@ -1053,15 +1063,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Sidedef side = (l.Args[0] == 0 || l.Args[0] == 1) ? l.Front : l.Back;
|
||||
Sector s = side.Sector;
|
||||
|
||||
//If NOKNUCKLES is set, use tag, X offset and Y offset to search for slope vertices.
|
||||
//If Effect 6 is set, use tag, X offset and Y offset to search for slope vertices.
|
||||
if (l.IsFlagSet("8192"))
|
||||
{
|
||||
bool foundtag = false;
|
||||
bool foundxoffset = false;
|
||||
bool foundyoffset = false;
|
||||
foreach (Thing t in General.Map.Map.Things)
|
||||
{
|
||||
if (t.IsSlopeVertex)
|
||||
foreach (Thing t in slopethings)
|
||||
{
|
||||
if (!foundtag && (int)t.AngleDoom == l.Tag)
|
||||
{
|
||||
|
@ -1079,15 +1087,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
foundyoffset = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//Otherwise, just use tag.
|
||||
else
|
||||
{
|
||||
foreach (Thing t in General.Map.Map.Things)
|
||||
foreach (Thing t in slopethings)
|
||||
{
|
||||
if (t.IsSlopeVertex && (int)t.AngleDoom == l.Tag) slopevertices.Add(t);
|
||||
if ((int)t.AngleDoom == l.Tag) slopevertices.Add(t);
|
||||
}
|
||||
}
|
||||
if (slopevertices.Count >= 3)
|
||||
|
|
Loading…
Reference in a new issue