Finally fix repeating midtexture selection in Visual Mode

This commit is contained in:
spherallic 2023-05-03 01:28:05 +02:00
parent 1435208163
commit 78e6f5b114
1 changed files with 5 additions and 3 deletions

View File

@ -39,6 +39,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
#region ================== Variables
private bool repeatmidtex;
private bool srb2repeatfixed;
private Plane topclipplane;
private Plane bottomclipplane;
@ -154,7 +156,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
repeatmidtex = srb2repeat || doomrepeat;
//A little redundant, but having a separate boolean value for each case makes the code a little more readable
bool srb2repeatfixed = srb2repeat && Sidedef.OffsetX >= 4096;
srb2repeatfixed = srb2repeat && Sidedef.OffsetX >= 4096;
bool srb2repeatindefinite = srb2repeat && !srb2repeatfixed;
float topheight = !General.Map.SRB2 || Sidedef.Line.IsFlagSet("128") ? geotop : geoplanetop;
@ -384,7 +386,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This performs a fast test in object picking
public override bool PickFastReject(Vector3D from, Vector3D to, Vector3D dir)
{
if(!repeatmidtex)
if(!repeatmidtex || srb2repeatfixed)
{
// When the texture is not repeated, leave when outside crop planes
if((pickintersect.z < bottomclipplane.GetZ(pickintersect)) ||
@ -409,7 +411,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
int ox = (int)Math.Floor((u * Sidedef.Line.Length * UniFields.GetFloat(Sidedef.Fields, "scalex_mid", 1.0f) / Texture.Scale.x + Sidedef.OffsetX + UniFields.GetFloat(Sidedef.Fields, "offsetx_mid")) % Texture.Width);
int oy;
if(repeatmidtex)
if(repeatmidtex && !srb2repeatfixed)
{
if(IsLowerUnpegged())
zoffset = Sidedef.Sector.FloorHeight;