mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
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:
parent
6b4d03baaa
commit
e4751dfaf1
4 changed files with 11 additions and 7 deletions
|
@ -641,7 +641,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
if(v.Selected && showselection) {
|
if(v.Selected && showselection) {
|
||||||
color = General.Colors.Selection3D.ToColorValue();
|
color = General.Colors.Selection3D.ToColorValue();
|
||||||
} else {
|
} else {
|
||||||
color = General.Colors.InfoLine.ToColorValue();
|
color = v.HaveHeightOffset ? General.Colors.InfoLine.ToColorValue() : General.Colors.Vertices.ToColorValue();
|
||||||
if(v != highlighted) color.Alpha = 0.6f;
|
if(v != highlighted) color.Alpha = 0.6f;
|
||||||
}
|
}
|
||||||
graphics.Shaders.World3D.VertexColor = color;
|
graphics.Shaders.World3D.VertexColor = color;
|
||||||
|
|
|
@ -43,6 +43,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
protected bool selected;
|
protected bool selected;
|
||||||
protected bool changed;
|
protected bool changed;
|
||||||
protected bool ceilingVertex;
|
protected bool ceilingVertex;
|
||||||
|
protected bool haveOffset;
|
||||||
|
|
||||||
//Properties
|
//Properties
|
||||||
internal Matrix Position { get { return position; } }
|
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 Selected { get { return selected; } set { selected = value; } }
|
||||||
public bool Changed { get { return changed; } set { changed |= value; } }
|
public bool Changed { get { return changed; } set { changed |= value; } }
|
||||||
public bool CeilingVertex { get { return ceilingVertex; } }
|
public bool CeilingVertex { get { return ceilingVertex; } }
|
||||||
|
public bool HaveHeightOffset { get { return haveOffset; } }
|
||||||
|
|
||||||
public VisualVertex(Vertex v, bool ceilingVertex) {
|
public VisualVertex(Vertex v, bool ceilingVertex) {
|
||||||
vertex = v;
|
vertex = v;
|
||||||
|
|
|
@ -562,9 +562,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
i.OnDelete();
|
i.OnDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update cache values
|
|
||||||
//General.Map.IsChanged = true;
|
|
||||||
|
|
||||||
PostAction();
|
PostAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,10 +44,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
if(vertex.Fields.ContainsKey(key)) {
|
if(vertex.Fields.ContainsKey(key)) {
|
||||||
z = vertex.Fields.GetValue(key, 0f);
|
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);
|
vertex.Fields.Remove(key);
|
||||||
|
haveOffset = false;
|
||||||
|
} else {
|
||||||
|
haveOffset = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
z = height;
|
z = height;
|
||||||
|
haveOffset = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3D pos = new Vector3D(vertex.Position.x, vertex.Position.y, z);
|
Vector3D pos = new Vector3D(vertex.Position.x, vertex.Position.y, z);
|
||||||
|
@ -96,13 +101,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
if(ceilingVertex) {
|
if(ceilingVertex) {
|
||||||
height = sectors[0].CeilHeight;
|
height = sectors[0].CeilHeight;
|
||||||
for(int i = 1; i < sectors.Length; i++) {
|
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;
|
height = sectors[i].CeilHeight;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
height = sectors[0].FloorHeight;
|
height = sectors[0].FloorHeight;
|
||||||
for(int i = 1; i < sectors.Length; i++) {
|
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;
|
height = sectors[i].FloorHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue