+ Removed the unused DoGDeathAnimationRenderer

This commit is contained in:
Big E committed 2025-12-26 14:27:21 -05:00
1 parent d276239ef4
commit 293a51ebfc
4 files changed
+1 -85

No files matched your search

@@ -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
{
/// <summary>
/// Used to determine whether the npc should return true in predraw or not, for exclusively drawing to the drawer target.
/// </summary>
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);
}
}
}
-5
View File
@@ -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;
}
-4
View File
@@ -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)
+1 -1
View File
@@ -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())
{