Only rebuild changed parts of the blockmap in visual mode

This commit is contained in:
Louis-Antoine 2019-09-20 17:30:17 +02:00 committed by sphere
parent fce59907eb
commit b1f3641f3c

View file

@ -1606,7 +1606,42 @@ namespace CodeImp.DoomBuilder.BuilderModes
sd.Sector.Marked = true; sd.Sector.Marked = true;
// Make new blockmap // Make new blockmap
FillBlockMap(); foreach (MapElement e in General.Map.Map.RemovedElements)
{
if (e is Linedef)
blockmap.RemoveLinedef(e as Linedef);
else if (e is Thing)
blockmap.RemoveThing(e as Thing);
else if (e is Sector)
blockmap.RemoveSector(e as Sector);
}
foreach (Linedef l in General.Map.Map.Linedefs)
{
if (l.Marked)
{
blockmap.RemoveLinedef(l);
blockmap.AddLinedef(l);
}
}
foreach (Thing t in General.Map.Map.Things)
{
if (t.Marked)
{
blockmap.RemoveThing(t);
blockmap.AddThing(t);
}
}
foreach (Sector s in General.Map.Map.Sectors)
{
if (s.Marked)
{
blockmap.RemoveSector(s);
blockmap.AddSector(s);
}
}
RebuildElementData(true); RebuildElementData(true);