mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
Fixed some problems with walls not updating correctly on undo/redo in Visual Mode
This commit is contained in:
parent
9ef6ef5f6e
commit
f1c2e1e0a8
7 changed files with 58 additions and 22 deletions
|
@ -780,8 +780,8 @@ namespace CodeImp.DoomBuilder.Rendering
|
|||
// This collects a visual sector's geometry for rendering
|
||||
public void AddSectorGeometry(VisualGeometry g)
|
||||
{
|
||||
// Must have a texture!
|
||||
if(g.Texture != null)
|
||||
// Must have a texture and vertices
|
||||
if((g.Texture != null) && (g.Triangles > 0))
|
||||
{
|
||||
// Texture group not yet collected?
|
||||
if(!geometry[g.RenderPassInt].ContainsKey(g.Texture))
|
||||
|
|
|
@ -527,7 +527,12 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
if(!sectors.ContainsKey(ld.Front.Sector))
|
||||
{
|
||||
sectors.Add(ld.Front.Sector, vs);
|
||||
foreach(VisualGeometry g in vs.FixedGeometry) pickables.Add(g);
|
||||
foreach(VisualGeometry g in vs.FixedGeometry)
|
||||
{
|
||||
// Must have content
|
||||
if(g.Triangles > 0)
|
||||
pickables.Add(g);
|
||||
}
|
||||
}
|
||||
|
||||
// Add sidedef if on the front side
|
||||
|
@ -536,8 +541,12 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
List<VisualGeometry> sidedefgeo = vs.GetSidedefGeometry(ld.Front);
|
||||
foreach(VisualGeometry g in sidedefgeo)
|
||||
{
|
||||
g.SetPickResults(intersect, u);
|
||||
pickables.Add(g);
|
||||
// Must have content
|
||||
if(g.Triangles > 0)
|
||||
{
|
||||
g.SetPickResults(intersect, u);
|
||||
pickables.Add(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -555,7 +564,12 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
if(!sectors.ContainsKey(ld.Back.Sector))
|
||||
{
|
||||
sectors.Add(ld.Back.Sector, vs);
|
||||
foreach(VisualGeometry g in vs.FixedGeometry) pickables.Add(g);
|
||||
foreach(VisualGeometry g in vs.FixedGeometry)
|
||||
{
|
||||
// Must have content
|
||||
if(g.Triangles > 0)
|
||||
pickables.Add(g);
|
||||
}
|
||||
}
|
||||
|
||||
// Add sidedef if on the front side
|
||||
|
@ -564,8 +578,12 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
List<VisualGeometry> sidedefgeo = vs.GetSidedefGeometry(ld.Back);
|
||||
foreach(VisualGeometry g in sidedefgeo)
|
||||
{
|
||||
g.SetPickResults(intersect, u);
|
||||
pickables.Add(g);
|
||||
// Must have content
|
||||
if(g.Triangles > 0)
|
||||
{
|
||||
g.SetPickResults(intersect, u);
|
||||
pickables.Add(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,11 +142,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
// Create floor
|
||||
if(floor == null) floor = new VisualFloor(mode, this);
|
||||
if(floor.Setup()) base.AddGeometry(floor);
|
||||
floor.Setup();
|
||||
base.AddGeometry(floor);
|
||||
|
||||
// Create ceiling
|
||||
if(ceiling == null) ceiling = new VisualCeiling(mode, this);
|
||||
if(ceiling.Setup()) base.AddGeometry(ceiling);
|
||||
ceiling.Setup();
|
||||
base.AddGeometry(ceiling);
|
||||
|
||||
// Go for all sidedefs
|
||||
Dictionary<Sidedef, VisualSidedefParts> oldsides = sides ?? new Dictionary<Sidedef, VisualSidedefParts>(1);
|
||||
|
@ -161,15 +163,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Create upper part
|
||||
VisualUpper vu = parts.upper ?? new VisualUpper(mode, this, sd);
|
||||
if(vu.Setup()) base.AddGeometry(vu);
|
||||
vu.Setup();
|
||||
base.AddGeometry(vu);
|
||||
|
||||
// Create lower part
|
||||
VisualLower vl = parts.lower ?? new VisualLower(mode, this, sd);
|
||||
if(vl.Setup()) base.AddGeometry(vl);
|
||||
vl.Setup();
|
||||
base.AddGeometry(vl);
|
||||
|
||||
// Create middle part
|
||||
VisualMiddleDouble vm = parts.middledouble ?? new VisualMiddleDouble(mode, this, sd);
|
||||
if(vm.Setup()) base.AddGeometry(vm);
|
||||
vm.Setup();
|
||||
base.AddGeometry(vm);
|
||||
|
||||
// Store
|
||||
sides.Add(sd, new VisualSidedefParts(vu, vl, vm));
|
||||
|
@ -178,7 +183,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
// Create middle part
|
||||
VisualMiddleSingle vm = parts.middlesingle ?? new VisualMiddleSingle(mode, this, sd);
|
||||
if(vm.Setup()) base.AddGeometry(vm);
|
||||
vm.Setup();
|
||||
base.AddGeometry(vm);
|
||||
|
||||
// Store
|
||||
sides.Add(sd, new VisualSidedefParts(vm));
|
||||
|
|
|
@ -157,6 +157,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
else
|
||||
{
|
||||
// No geometry for invisible wall
|
||||
base.top = geotop;
|
||||
base.bottom = geobottom;
|
||||
WorldVertex[] verts = new WorldVertex[0];
|
||||
base.SetVertices(verts);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This builds the geometry. Returns false when no geometry created.
|
||||
public override bool Setup()
|
||||
{
|
||||
WorldVertex[] verts;
|
||||
|
||||
byte brightness = (byte)General.Clamp(Sidedef.Sector.Brightness, 0, 255);
|
||||
|
||||
// Calculate size of this wall part
|
||||
|
@ -148,7 +150,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
PixelColor pc = new PixelColor(255, brightness, brightness, brightness);
|
||||
|
||||
// Make vertices
|
||||
WorldVertex[] verts = new WorldVertex[6];
|
||||
verts = new WorldVertex[6];
|
||||
verts[0] = new WorldVertex(v1.x, v1.y, texbottom, pc.ToInt(), t1.x, t2.y);
|
||||
verts[1] = new WorldVertex(v1.x, v1.y, textop, pc.ToInt(), t1.x, t1.y);
|
||||
verts[2] = new WorldVertex(v2.x, v2.y, textop, pc.ToInt(), t2.x, t1.y);
|
||||
|
@ -166,8 +168,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// No geometry for invisible wall
|
||||
base.top = geotop;
|
||||
base.bottom = geotop; // bottom same as top so that it has a height of 0 (otherwise it will still be picked up by object picking)
|
||||
verts = new WorldVertex[0];
|
||||
base.SetVertices(verts);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,12 +76,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
Vector2D t1 = new Vector2D();
|
||||
Vector2D t2 = new Vector2D();
|
||||
|
||||
if(Sidedef.MiddleTexture == "FOOBAR")
|
||||
{
|
||||
int g = 5;
|
||||
}
|
||||
|
||||
|
||||
// Texture given?
|
||||
if((Sidedef.MiddleTexture.Length > 0) && (Sidedef.MiddleTexture[0] != '-'))
|
||||
{
|
||||
|
@ -163,6 +157,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
else
|
||||
{
|
||||
// No geometry for invisible wall
|
||||
base.top = geotop;
|
||||
base.bottom = geobottom;
|
||||
WorldVertex[] verts = new WorldVertex[0];
|
||||
base.SetVertices(verts);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,6 +157,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
else
|
||||
{
|
||||
// No geometry for invisible wall
|
||||
base.top = geotop;
|
||||
base.bottom = geobottom;
|
||||
WorldVertex[] verts = new WorldVertex[0];
|
||||
base.SetVertices(verts);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue