diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs index d8458df8..84a02257 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs @@ -95,6 +95,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // This changes the height protected abstract void ChangeHeight(int amount); protected abstract void ChangeTextureScale(int incrementX, int incrementY); //mxd + protected abstract void UpdateSkyRenderFlag(); //mxd public virtual void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight) { } //mxd // This swaps triangles so that the plane faces the other way @@ -218,14 +219,17 @@ namespace CodeImp.DoomBuilder.BuilderModes //mxd protected void OnTextureChanged() { - //mxd. Effects may need updating... + // Effects may need updating... mode.RebuildElementData(); + + // As well as sky render flag... + UpdateSkyRenderFlag(); if(level.sector == this.Sector.Sector) { this.Setup(); - //mxd. 3D floors may need updating... + // 3D floors may need updating... foreach(Sidedef s in level.sector.Sidedefs) { if(s.Line.Action == 160 && s.Line.Front != null) @@ -242,7 +246,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } } } - //mxd. As well as this sector's geometry + // As well as this sector's geometry else if(mode.VisualSectorExists(level.sector)) { BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector); diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs index 983542a9..d6c5ebca 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs @@ -198,7 +198,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } //mxd - private void UpdateSkyRenderFlag() + protected override void UpdateSkyRenderFlag() { bool isrenderedassky = renderassky; renderassky = (level.sector.CeilTexture == General.Map.Config.SkyFlatName); @@ -210,6 +210,18 @@ namespace CodeImp.DoomBuilder.BuilderModes VisualSidedefParts parts = Sector.GetSidedefParts(side); if(parts.upper != null) parts.upper.UpdateSkyRenderFlag(); else if(parts.middlesingle != null) parts.middlesingle.UpdateSkyRenderFlag(); + + // On the other side as well... + if(side.Other != null && side.Other.Sector != null && + side.Other.Sector.CeilTexture == General.Map.Config.SkyFlatName) + { + BaseVisualSector other = (BaseVisualSector)mode.GetVisualSector(side.Other.Sector); + if(other != null && other.Sides != null) + { + parts = other.GetSidedefParts(side.Other); + if(parts.upper != null) parts.upper.UpdateSkyRenderFlag(); + } + } } } } diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs index 1e0ec9c3..4ae95cfa 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs @@ -200,7 +200,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } //mxd - private void UpdateSkyRenderFlag() + protected override void UpdateSkyRenderFlag() { bool isrenderedassky = renderassky; renderassky = (level.sector.FloorTexture == General.Map.Config.SkyFlatName || level.sector.LongFloorTexture == MapSet.EmptyLongName);