mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
@ Fixed 3D floor textures that were swapped between floor/ceiling
@ Fixed middle texture offsets on doublesided lines
This commit is contained in:
parent
6c68a5635e
commit
429b36e765
6 changed files with 48 additions and 43 deletions
|
@ -82,6 +82,20 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
// This changes the height
|
||||
protected abstract void ChangeHeight(int amount);
|
||||
|
||||
|
||||
// This swaps triangles so that the plane faces the other way
|
||||
protected void SwapTriangleVertices(WorldVertex[] verts)
|
||||
{
|
||||
// Swap some vertices to flip all triangles
|
||||
for(int i = 0; i < verts.Length; i += 3)
|
||||
{
|
||||
// Swap
|
||||
WorldVertex v = verts[i];
|
||||
verts[i] = verts[i + 1];
|
||||
verts[i + 1] = v;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Events
|
||||
|
|
|
@ -197,14 +197,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
||||
// Create a floor
|
||||
VisualFloor vf = (i < extrafloors.Count) ? extrafloors[i] : new VisualFloor(mode, this);
|
||||
if(vf.Setup(ef.Floor, ef))
|
||||
if(vf.Setup(ef.Ceiling, ef))
|
||||
base.AddGeometry(vf);
|
||||
if(i >= extrafloors.Count)
|
||||
extrafloors.Add(vf);
|
||||
|
||||
// Create a ceiling
|
||||
VisualCeiling vc = (i < extraceilings.Count) ? extraceilings[i] : new VisualCeiling(mode, this);
|
||||
if(vc.Setup(ef.Ceiling, ef))
|
||||
if(vc.Setup(ef.Floor, ef))
|
||||
base.AddGeometry(vc);
|
||||
if(i >= extraceilings.Count)
|
||||
extraceilings.Add(vc);
|
||||
|
|
|
@ -85,20 +85,29 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
sd.Ceiling.CopyProperties(floor);
|
||||
sd.Floor.CopyProperties(ceiling);
|
||||
floor.type = SectorLevelType.Floor;
|
||||
floor.plane = floor.plane.GetInverted();
|
||||
floor.plane = sd.Ceiling.plane.GetInverted();
|
||||
ceiling.type = SectorLevelType.Ceiling;
|
||||
ceiling.plane = ceiling.plane.GetInverted();
|
||||
ceiling.plane = sd.Floor.plane.GetInverted();
|
||||
|
||||
// A 3D floor's color is always that of the sector it is placed in
|
||||
floor.color = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
vavoomtype = true;
|
||||
sd.Ceiling.CopyProperties(ceiling);
|
||||
sd.Floor.CopyProperties(floor);
|
||||
/*
|
||||
sd.Ceiling.CopyProperties(floor);
|
||||
sd.Floor.CopyProperties(ceiling);
|
||||
*/
|
||||
floor.type = SectorLevelType.Ceiling;
|
||||
floor.plane = sd.Ceiling.plane;
|
||||
ceiling.type = SectorLevelType.Floor;
|
||||
ceiling.plane = sd.Floor.plane;
|
||||
alpha = 255;
|
||||
}
|
||||
|
||||
// A 3D floor's color is always that of the sector it is placed in
|
||||
floor.color = 0;
|
||||
ceiling.color = 0;
|
||||
}
|
||||
|
||||
// Apply alpha
|
||||
floor.alpha = alpha;
|
||||
|
|
|
@ -126,14 +126,8 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
// The sector triangulation created clockwise triangles that
|
||||
// are right up for the floor. For the ceiling we must flip
|
||||
// the triangles upside down.
|
||||
// Swap some vertices to flip all triangles
|
||||
for(int i = 0; i < verts.Length; i += 3)
|
||||
{
|
||||
// Swap
|
||||
v = verts[i];
|
||||
verts[i] = verts[i + 1];
|
||||
verts[i + 1] = v;
|
||||
}
|
||||
if((extrafloor == null) || extrafloor.VavoomType)
|
||||
SwapTriangleVertices(verts);
|
||||
|
||||
// Determine render pass
|
||||
if(level.alpha < 255)
|
||||
|
@ -164,20 +158,11 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
||||
// This changes the height
|
||||
protected override void ChangeHeight(int amount)
|
||||
{
|
||||
if((extrafloor == null) || extrafloor.VavoomType)
|
||||
{
|
||||
mode.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, level.sector.FixedIndex);
|
||||
level.sector.CeilHeight += amount;
|
||||
mode.SetActionResult("Changed ceiling height to " + level.sector.CeilHeight + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
mode.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, level.sector.FixedIndex);
|
||||
level.sector.FloorHeight += amount;
|
||||
mode.SetActionResult("Changed floor height to " + level.sector.FloorHeight + ".");
|
||||
}
|
||||
}
|
||||
|
||||
// This performs a fast test in object picking
|
||||
public override bool PickFastReject(Vector3D from, Vector3D to, Vector3D dir)
|
||||
|
|
|
@ -122,6 +122,12 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
verts[i].v = pos.y;
|
||||
}
|
||||
|
||||
// The sector triangulation created clockwise triangles that
|
||||
// are right up for the floor. For the ceiling we must flip
|
||||
// the triangles upside down.
|
||||
if((extrafloor != null) && !extrafloor.VavoomType)
|
||||
SwapTriangleVertices(verts);
|
||||
|
||||
// Determine render pass
|
||||
if(level.alpha < 255)
|
||||
this.RenderPass = RenderPass.Alpha;
|
||||
|
@ -151,20 +157,11 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
||||
// This changes the height
|
||||
protected override void ChangeHeight(int amount)
|
||||
{
|
||||
if((extrafloor == null) || extrafloor.VavoomType)
|
||||
{
|
||||
mode.CreateUndo("Change floor height", UndoGroup.FloorHeightChange, level.sector.FixedIndex);
|
||||
level.sector.FloorHeight += amount;
|
||||
mode.SetActionResult("Changed floor height to " + level.sector.FloorHeight + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
mode.CreateUndo("Change ceiling height", UndoGroup.CeilingHeightChange, level.sector.FixedIndex);
|
||||
level.sector.CeilHeight += amount;
|
||||
mode.SetActionResult("Changed ceiling height to " + level.sector.CeilHeight + ".");
|
||||
}
|
||||
}
|
||||
|
||||
// This performs a fast test in object picking
|
||||
public override bool PickFastReject(Vector3D from, Vector3D to, Vector3D dir)
|
||||
|
|
|
@ -203,9 +203,9 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
||||
// Determine top portion height
|
||||
if(Sidedef.Line.IsFlagSet(General.Map.Config.LowerUnpeggedFlag))
|
||||
textop = geobottom + tsz.y;
|
||||
textop = geobottom + tof.y + tsz.y;
|
||||
else
|
||||
textop = geotop;
|
||||
textop = geotop + tof.y;
|
||||
|
||||
// Calculate bottom portion height
|
||||
texbottom = textop - tsz.y;
|
||||
|
|
Loading…
Reference in a new issue