From 99f8e014951533f3e8c90e7cc210d57da2fecc8a Mon Sep 17 00:00:00 2001 From: codeimp Date: Sat, 18 Sep 2010 10:52:10 +0000 Subject: [PATCH] @ Fixed bug in middle texture offsets on doublesided lines --- .../Plugins/GZDoomEditing/VisualModes/VisualMiddleDouble.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/GZDoomEditing/VisualModes/VisualMiddleDouble.cs b/Source/Plugins/GZDoomEditing/VisualModes/VisualMiddleDouble.cs index 8f9598aa..5919838f 100644 --- a/Source/Plugins/GZDoomEditing/VisualModes/VisualMiddleDouble.cs +++ b/Source/Plugins/GZDoomEditing/VisualModes/VisualMiddleDouble.cs @@ -143,10 +143,12 @@ namespace CodeImp.DoomBuilder.GZDoomEditing // height is 0 then the TexturePlane doesn't work! TexturePlane tp = new TexturePlane(); float floorbias = (Sidedef.Sector.CeilHeight == Sidedef.Sector.FloorHeight) ? 1.0f : 0.0f; + float geotop = (float)Math.Min(Sidedef.Sector.CeilHeight, Sidedef.Other.Sector.CeilHeight); + float geobottom = (float)Math.Max(Sidedef.Sector.FloorHeight, Sidedef.Other.Sector.FloorHeight); if(Sidedef.Line.IsFlagSet(General.Map.Config.LowerUnpeggedFlag)) { // When lower unpegged is set, the middle texture is bound to the bottom - tp.tlt.y = tsz.y - (float)(Sidedef.Sector.CeilHeight - Sidedef.Sector.FloorHeight); + tp.tlt.y = tsz.y - (float)(geotop - geobottom); } tp.trb.x = tp.tlt.x + Sidedef.Line.Length; tp.trb.y = tp.tlt.y + ((float)Sidedef.Sector.CeilHeight - ((float)Sidedef.Sector.FloorHeight + floorbias)); @@ -197,8 +199,6 @@ namespace CodeImp.DoomBuilder.GZDoomEditing if(!repeatmidtex) { // First determine the visible portion of the texture - float geotop = (float)Math.Min(Sidedef.Sector.CeilHeight, Sidedef.Other.Sector.CeilHeight); - float geobottom = (float)Math.Max(Sidedef.Sector.FloorHeight, Sidedef.Other.Sector.FloorHeight); float textop, texbottom; // Determine top portion height