From b141ccfd156ec0264137a8a5f919293300a874aa Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Fri, 23 Sep 2022 22:02:19 -0400 Subject: [PATCH] Fixed Uelibloom Bricks and Otherworldly Stone not drawing their special textures --- .../OtherworldlyStone.cs | 23 ++++++++--------- Tiles/UelibloomBrick.cs | 25 ++++++++----------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs index dd5f32d86d..e07885b4bf 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs @@ -2,8 +2,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ModLoader; +using Terraria.DataStructures; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { @@ -36,17 +37,16 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly return false; } - /* - * TODO -- Find some way to make this work again with the new parameters. - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { - if ((Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || - Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type) && - nextSpecialDrawIndex < Main.specX.Length) + if (Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || + Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type) { - Main.specX[nextSpecialDrawIndex] = i; - Main.specY[nextSpecialDrawIndex] = j; - nextSpecialDrawIndex++; + try + { + Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); + } + catch {} } } @@ -55,13 +55,12 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; Color drawColour = GetDrawColour(i, j); - Texture2D cloth = ModContent.Request("CalamityMod/Tiles/FurnitureOtherworldly/OtherworldlyStone_Cloth"); + Texture2D cloth = ModContent.Request("CalamityMod/Tiles/FurnitureOtherworldly/OtherworldlyStone_Cloth").Value; DrawExtraTop(i, j, cloth, drawOffset, drawColour); DrawExtraWallEnds(i, j, cloth, drawOffset, drawColour); DrawExtraDrapes(i, j, cloth, drawOffset, drawColour); } - */ #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index a2b39658eb..96c051a829 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -1,10 +1,10 @@ - -using CalamityMod.Dusts.Furniture; +using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ModLoader; +using Terraria.DataStructures; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Tiles { @@ -35,18 +35,16 @@ namespace CalamityMod.Tiles return false; } - // TODO -- Fix the drapes from these. This uses specialized drawing hooks which appear to currently be private in 1.4. - // This may require either gross reflection or contacting TML developers to make the necessary information for this public again. - /* - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref Color drawColor, ref int nextSpecialDrawIndex) + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { - if ((Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || - Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type) && - nextSpecialDrawIndex < Main.specX.Length) + if (Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || + Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type) { - Main.specX[nextSpecialDrawIndex] = i; - Main.specY[nextSpecialDrawIndex] = j; - nextSpecialDrawIndex++; + try + { + Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); + } + catch {} } } @@ -61,7 +59,6 @@ namespace CalamityMod.Tiles DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour); DrawExtraDrapes(i, j, leaves, drawOffset, drawColour); } - */ public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) {