mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-02-14 16:10:50 +00:00
Fix bug & compiler warning with repeating midtextures
This commit is contained in:
parent
6b5472e735
commit
338b8b45b9
2 changed files with 3 additions and 3 deletions
|
@ -1592,10 +1592,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
|
|
||||||
protected virtual int ChangeOffsetX(int amount)
|
protected virtual int ChangeOffsetX(int amount)
|
||||||
{
|
{
|
||||||
|
int prevX = Sidedef.OffsetX;
|
||||||
Sidedef.OffsetX -= amount;
|
Sidedef.OffsetX -= amount;
|
||||||
if (Texture != null && Texture.IsImageLoaded)
|
if (Texture != null && Texture.IsImageLoaded)
|
||||||
{
|
{
|
||||||
int repeatmidtexoffset = General.Map.SRB2 && Sidedef.Line.IsFlagSet(General.Map.Config.RepeatMidtextureFlag) ? (Sidedef.OffsetX / 4096) * 4096 : 0;
|
int repeatmidtexoffset = General.Map.SRB2 && Sidedef.Line.IsFlagSet(General.Map.Config.RepeatMidtextureFlag) ? (prevX / 4096) * 4096 : 0;
|
||||||
Sidedef.OffsetX %= Texture.Width;
|
Sidedef.OffsetX %= Texture.Width;
|
||||||
Sidedef.OffsetX += repeatmidtexoffset;
|
Sidedef.OffsetX += repeatmidtexoffset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
|
|
||||||
#region ================== Variables
|
#region ================== Variables
|
||||||
|
|
||||||
// TODO: Resolve this while retaining correct behavior
|
|
||||||
private bool repeatmidtex;
|
private bool repeatmidtex;
|
||||||
private Plane topclipplane;
|
private Plane topclipplane;
|
||||||
private Plane bottomclipplane;
|
private Plane bottomclipplane;
|
||||||
|
@ -152,7 +151,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// Determine if we should repeat the middle texture
|
// Determine if we should repeat the middle texture
|
||||||
bool srb2repeat = General.Map.SRB2 && Sidedef.Line.IsFlagSet(General.Map.Config.RepeatMidtextureFlag);
|
bool srb2repeat = General.Map.SRB2 && Sidedef.Line.IsFlagSet(General.Map.Config.RepeatMidtextureFlag);
|
||||||
bool doomrepeat = !General.Map.SRB2 && Sidedef.IsFlagSet("wrapmidtex") || Sidedef.Line.IsFlagSet("wrapmidtex");
|
bool doomrepeat = !General.Map.SRB2 && Sidedef.IsFlagSet("wrapmidtex") || Sidedef.Line.IsFlagSet("wrapmidtex");
|
||||||
bool repeatmidtex = srb2repeat || doomrepeat;
|
repeatmidtex = srb2repeat || doomrepeat;
|
||||||
|
|
||||||
//A little redundant, but having a separate boolean value for each case makes the code a little more readable
|
//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;
|
bool srb2repeatfixed = srb2repeat && Sidedef.OffsetX >= 4096;
|
||||||
|
|
Loading…
Reference in a new issue