diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index b473b2e383..64ca80e336 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Runtime.CompilerServices; using CalamityMod.Systems; using CalamityMod.Tiles; @@ -21,7 +20,6 @@ using CalamityMod.Tiles.SunkenSea; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent; using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -167,7 +165,7 @@ namespace CalamityMod public static void DrawFlameSparks(int dustType, int rarity, int i, int j) { - if (!Main.gamePaused && Main.instance.IsActive && !Main.tile[i,j].IsTileActuallyInvisible() && (!Lighting.UpdateEveryFrame || Main.rand.NextBool(4))) + if (!Main.gamePaused && Main.instance.IsActive && !Main.tile[i, j].IsTileActuallyInvisible() && (!Lighting.UpdateEveryFrame || Main.rand.NextBool(4))) { if (Main.rand.NextBool(rarity)) { @@ -287,45 +285,6 @@ namespace CalamityMod return PaintID.DeepRedPaint >= paintType && paintType <= PaintID.DeepPinkPaint; } - /// - /// Draws placed wall with multiple variants, properly painted. - /// - /// The sprite batch. - /// The type of wall. - /// The x co-ordinate of the wall. - /// The y co-ordinate of the wall. - /// The offset within the spritesheet, similar to TileFrame. - /// Whether or not PreDraw is drawn - public static bool DrawMultiVariantWall(this SpriteBatch spriteBatch, int type, int i, int j, int[] sheetOffset) - { - if (spriteBatch is null) - return true; - - spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, Main.GameViewMatrix.TransformationMatrix, () => - { - Tile tile = Main.tile[i, j]; - Effect tileShader = Main.tileShader; - TreePaintingSettings settings = TreePaintSystemData.GetWallSettings(type); - int paintColor = tile.WallColor; - tileShader.Parameters["leafHueTestOffset"]?.SetValue(settings.HueTestOffset); - tileShader.Parameters["leafMinHue"]?.SetValue(settings.SpecialGroupMinimalHueValue); - tileShader.Parameters["leafMaxHue"]?.SetValue(settings.SpecialGroupMaximumHueValue); - tileShader.Parameters["leafMinSat"]?.SetValue(settings.SpecialGroupMinimumSaturationValue); - tileShader.Parameters["leafMaxSat"]?.SetValue(settings.SpecialGroupMaximumSaturationValue); - tileShader.Parameters["invertSpecialGroupResult"]?.SetValue(settings.InvertSpecialGroupResult); - int index = Main.ConvertPaintIdToTileShaderIndex(paintColor, settings.UseSpecialGroups, settings.UseWallShaderHacks); - tileShader.CurrentTechnique.Passes[index].Apply(); - - Texture2D sprite = TextureAssets.Wall[type].Value; - Vector2 offset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + (Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange)) - Vector2.One * 8f; - Rectangle frame = new Rectangle(sheetOffset[0] + tile.WallFrameX, sheetOffset[1] + tile.WallFrameY, 32, 32); - Color lightColor = tile.IsWallFullbright ? Color.White : Lighting.GetColor(i, j); - - spriteBatch.Draw(sprite, offset, frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - }); - return false; - } - public static Tile ParanoidTileRetrieval(int x, int y) { if (!WorldGen.InWorld(x, y)) @@ -723,7 +682,7 @@ namespace CalamityMod x = Math.DivRem((int)tileId, Main.tile.Height, out y); //Thanks to FoxXD_ for the help with this } - + /// /// Determines if a tile is solid ground based on whether it's active and not actuated or if the tile is solid in any way, including just the top. ///