Fixed display and auto-align issues when using hires texture replacements with local scaling

This commit is contained in:
biwa 2020-04-02 22:46:40 +02:00
parent 8115d12b6c
commit ef4c763879
6 changed files with 42 additions and 4 deletions

View file

@ -4285,8 +4285,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
backwardoffset = j.offsetx;
if(!worldpanning)
forwardoffset = (float)Math.Round((j.offsetx + (float)Math.Round(j.sidedef.Line.Length) / scalex * Math.Abs(first.scaleX)) % vwidth, General.Map.FormatInterface.VertexDecimals);
if (!worldpanning)
{
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (texture is HiResImage)
forwardoffset = j.offsetx + (float)Math.Round(((float)Math.Round(j.sidedef.Line.Length) / scalex) % vwidth, General.Map.FormatInterface.VertexDecimals);
else
forwardoffset = j.offsetx + (float)Math.Round(((float)Math.Round(j.sidedef.Line.Length) / scalex * Math.Abs(first.scaleX)) % vwidth, General.Map.FormatInterface.VertexDecimals);
}
else
forwardoffset = (float)Math.Round((j.offsetx + (float)Math.Round(j.sidedef.Line.Length)) % vwidth, General.Map.FormatInterface.VertexDecimals);
@ -4310,7 +4316,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
float offset;
if(!worldpanning)
offset = (float)Math.Round((j.offsetx - j.sidedef.OffsetX - (float)Math.Round(j.sidedef.Line.Length) / scalex * first.scaleX) % vwidth, General.Map.FormatInterface.VertexDecimals);
{
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (texture is HiResImage)
offset = (float)Math.Round((j.offsetx - j.sidedef.OffsetX - (float)Math.Round(j.sidedef.Line.Length) / scalex) % vwidth, General.Map.FormatInterface.VertexDecimals);
else
offset = (float)Math.Round((j.offsetx - j.sidedef.OffsetX - (float)Math.Round(j.sidedef.Line.Length) / scalex * first.scaleX) % vwidth, General.Map.FormatInterface.VertexDecimals);
}
else
offset = (float)Math.Round((j.offsetx - j.sidedef.OffsetX - (float)Math.Round(j.sidedef.Line.Length)) % vwidth, General.Map.FormatInterface.VertexDecimals);
@ -4426,7 +4438,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
forwardoffset = j.offsetx;
if (!worldpanning)
backwardoffset = (float)Math.Round((j.offsetx - (float)Math.Round(j.sidedef.Line.Length) / scalex * first.scaleX) % vwidth, General.Map.FormatInterface.VertexDecimals);
{
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (texture is HiResImage)
backwardoffset = (float)Math.Round((j.offsetx - (float)Math.Round(j.sidedef.Line.Length) / scalex) % vwidth, General.Map.FormatInterface.VertexDecimals);
else
backwardoffset = (float)Math.Round((j.offsetx - (float)Math.Round(j.sidedef.Line.Length) / scalex * Math.Abs(first.scaleX)) % vwidth, General.Map.FormatInterface.VertexDecimals);
}
else
backwardoffset = (float)Math.Round((j.offsetx - (float)Math.Round(j.sidedef.Line.Length)) % vwidth, General.Map.FormatInterface.VertexDecimals);

View file

@ -139,6 +139,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
tof = tof / tscaleAbs;
tof = tof * base.Texture.Scale;
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (base.Texture is HiResImage)
tof *= tscaleAbs;
}
// Determine texture coordinates plane as they would be in normal circumstances.

View file

@ -157,6 +157,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
tof = tof / tscaleAbs;
tof = tof * base.Texture.Scale;
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (base.Texture is HiResImage)
tof *= tscaleAbs;
}
// For Vavoom type 3D floors the ceiling is lower than floor and they are reversed.

View file

@ -139,6 +139,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
tof = tof / tscaleAbs;
tof = tof * base.Texture.Scale;
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (base.Texture is HiResImage)
tof *= tscaleAbs;
}
// Determine texture coordinates plane as they would be in normal circumstances.

View file

@ -125,6 +125,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
tof = tof / tscaleAbs;
tof = tof * base.Texture.Scale;
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (base.Texture is HiResImage)
tof *= tscaleAbs;
}
// Determine texture coordinates plane as they would be in normal circumstances.

View file

@ -140,6 +140,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
tof = tof / tscaleAbs;
tof = tof * base.Texture.Scale;
// If the texture gets replaced with a "hires" texture it adds more fuckery
if (base.Texture is HiResImage)
tof *= tscaleAbs;
}
// Determine texture coordinates plane as they would be in normal circumstances.