diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index daa1edd6..612d3303 100755 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -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); diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs b/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs index 95961e99..d8cf9c9b 100755 --- a/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualLower.cs @@ -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. diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs index d477b6f0..9eb62058 100755 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs @@ -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. diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs index abf3d541..7b03355a 100755 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleDouble.cs @@ -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. diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs index 3bd3dbf2..c4b21f39 100755 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddleSingle.cs @@ -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. diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs b/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs index 84cd8281..89f794a5 100755 --- a/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualUpper.cs @@ -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.