diff --git a/Build/Configurations/Includes/SRB222_common.cfg b/Build/Configurations/Includes/SRB222_common.cfg index aee7a70e..90c85cde 100644 --- a/Build/Configurations/Includes/SRB222_common.cfg +++ b/Build/Configurations/Includes/SRB222_common.cfg @@ -39,6 +39,7 @@ common defaulttexturescale = 1.0f; defaultflatscale = 1.0f; scaledtextureoffsets = true; + scaledflatoffsets = true; // Colormap/fade related options maxcolormapalpha = 25; diff --git a/Source/Core/Config/GameConfiguration.cs b/Source/Core/Config/GameConfiguration.cs index b0fa68dd..f087f071 100644 --- a/Source/Core/Config/GameConfiguration.cs +++ b/Source/Core/Config/GameConfiguration.cs @@ -74,6 +74,7 @@ namespace CodeImp.DoomBuilder.Config private readonly string defaultfloortexture; //mxd private readonly string defaultceilingtexture; //mxd private readonly bool scaledtextureoffsets; + private readonly bool scaledflatoffsets; //sphere private readonly string defaultsavecompiler; private readonly string defaulttestcompiler; private readonly string formatinterface; @@ -255,6 +256,7 @@ namespace CodeImp.DoomBuilder.Config public string DefaultFloorTexture { get { return defaultfloortexture; } } //mxd public string DefaultCeilingTexture { get { return defaultceilingtexture; } } //mxd public bool ScaledTextureOffsets { get { return scaledtextureoffsets; } } + public bool ScaledFlatOffsets { get { return scaledflatoffsets; } } // sphere public string FormatInterface { get { return formatinterface; } } public string DefaultLinedefActivationFlag { get { return defaultlinedefactivation; } } //mxd public string SingleSidedFlag { get { return singlesidedflag; } } @@ -484,6 +486,7 @@ namespace CodeImp.DoomBuilder.Config defaultfloortexture = cfg.ReadSetting("defaultfloortexture", "FLOOR0_1"); //mxd defaultceilingtexture = cfg.ReadSetting("defaultceilingtexture", "CEIL1_1"); //mxd scaledtextureoffsets = cfg.ReadSetting("scaledtextureoffsets", true); + scaledflatoffsets = cfg.ReadSetting("scaledflatoffsets", true); formatinterface = cfg.ReadSetting("formatinterface", ""); mixtexturesflats = cfg.ReadSetting("mixtexturesflats", false); generalizedactions = cfg.ReadSetting("generalizedlinedefs", false); diff --git a/Source/Plugins/BuilderModes/General/BuilderPlug.cs b/Source/Plugins/BuilderModes/General/BuilderPlug.cs index d2c07165..ac394842 100755 --- a/Source/Plugins/BuilderModes/General/BuilderPlug.cs +++ b/Source/Plugins/BuilderModes/General/BuilderPlug.cs @@ -387,6 +387,9 @@ namespace CodeImp.DoomBuilder.BuilderModes int color, light; bool absolute; + if (General.Map.Config.ScaledFlatOffsets) + offset /= scale; + //mxd. Apply GLDEFS override? if(General.Map.Data.GlowingFlats.ContainsKey(s.LongFloorTexture) && General.Map.Data.GlowingFlats[s.LongFloorTexture].Fullbright) @@ -447,8 +450,11 @@ namespace CodeImp.DoomBuilder.BuilderModes int color, light; bool absolute; + if (General.Map.Config.ScaledFlatOffsets) + offset /= scale; + //mxd. Apply GLDEFS override? - if(General.Map.Data.GlowingFlats.ContainsKey(s.LongCeilTexture) + if (General.Map.Data.GlowingFlats.ContainsKey(s.LongCeilTexture) && General.Map.Data.GlowingFlats[s.LongCeilTexture].Fullbright) { color = -1; diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs index 473d51ce..954eac9d 100755 --- a/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualCeiling.cs @@ -83,9 +83,12 @@ namespace CodeImp.DoomBuilder.BuilderModes s.Fields.GetValue("ypanningceiling", 0.0)); Vector2D scale = new Vector2D(s.Fields.GetValue("xscaleceiling", 1.0), s.Fields.GetValue("yscaleceiling", 1.0)); - + + if (General.Map.Config.ScaledFlatOffsets) + offset /= scale; + //Load ceiling texture - if(s.LongCeilTexture != MapSet.EmptyLongName) + if (s.LongCeilTexture != MapSet.EmptyLongName) { base.Texture = General.Map.Data.GetFlatImage(s.LongCeilTexture); if(base.Texture == null || base.Texture is UnknownImage) @@ -544,8 +547,11 @@ namespace CodeImp.DoomBuilder.BuilderModes Vector2D scale = new Vector2D(level.sector.Fields.GetValue("xscaleceiling", 1.0), level.sector.Fields.GetValue("yscaleceiling", 1.0)); Vector2D texscale = new Vector2D(1.0f / Texture.ScaledWidth, 1.0f / Texture.ScaledHeight); - // Texture coordinates - Vector2D o = pickintersect; + if (General.Map.Config.ScaledFlatOffsets) + offset /= scale; + + // Texture coordinates + Vector2D o = pickintersect; o = o.GetRotated(rotate); o.y = -o.y; o = (o + offset) * scale * texscale; diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs index 7df96578..3eb3443a 100755 --- a/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualFloor.cs @@ -83,6 +83,9 @@ namespace CodeImp.DoomBuilder.BuilderModes s.Fields.GetValue("ypanningfloor", 0.0)); Vector2D scale = new Vector2D(s.Fields.GetValue("xscalefloor", 1.0), s.Fields.GetValue("yscalefloor", 1.0)); + + if (General.Map.Config.ScaledFlatOffsets) + offset /= scale; //Load floor texture if(s.LongFloorTexture != MapSet.EmptyLongName) @@ -492,8 +495,11 @@ namespace CodeImp.DoomBuilder.BuilderModes Vector2D scale = new Vector2D(level.sector.Fields.GetValue("xscalefloor", 1.0), level.sector.Fields.GetValue("yscalefloor", 1.0)); Vector2D texscale = new Vector2D(1.0 / Texture.ScaledWidth, 1.0 / Texture.ScaledHeight); - // Texture coordinates - Vector2D o = pickintersect; + if (General.Map.Config.ScaledFlatOffsets) + offset /= scale; + + // Texture coordinates + Vector2D o = pickintersect; o = o.GetRotated(rotate); o.y = -o.y; o = (o + offset) * scale * texscale;