mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-21 11:21:26 +00:00
Fixed, Visual mode: fixed another case of sector effects over-updating each other.
This commit is contained in:
parent
321b91e1fb
commit
13644cdca9
3 changed files with 47 additions and 10 deletions
|
@ -517,6 +517,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This updates the VisualSectors and VisualThings that have their Changed property set
|
||||
private void UpdateChangedObjects()
|
||||
{
|
||||
//mxd
|
||||
SectorData[] toupdate = new SectorData[sectordata.Values.Count];
|
||||
sectordata.Values.CopyTo(toupdate, 0);
|
||||
foreach(SectorData data in toupdate) data.Update();
|
||||
|
||||
foreach(KeyValuePair<Sector, VisualSector> vs in allsectors)
|
||||
{
|
||||
if(vs.Value != null)
|
||||
|
@ -1578,7 +1583,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(s.Marked)
|
||||
{
|
||||
SectorData sd = GetSectorData(s);
|
||||
sd.Reset();
|
||||
sd.Reset(false); //mxd (changed Reset implementation)
|
||||
|
||||
// UpdateSectorGeometry for associated sectors (sd.UpdateAlso) as well!
|
||||
foreach(KeyValuePair<Sector, bool> us in sd.UpdateAlso)
|
||||
|
|
|
@ -121,16 +121,19 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
changed = true;
|
||||
|
||||
// Not sure what from this part we need, so commented out for now
|
||||
SectorData data = GetSectorData();
|
||||
data.Reset();
|
||||
|
||||
// Update sectors that rely on this sector
|
||||
foreach(KeyValuePair<Sector, bool> s in data.UpdateAlso)
|
||||
SectorData data = mode.GetSectorDataEx(this.Sector); //mxd
|
||||
if(data != null) //mxd
|
||||
{
|
||||
if(mode.VisualSectorExists(s.Key))
|
||||
data.Reset(includeneighbours);
|
||||
|
||||
// Update sectors that rely on this sector
|
||||
foreach(KeyValuePair<Sector, bool> s in data.UpdateAlso)
|
||||
{
|
||||
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(s.Key);
|
||||
vs.Changed = true;
|
||||
if(mode.VisualSectorExists(s.Key))
|
||||
{
|
||||
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(s.Key);
|
||||
vs.Changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
// This resets this sector data and all sectors that require updating after me
|
||||
public void Reset()
|
||||
/*public void Reset()
|
||||
{
|
||||
if(isupdating) return;
|
||||
isupdating = true;
|
||||
|
@ -243,6 +243,35 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
sd.Reset();
|
||||
}
|
||||
|
||||
isupdating = false;
|
||||
}*/
|
||||
|
||||
//mxd. This marks this sector data and all sector datas that require updating as not updated
|
||||
public void Reset(bool resetneighbours)
|
||||
{
|
||||
if(isupdating) return;
|
||||
isupdating = true;
|
||||
|
||||
// This is set to false so that this sector is rebuilt the next time it is needed!
|
||||
updated = false;
|
||||
|
||||
// The visual sector associated is now outdated
|
||||
if(mode.VisualSectorExists(sector))
|
||||
{
|
||||
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(sector);
|
||||
vs.Changed = true;
|
||||
}
|
||||
|
||||
// Reset the sectors that depend on this sector
|
||||
if(resetneighbours)
|
||||
{
|
||||
foreach(KeyValuePair<Sector, bool> s in updatesectors)
|
||||
{
|
||||
SectorData sd = mode.GetSectorDataEx(s.Key);
|
||||
if(sd != null) sd.Reset(s.Value);
|
||||
}
|
||||
}
|
||||
|
||||
isupdating = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue