Don't clamp floor/ceiling texture offsets prematurely

This commit is contained in:
spherallic 2024-05-03 23:40:31 +02:00
parent f1d1ac0e55
commit 56a38ee16d
2 changed files with 8 additions and 4 deletions

View file

@ -302,9 +302,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
//mxd
Sector s = GetControlSector();
double texsizex = General.Map.Config.ScaledFlatOffsets ? Texture.ScaledWidth : (Texture.ScaledWidth / s.Fields.GetValue("xscaleceiling", 1.0));
double texsizey = General.Map.Config.ScaledFlatOffsets ? Texture.ScaledHeight : (Texture.ScaledHeight / s.Fields.GetValue("yscaleceiling", 1.0));
s.Fields.BeforeFieldsChange();
double nx = (s.Fields.GetValue("xpanningceiling", 0.0) + offsetx) % (Texture.ScaledWidth / s.Fields.GetValue("xscaleceiling", 1.0));
double ny = (s.Fields.GetValue("ypanningceiling", 0.0) + offsety) % (Texture.ScaledHeight / s.Fields.GetValue("yscaleceiling", 1.0));
double nx = (s.Fields.GetValue("xpanningceiling", 0.0) + offsetx) % texsizex;
double ny = (s.Fields.GetValue("ypanningceiling", 0.0) + offsety) % texsizey;
s.Fields["xpanningceiling"] = new UniValue(UniversalType.Float, nx);
s.Fields["ypanningceiling"] = new UniValue(UniversalType.Float, ny);
s.UpdateNeeded = true;

View file

@ -256,9 +256,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
{
//mxd
Sector s = GetControlSector();
double texsizex = General.Map.Config.ScaledFlatOffsets ? Texture.ScaledWidth : (Texture.ScaledWidth / s.Fields.GetValue("xscalefloor", 1.0));
double texsizey = General.Map.Config.ScaledFlatOffsets ? Texture.ScaledHeight : (Texture.ScaledHeight / s.Fields.GetValue("yscalefloor", 1.0));
s.Fields.BeforeFieldsChange();
double nx = (s.Fields.GetValue("xpanningfloor", 0.0) + offsetx) % (Texture.ScaledWidth / s.Fields.GetValue("xscalefloor", 1.0));
double ny = (s.Fields.GetValue("ypanningfloor", 0.0) + offsety) % (Texture.ScaledHeight / s.Fields.GetValue("yscalefloor", 1.0));
double nx = (s.Fields.GetValue("xpanningfloor", 0.0) + offsetx) % texsizex;
double ny = (s.Fields.GetValue("ypanningfloor", 0.0) + offsety) % texsizey;
s.Fields["xpanningfloor"] = new UniValue(UniversalType.Float, nx);
s.Fields["ypanningfloor"] = new UniValue(UniversalType.Float, ny);
s.UpdateNeeded = true;