Visual Mode, UDMF, Visual Vertices: heights of vertices without z-offset was incorrect in some cases.

Visual Mode, UDMF, Visual Vertices: vertices without z-offset are now rendered using Vertex color (Preferences -> Appearance -> Vertices).
This commit is contained in:
MaxED 2013-05-02 11:03:16 +00:00
parent 6b4d03baaa
commit e4751dfaf1
4 changed files with 11 additions and 7 deletions

View file

@ -641,7 +641,7 @@ namespace CodeImp.DoomBuilder.Rendering
if(v.Selected && showselection) {
color = General.Colors.Selection3D.ToColorValue();
} else {
color = General.Colors.InfoLine.ToColorValue();
color = v.HaveHeightOffset ? General.Colors.InfoLine.ToColorValue() : General.Colors.Vertices.ToColorValue();
if(v != highlighted) color.Alpha = 0.6f;
}
graphics.Shaders.World3D.VertexColor = color;

View file

@ -43,6 +43,7 @@ namespace CodeImp.DoomBuilder.VisualModes
protected bool selected;
protected bool changed;
protected bool ceilingVertex;
protected bool haveOffset;
//Properties
internal Matrix Position { get { return position; } }
@ -50,6 +51,7 @@ namespace CodeImp.DoomBuilder.VisualModes
public bool Selected { get { return selected; } set { selected = value; } }
public bool Changed { get { return changed; } set { changed |= value; } }
public bool CeilingVertex { get { return ceilingVertex; } }
public bool HaveHeightOffset { get { return haveOffset; } }
public VisualVertex(Vertex v, bool ceilingVertex) {
vertex = v;

View file

@ -562,9 +562,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
i.OnDelete();
}
// Update cache values
//General.Map.IsChanged = true;
PostAction();
}

View file

@ -44,10 +44,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(vertex.Fields.ContainsKey(key)) {
z = vertex.Fields.GetValue(key, 0f);
if(z == height && neighboursHaveSameHeight(height)) //don't create garbage data!
if(z == height && neighboursHaveSameHeight(height)) { //don't create garbage data!
vertex.Fields.Remove(key);
haveOffset = false;
} else {
haveOffset = true;
}
} else {
z = height;
haveOffset = false;
}
Vector3D pos = new Vector3D(vertex.Position.x, vertex.Position.y, z);
@ -96,13 +101,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(ceilingVertex) {
height = sectors[0].CeilHeight;
for(int i = 1; i < sectors.Length; i++) {
if(sectors[i].Sidedefs.Count == 3 && sectors[i].CeilHeight < height)
if(sectors[i].CeilHeight < height)
height = sectors[i].CeilHeight;
}
} else {
height = sectors[0].FloorHeight;
for(int i = 1; i < sectors.Length; i++) {
if(sectors[i].Sidedefs.Count == 3 && sectors[i].FloorHeight > height)
if(sectors[i].FloorHeight > height)
height = sectors[i].FloorHeight;
}
}