From 293a51ebfcda71a1e4a4767f6a9c8e667b27a95a Mon Sep 17 00:00:00 2001 From: Big E Date: Fri, 26 Dec 2025 14:27:21 -0500 Subject: [PATCH] + Removed the unused DoGDeathAnimationRenderer --- .../DoGDeathAnimationRenderer.cs | 75 ------------------- NPCs/CalamityDrawParameterNPC.cs | 5 -- NPCs/CalamityGlobalNPC.cs | 4 - NPCs/DevourerofGods/DevourerofGodsHead.cs | 2 +- 4 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs diff --git a/Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs b/Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs deleted file mode 100644 index 8dd595233c..0000000000 --- a/Graphics/Renderers/CalamityRenderers/DoGDeathAnimationRenderer.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using CalamityMod.Enums; -using CalamityMod.NPCs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Graphics.Renderers.CalamityRenderers -{ - public class DoGDeathAnimationRenderer : BaseRenderer - { - /// - /// Used to determine whether the npc should return true in predraw or not, for exclusively drawing to the drawer target. - /// - public static bool ActuallyDoPreDraw - { - get; - private set; - } - - public override GeneralDrawLayer Layer => GeneralDrawLayer.AfterNPCs; - - public override bool ShouldDraw => false;//!Main.gameMenu && CalamityDrawParameterNPC.DoGDeathAnimationTimer > 0; - - public static bool ValidToDraw(NPC npc) - { - return false; - /* - // Do not draw inactive npcs, or ones with weird MP types less than or equal to 0. - if (!npc.active || npc.type <= NPCID.None) - return false; - - if (!CalamityDrawParameterNPC.DrawingDoGDeathAnimation[npc.whoAmI]) - return false; - - return true; - */ - } - - public override void DrawToTarget(SpriteBatch spriteBatch) - { - // Indicate that DoG and his segments should draw. - ActuallyDoPreDraw = true; - - // Draw every npc to a single target that should have the disintegration visual. - foreach (NPC npc in Main.ActiveNPCs) - { - // Extra check to ensure that index errors will not occur. If not in range, something has gone wrong and the loop should terminate. - if (!Main.npc.IndexInRange(npc.whoAmI)) - break; - - // Draw the NPCs to the target once everything is valid and set the disintegration progress variable. - // Also ensure to indicate that the renderer should allow drawing the target here as well. - if (ValidToDraw(npc)) - Main.instance.DrawNPC(npc.whoAmI, npc.behindTiles); - } - - // Indicate that DoG and his segments should no longer draw. - ActuallyDoPreDraw = false; - } - - public override void DrawTarget(SpriteBatch spriteBatch) - { - - spriteBatch.Draw(MainTarget, Vector2.Zero, Color.White); - - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise); - } - } -} diff --git a/NPCs/CalamityDrawParameterNPC.cs b/NPCs/CalamityDrawParameterNPC.cs index 91fd106261..bf4d15ddbe 100644 --- a/NPCs/CalamityDrawParameterNPC.cs +++ b/NPCs/CalamityDrawParameterNPC.cs @@ -16,7 +16,6 @@ namespace CalamityMod.NPCs #region Draw Parameters public static bool[] DrawingMiracleBlight { get; private set; } public static bool[] DrawingPolarity { get; private set; } - public static bool[] DrawingDoGDeathAnimation { get; private set; } public static int DoGDeathAnimationTimer { get; private set; } #endregion @@ -44,14 +43,12 @@ namespace CalamityMod.NPCs { DrawingMiracleBlight = new bool[Main.maxNPCs + 1]; DrawingPolarity = new bool[Main.maxNPCs + 1]; - DrawingDoGDeathAnimation = new bool[Main.maxNPCs + 1]; } public override void Unload() { DrawingMiracleBlight = null; DrawingPolarity = null; - DrawingDoGDeathAnimation = null; } #endregion @@ -67,7 +64,6 @@ namespace CalamityMod.NPCs var whoAmI = npc.whoAmI; DrawingMiracleBlight[whoAmI] = false; DrawingPolarity[whoAmI] = false; - DrawingDoGDeathAnimation[whoAmI] = false; } public override bool PreAI(NPC npc) @@ -81,7 +77,6 @@ namespace CalamityMod.NPCs var whoAmI = npc.whoAmI; DrawingMiracleBlight[whoAmI] = ShouldDrawMiracleBlight(npc); DrawingPolarity[whoAmI] = ShouldDrawPolarity(npc); - DrawingDoGDeathAnimation[whoAmI] = ShouldDrawDoGDeathAnimation(npc); return true; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 1c16de3fac..025ae9494f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5390,10 +5390,6 @@ namespace CalamityMod.NPCs // Only draw the NPC if told to by the miracle blight drawer. if (MiracleBlightRenderer.ValidToDraw(npc)) return MiracleBlightRenderer.ActuallyDoPreDraw; - - // Only draw DoG's death animation when told to by the renderer. - if (DoGDeathAnimationRenderer.ValidToDraw(npc)) - return DoGDeathAnimationRenderer.ActuallyDoPreDraw; } if (Main.zenithWorld) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 7ab65c83bb..08de745aa7 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2502,7 +2502,7 @@ namespace CalamityMod.NPCs.DevourerofGods spriteBatch.Draw(mainJawGlowTexture, jawDrawPosition, null, NPC.GetAlpha(Color.White), NPC.rotation + JawRotation * i, jawOrigin, NPC.scale, jawSpriteEffect, 0f); // Draw the additional special jaw textures above these for the Rift Dash attack. - if (GodSlayerDashJawFadeProgress > 0.02f && !DoGDeathAnimationRenderer.ValidToDraw(NPC)) + if (GodSlayerDashJawFadeProgress > 0.02f && CalamityDrawParameterNPC.DoGDeathAnimationTimer <= 0) { using (spriteBatch.Scope()) {