diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 768fc5c546..3935c1af0a 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using System.Runtime.Serialization; using CalamityMod.Enums; +using CalamityMod.Systems; using CalamityMod.UI; using CalamityMod.UI.DraedonsArsenal; using CalamityMod.UI.Rippers; @@ -82,6 +83,10 @@ namespace CalamityMod [Range(0.0f, 1.0f)] public float EnergyShieldOpacity { get; set; } + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(TileBlendingQuality.Normal)] + public TileBlendingQuality TileTextureBlendingQuality { get; set; } + #endregion #region UI Changes diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index b55e1840fa..858c06e99c 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -368,6 +368,15 @@ CalamityClientConfig: { ''' } + TileTextureBlendingQuality: { + Label: "[i:GlowPaint] Tile Blending Quality" + Tooltip: + ''' + Change quality of tile merge soft-blending renderer. + This controls the quality of soft-blending between different types of merged tile. + ''' + } + VanillaCooldownDisplay: { Label: "[i:HealingPotion] Display Vanilla Cooldowns" Tooltip: @@ -596,3 +605,26 @@ SetBonusDoubleTapOptions: { Tooltip: Always disables double-tap. Can be used to completely disable set bonus activation. } } + +TileBlendingQuality: { + Tooltip: "" + + Disable: { + Label: Disable + Tooltip: "Disable Tile Texture Soft Blending" + } + + Normal: { + Label: Normal + Tooltip: "Enable Tile Texture Soft Blending" + } + + High: { + Label: High + Tooltip: + ''' + Enable Tile Texture Soft Blending. + [c/F05A5A:Allows Sliced Rendering. Not recommended for low-end devices.] + ''' + } +} diff --git a/Systems/TileMerging/DataStructures.cs b/Systems/TileMerging/DataStructures.cs index cd15c734dc..f164e549ef 100644 --- a/Systems/TileMerging/DataStructures.cs +++ b/Systems/TileMerging/DataStructures.cs @@ -152,4 +152,11 @@ namespace CalamityMod.Systems public ushort SheetIndex = sheetIdx; public byte BlendData = blendData; } + + public enum TileBlendingQuality + { + Disable, + Normal, + High + } } diff --git a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs index 4b98e4bee9..a9524daca2 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_Draw.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_Draw.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Systems { orig(self, solidLayer, forRenderTargets, intoRenderTargets, waterStyleOverride); - if (!solidLayer) + if (!solidLayer || CalamityClientConfig.Instance.TileTextureBlendingQuality == TileBlendingQuality.Disable) return; var screenPosition = Main.Camera.UnscaledPosition; @@ -84,7 +84,8 @@ namespace CalamityMod.Systems Color[] colorSliceBuffer = ColorSliceBuffer.Value; // Is HalfBlock condition is also in vanilla, so we follow that - if (Lighting.NotRetro && !tile.IsHalfBlock && !TileID.Sets.DontDrawTileSliced[tileType]) + var silcedConfigEnabled = CalamityClientConfig.Instance.TileTextureBlendingQuality == TileBlendingQuality.High; + if (silcedConfigEnabled && Lighting.NotRetro && !tile.IsHalfBlock && !TileID.Sets.DontDrawTileSliced[tileType]) { var tileRenderer = Main.instance.TilesRenderer; if (tileLight.IsAnyChannelGreaterThan(tileRenderer._highQualityLightingRequirement)) diff --git a/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs b/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs index 5ca6372db7..5aa10e3b83 100644 --- a/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs +++ b/Systems/TileMerging/TileBlendMergeSystem_GlobalTile.cs @@ -20,6 +20,9 @@ namespace CalamityMod.Systems public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) { + if (CalamityClientConfig.Instance.TileTextureBlendingQuality == TileBlendingQuality.Disable) + return; + if (CalamityTileSets.DrawBlendMergeAfterSolidTile[type]) return;