From 95db4cc750192ce88b8a5161d884d1aba206b4bf Mon Sep 17 00:00:00 2001 From: MaxED Date: Sat, 7 May 2016 20:21:53 +0000 Subject: [PATCH] Game configurations: added "sidedefcompressionignoresaction" property. When set to true, sidedefs will be compressed regardless of linedef action (DB2 behaviour). When set to false, sidedefs, which belong to a line with an action, will be skipped when compressing sidedefs. Default value is false. --- Build/Configurations/Includes/ZDoom_common.cfg | 3 +++ Help/gc_basicsettings.html | 4 ++++ Source/Core/Config/GameConfiguration.cs | 3 +++ Source/Core/Map/MapSet.cs | 8 ++++++++ 4 files changed, 18 insertions(+) diff --git a/Build/Configurations/Includes/ZDoom_common.cfg b/Build/Configurations/Includes/ZDoom_common.cfg index d371cf1d..8e5789ae 100644 --- a/Build/Configurations/Includes/ZDoom_common.cfg +++ b/Build/Configurations/Includes/ZDoom_common.cfg @@ -33,6 +33,9 @@ common defaulttexturescale = 1.0f; defaultflatscale = 1.0f; scaledtextureoffsets = true; + + //mxd. Sidedefs compression + sidedefcompressionignoresaction = true; // Texture sources textures diff --git a/Help/gc_basicsettings.html b/Help/gc_basicsettings.html index cfe4a5cd..af4bb24a 100644 --- a/Help/gc_basicsettings.html +++ b/Help/gc_basicsettings.html @@ -152,6 +152,10 @@ defaultskytextures Enables support for long (> 8 chars) texture names. This is used by GZDoom Builder to limit the input fields in the user interface and to check the validity of texture names in resources. This setting should only be enabled for UDMF game configurations. Enabling this setting will make maps incompatible with Doom Builder 2 and can lead to problems in Slade 3 This does NOT determine the actual limitation on the texture names in the map file format.
Default value is false.

+ sidedefcompressionignoresaction (boolean) - GZDB only.
+ When set to true, sidedefs will be compressed regardless of linedef action (DB2 behaviour, can potentially cause problems when target source port doesn't decompress sidedefs).
+ When set to false, sidedefs, which belong to a line with an action, will be skipped when compressing sidedefs.
+ Default value is false.

diff --git a/Source/Core/Config/GameConfiguration.cs b/Source/Core/Config/GameConfiguration.cs index 80d06d7c..f5eb5c61 100644 --- a/Source/Core/Config/GameConfiguration.cs +++ b/Source/Core/Config/GameConfiguration.cs @@ -86,6 +86,7 @@ namespace CodeImp.DoomBuilder.Config private readonly bool doomlightlevels; private readonly string actionspecialhelp; //mxd private readonly string thingclasshelp; //mxd + private readonly bool sidedefcompressionignoresaction; //mxd // Skills private readonly List skills; @@ -207,6 +208,7 @@ namespace CodeImp.DoomBuilder.Config public bool DoomLightLevels { get { return doomlightlevels; } } public string ActionSpecialHelp { get { return actionspecialhelp; } } //mxd public string ThingClassHelp { get { return thingclasshelp; } } //mxd + internal bool SidedefCompressionIgnoresAction { get { return sidedefcompressionignoresaction; } } //mxd // Skills public List Skills { get { return skills; } } @@ -357,6 +359,7 @@ namespace CodeImp.DoomBuilder.Config doomlightlevels = cfg.ReadSetting("doomlightlevels", true); actionspecialhelp = cfg.ReadSetting("actionspecialhelp", string.Empty); //mxd thingclasshelp = cfg.ReadSetting("thingclasshelp", string.Empty); //mxd + sidedefcompressionignoresaction = cfg.ReadSetting("sidedefcompressionignoresaction", false); //mxd defaultlinedefactivation = cfg.ReadSetting("defaultlinedefactivation", ""); //mxd for(int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0); diff --git a/Source/Core/Map/MapSet.cs b/Source/Core/Map/MapSet.cs index 3267cc97..d7033f6e 100644 --- a/Source/Core/Map/MapSet.cs +++ b/Source/Core/Map/MapSet.cs @@ -3216,6 +3216,14 @@ namespace CodeImp.DoomBuilder.Map Sidedef stored = null; Sidedef snsd = sidedefs[sn]; + //mxd. Skip sidedef if it belongs to a linedef with an action? + if(!General.Map.Config.SidedefCompressionIgnoresAction && snsd.Line.Action != 0) + { + // Next! + sn++; + continue; + } + // Check if checksum is stored bool samesidedef = false; uint checksum = snsd.GetChecksum();