mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 13:51:40 +00:00
fixed error when rendering 0 linedefs
This commit is contained in:
parent
6900a4cfa7
commit
1eedfae8bf
1 changed files with 16 additions and 12 deletions
|
@ -161,20 +161,24 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
PTVertex[] verts = new PTVertex[linedefs.Count * 4];
|
||||
int i = 0;
|
||||
|
||||
graphics.Device.RenderState.TextureFactor = -1;
|
||||
|
||||
// Go for all linedefs
|
||||
foreach(Linedef l in linedefs)
|
||||
// Any linedefs?
|
||||
if(linedefs.Count > 0)
|
||||
{
|
||||
// Make vertices
|
||||
verts[i++] = l.LineVertices[0];
|
||||
verts[i++] = l.LineVertices[1];
|
||||
verts[i++] = l.LineVertices[2];
|
||||
verts[i++] = l.LineVertices[3];
|
||||
graphics.Device.RenderState.TextureFactor = -1;
|
||||
|
||||
// Go for all linedefs
|
||||
foreach(Linedef l in linedefs)
|
||||
{
|
||||
// Make vertices
|
||||
verts[i++] = l.LineVertices[0];
|
||||
verts[i++] = l.LineVertices[1];
|
||||
verts[i++] = l.LineVertices[2];
|
||||
verts[i++] = l.LineVertices[3];
|
||||
}
|
||||
|
||||
// Draw lines
|
||||
graphics.Device.DrawUserPrimitives(PrimitiveType.LineList, linedefs.Count * 2, verts);
|
||||
}
|
||||
|
||||
// Draw lines
|
||||
graphics.Device.DrawUserPrimitives(PrimitiveType.LineList, linedefs.Count * 2, verts);
|
||||
}
|
||||
|
||||
// This renders a set of Linedefs
|
||||
|
|
Loading…
Reference in a new issue