mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-03-12 12:12:04 +00:00
hashset effectsectors
This commit is contained in:
parent
1050f80c52
commit
ead65ebd93
1 changed files with 11 additions and 15 deletions
|
@ -791,20 +791,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
internal void RebuildElementData()
|
||||
{
|
||||
//mxd
|
||||
Sector[] sectorsWithEffects = null;
|
||||
HashSet<Sector> effectsectors = null;
|
||||
bsp.Build();
|
||||
useblockmap = bsp.IsDeactivated;
|
||||
|
||||
if (!General.Settings.GZDoomRenderingEffects)
|
||||
{
|
||||
//store all sectors with effects
|
||||
//Store all sectors with effects
|
||||
if(sectordata != null && sectordata.Count > 0)
|
||||
{
|
||||
sectorsWithEffects = new Sector[sectordata.Count];
|
||||
sectordata.Keys.CopyTo(sectorsWithEffects, 0);
|
||||
}
|
||||
effectsectors = new HashSet<Sector>(sectordata.Keys);
|
||||
|
||||
//remove all vertex handles from selection
|
||||
//Remove all vertex handles from selection
|
||||
if(vertices != null && vertices.Count > 0)
|
||||
{
|
||||
foreach(IVisualEventReceiver i in selectedobjects)
|
||||
|
@ -823,17 +820,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
MessageBox.Show("Could not load the map's nodes: " + bsp.ErrorMessage + " Defaulting to blockmap.", "Error loading nodes!", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
|
||||
|
||||
//mxd. rebuild all sectors with effects
|
||||
if (sectorsWithEffects != null)
|
||||
//mxd. Rebuild all sectors with effects
|
||||
if (effectsectors != null)
|
||||
{
|
||||
for(int i = 0; i < sectorsWithEffects.Length; i++)
|
||||
foreach (Sector s in effectsectors)
|
||||
{
|
||||
if (!VisualSectorExists(s)) continue;
|
||||
|
||||
// The visual sector associated is now outdated
|
||||
if(VisualSectorExists(sectorsWithEffects[i]))
|
||||
{
|
||||
BaseVisualSector vs = (BaseVisualSector)GetVisualSector(sectorsWithEffects[i]);
|
||||
vs.UpdateSectorGeometry(true);
|
||||
}
|
||||
BaseVisualSector vs = (BaseVisualSector)GetVisualSector(s);
|
||||
vs.UpdateSectorGeometry(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue