mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-07 08:21:10 +00:00
Made texture autoalignment work with SRB2's 3D floors
This commit is contained in:
parent
8b5a2916b8
commit
99cb93b0ae
1 changed files with 42 additions and 11 deletions
|
@ -3821,8 +3821,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(start.GeometryType == VisualGeometryType.WALL_MIDDLE_3D)
|
||||
{
|
||||
first.controlSide = start.GetControlLinedef().Front;
|
||||
if (General.Map.SRB2) ystartalign = first.controlSide.OffsetY;
|
||||
else
|
||||
{
|
||||
first.offsetx += first.controlSide.OffsetX;
|
||||
ystartalign += first.controlSide.OffsetY;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3841,8 +3845,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(j.forward)
|
||||
{
|
||||
// Apply alignment
|
||||
if(alignx) j.controlSide.OffsetX = (int)j.offsetx;
|
||||
if(aligny) j.sidedef.OffsetY = (int)Math.Round((first.ceilingHeight - j.ceilingHeight) / scaley) + ystartalign;
|
||||
if (alignx)
|
||||
{
|
||||
if (General.Map.SRB2) j.sidedef.OffsetX = (int)j.offsetx;
|
||||
else j.controlSide.OffsetX = (int)j.offsetx;
|
||||
}
|
||||
if (aligny)
|
||||
{
|
||||
int newOffsetY = (int)Math.Round((first.ceilingHeight - j.ceilingHeight) / scaley) + ystartalign;
|
||||
if (General.Map.SRB2) j.controlSide.OffsetY = newOffsetY;
|
||||
else j.sidedef.OffsetY = newOffsetY;
|
||||
}
|
||||
int forwardoffset = (int)j.offsetx + (int)Math.Round(j.sidedef.Line.Length / scalex);
|
||||
int backwardoffset = (int)j.offsetx;
|
||||
|
||||
|
@ -3853,7 +3866,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(texture.IsImageLoaded && Tools.SidedefTextureMatch(j.sidedef, texture.LongName))
|
||||
{
|
||||
if(alignx) j.sidedef.OffsetX %= texture.Width;
|
||||
if(aligny) j.sidedef.OffsetY %= texture.Height;
|
||||
if (aligny)
|
||||
{
|
||||
if (General.Map.SRB2) j.controlSide.OffsetY %= texture.Height;
|
||||
else j.sidedef.OffsetY %= texture.Height;
|
||||
}
|
||||
}
|
||||
|
||||
// Add sidedefs forward (connected to the right vertex)
|
||||
|
@ -3867,8 +3884,18 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
else
|
||||
{
|
||||
// Apply alignment
|
||||
if(alignx) j.controlSide.OffsetX = (int)j.offsetx - (int)Math.Round(j.sidedef.Line.Length / scalex);
|
||||
if(aligny) j.sidedef.OffsetY = (int)Math.Round((first.ceilingHeight - j.ceilingHeight) / scaley) + ystartalign;
|
||||
if (alignx)
|
||||
{
|
||||
int newOffsetX = (int)j.offsetx - (int)Math.Round(j.sidedef.Line.Length / scalex);
|
||||
if (General.Map.SRB2) j.sidedef.OffsetX = newOffsetX;
|
||||
else j.controlSide.OffsetX = newOffsetX;
|
||||
}
|
||||
if (aligny)
|
||||
{
|
||||
int newOffsetY = (int)Math.Round((first.ceilingHeight - j.ceilingHeight) / scaley) + ystartalign;
|
||||
if (General.Map.SRB2) j.controlSide.OffsetY = newOffsetY;
|
||||
else j.sidedef.OffsetY = newOffsetY;
|
||||
}
|
||||
int forwardoffset = (int)j.offsetx;
|
||||
int backwardoffset = (int)j.offsetx - (int)Math.Round(j.sidedef.Line.Length / scalex);
|
||||
|
||||
|
@ -3879,7 +3906,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
if(texture.IsImageLoaded && Tools.SidedefTextureMatch(j.sidedef, texture.LongName))
|
||||
{
|
||||
if(alignx) j.sidedef.OffsetX %= texture.Width;
|
||||
if(aligny) j.sidedef.OffsetY %= texture.Height;
|
||||
if (aligny)
|
||||
{
|
||||
if (General.Map.SRB2) j.controlSide.OffsetY %= texture.Height;
|
||||
else j.sidedef.OffsetY %= texture.Height;
|
||||
}
|
||||
}
|
||||
|
||||
// Add sidedefs backward (connected to the left vertex)
|
||||
|
|
Loading…
Reference in a new issue