Fixed, Visual mode: "render as sky" flag was not updated for upper wall geometry when pasting textures (and in some other cases).

This commit is contained in:
MaxED 2016-01-12 22:56:19 +00:00
parent 5eb5ffbc0b
commit a4699e156d
3 changed files with 21 additions and 5 deletions

View file

@ -95,6 +95,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This changes the height // This changes the height
protected abstract void ChangeHeight(int amount); protected abstract void ChangeHeight(int amount);
protected abstract void ChangeTextureScale(int incrementX, int incrementY); //mxd 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 public virtual void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight) { } //mxd
// This swaps triangles so that the plane faces the other way // This swaps triangles so that the plane faces the other way
@ -218,14 +219,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
//mxd //mxd
protected void OnTextureChanged() protected void OnTextureChanged()
{ {
//mxd. Effects may need updating... // Effects may need updating...
mode.RebuildElementData(); mode.RebuildElementData();
// As well as sky render flag...
UpdateSkyRenderFlag();
if(level.sector == this.Sector.Sector) if(level.sector == this.Sector.Sector)
{ {
this.Setup(); this.Setup();
//mxd. 3D floors may need updating... // 3D floors may need updating...
foreach(Sidedef s in level.sector.Sidedefs) foreach(Sidedef s in level.sector.Sidedefs)
{ {
if(s.Line.Action == 160 && s.Line.Front != null) 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)) else if(mode.VisualSectorExists(level.sector))
{ {
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector); BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector);

View file

@ -198,7 +198,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
} }
//mxd //mxd
private void UpdateSkyRenderFlag() protected override void UpdateSkyRenderFlag()
{ {
bool isrenderedassky = renderassky; bool isrenderedassky = renderassky;
renderassky = (level.sector.CeilTexture == General.Map.Config.SkyFlatName); renderassky = (level.sector.CeilTexture == General.Map.Config.SkyFlatName);
@ -210,6 +210,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
VisualSidedefParts parts = Sector.GetSidedefParts(side); VisualSidedefParts parts = Sector.GetSidedefParts(side);
if(parts.upper != null) parts.upper.UpdateSkyRenderFlag(); if(parts.upper != null) parts.upper.UpdateSkyRenderFlag();
else if(parts.middlesingle != null) parts.middlesingle.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();
}
}
} }
} }
} }

View file

@ -200,7 +200,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
} }
//mxd //mxd
private void UpdateSkyRenderFlag() protected override void UpdateSkyRenderFlag()
{ {
bool isrenderedassky = renderassky; bool isrenderedassky = renderassky;
renderassky = (level.sector.FloorTexture == General.Map.Config.SkyFlatName || level.sector.LongFloorTexture == MapSet.EmptyLongName); renderassky = (level.sector.FloorTexture == General.Map.Config.SkyFlatName || level.sector.LongFloorTexture == MapSet.EmptyLongName);