From 90ad505cffb8e09b8dcd5e98ea533d5333717a91 Mon Sep 17 00:00:00 2001 From: Stephen Thiebaud Date: Wed, 10 Dec 2025 01:54:48 -0600 Subject: [PATCH] correct begin calls now --- CalPlayer/CalamityPlayerDrawEffects.cs | 2 +- Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs | 2 +- Items/Accessories/ProfanedSoulArtifact.cs | 2 +- Items/Accessories/RoverDrive.cs | 2 +- Items/Accessories/TheSponge.cs | 2 +- Items/Armor/LunicCorps/LunicCorpsHelmet.cs | 2 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 2 +- NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs | 2 +- NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs | 2 +- NPCs/Providence/Providence.cs | 2 +- Projectiles/Boss/DoGTeleportRift.cs | 2 +- Projectiles/Summon/SarosAura.cs | 2 +- Projectiles/Summon/SunSpiritMinion.cs | 2 +- Projectiles/Summon/VengefulSunSpiritMinion.cs | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 321de7f52c..b9459108dc 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -126,7 +126,7 @@ namespace CalamityMod.CalPlayer var circleTex = ModContent.Request("CalamityMod/ExtraTextures/BasicCircle").Value; using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); Main.spriteBatch.Draw(bloomTex, Player.Center + (Vector2.UnitX * Player.direction).RotatedBy(Player.itemRotation) * (48 + scale * 96) - Main.screenPosition, null, color, 0, bloomTex.Size() * 0.5f, scale * 2.0f, SpriteEffects.None, 0); Main.spriteBatch.Draw(bloomTex, Player.Center + (Vector2.UnitX * Player.direction).RotatedBy(Player.itemRotation) * (48 + scale * 96) - Main.screenPosition, null, color, 0, bloomTex.Size() * 0.5f, scale * 2.0f, SpriteEffects.None, 0); Main.spriteBatch.End(); diff --git a/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs b/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs index fd7ca5e24f..56add166d2 100644 --- a/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/DyeableShadersRenderer.cs @@ -181,7 +181,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers var matrix = Main.GameViewMatrix.TransformationMatrix; using (spriteBatch.Scope()) { - spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.AlphaBlend, null, matrix); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, matrix); foreach (var renderer in RenderersToDrawThisFrame) { if (!Targets.TryGetValue(renderer, out var target)) diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index 82feae57e9..a82156d604 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -169,7 +169,7 @@ namespace CalamityMod.Items.Accessories using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, shieldEffect, Matrix.Identity); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, shieldEffect, Matrix.Identity); // Fetch shield heat overlay texture (this is the neutrons fed to the shader) HeatTex ??= ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2"); Vector2 pos = player.MountedCenter + player.gfxOffY * Vector2.UnitY - Main.screenPosition; diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index df30ce14ea..fa873f7040 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Items.Accessories using (spriteBatch.Scope()) { - spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, shieldEffect, Matrix.Identity); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, shieldEffect, Matrix.Identity); // Fetch shield noise overlay texture (this is the techy overlay fed to the shader) NoiseTex ??= ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/TechyNoise"); Vector2 pos = player.MountedCenter + player.gfxOffY * Vector2.UnitY - Main.screenPosition; diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 3d6a00299c..7b16bfeb4d 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -234,7 +234,7 @@ namespace CalamityMod.Items.Accessories using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, shieldEffect, Matrix.Identity); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, shieldEffect, Matrix.Identity); // Fetch shield noise overlay texture (this is the polygons fed to the shader) NoiseTex ??= ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons"); Vector2 pos = player.MountedCenter + player.gfxOffY * Vector2.UnitY - Main.screenPosition; diff --git a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs index b4cbc90108..c7548c4f59 100644 --- a/Items/Armor/LunicCorps/LunicCorpsHelmet.cs +++ b/Items/Armor/LunicCorps/LunicCorpsHelmet.cs @@ -173,7 +173,7 @@ namespace CalamityMod.Items.Armor.LunicCorps using (spriteBatch.Scope()) { - spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, shieldEffect, Matrix.Identity); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, shieldEffect, Matrix.Identity); // Fetch shield noise overlay texture (this is the polygons fed to the shader) NoiseTex ??= ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/VoronoiShapes2"); Vector2 pos = player.MountedCenter + player.gfxOffY * Vector2.UnitY - Main.screenPosition; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 12b85969b0..070fd2eb78 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -2461,7 +2461,7 @@ namespace CalamityMod.NPCs.DevourerofGods { using (spriteBatch.Scope()) { - spriteBatch.Begin(SpriteSortMode.Deferred, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); Vector2 godSlayerJawOrigin = GodSlayerDashJawTexture.Size() * 0.5f; float godSlayerJawOpacity = GodSlayerDashJawFadeProgress; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 2dcbae23d5..caf07e873e 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -1184,7 +1184,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians var matrix = Main.GameViewMatrix.TransformationMatrix; using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, shieldEffect, matrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, shieldEffect, matrix); // Fetch shield heat overlay texture (this is the neutrons fed to the shader) Texture2D heatTex = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2").Value; Vector2 pos = NPC.Center + NPC.gfxOffY * Vector2.UnitY - Main.screenPosition; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 186751fb60..a92f968510 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -900,7 +900,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, shieldEffect, matrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, shieldEffect, matrix); // Fetch shield heat overlay texture (this is the neutrons fed to the shader) Texture2D heatTex = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2").Value; Vector2 pos = NPC.Center + NPC.gfxOffY * Vector2.UnitY - Main.screenPosition; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index ff1e95d084..ec8b5caafb 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -2406,7 +2406,7 @@ namespace CalamityMod.NPCs.Providence var matrix = Main.GameViewMatrix.TransformationMatrix; using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, shieldEffect, matrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, shieldEffect, matrix); // Fetch shield heat overlay texture (this is the neutrons fed to the shader) Texture2D heatTex = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2").Value; Vector2 pos = NPC.Center + NPC.gfxOffY * Vector2.UnitY - Main.screenPosition; diff --git a/Projectiles/Boss/DoGTeleportRift.cs b/Projectiles/Boss/DoGTeleportRift.cs index f9ba2af915..9c758d1a81 100644 --- a/Projectiles/Boss/DoGTeleportRift.cs +++ b/Projectiles/Boss/DoGTeleportRift.cs @@ -264,7 +264,7 @@ namespace CalamityMod.Projectiles.Boss crackShader.Parameters["brighterPixelColor"].SetValue(Color.White.ToVector3()); using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BatchSetting.Additive, crackShader, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, crackShader, Main.GameViewMatrix.TransformationMatrix); int crackCount = FakeRift ? 1 : 3; for (int i = 0; i < crackCount; i++) { diff --git a/Projectiles/Summon/SarosAura.cs b/Projectiles/Summon/SarosAura.cs index eb3dabcd27..6ed1df3e59 100644 --- a/Projectiles/Summon/SarosAura.cs +++ b/Projectiles/Summon/SarosAura.cs @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Summon { using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); //Sigil var spTex = TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/SunSpiritMinion.cs b/Projectiles/Summon/SunSpiritMinion.cs index d07367f615..39bec75e41 100644 --- a/Projectiles/Summon/SunSpiritMinion.cs +++ b/Projectiles/Summon/SunSpiritMinion.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Summon using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); float count = MathHelper.Min(Projectile.minionSlots * 2, 40); for (var i = 0; i < count; i++) { diff --git a/Projectiles/Summon/VengefulSunSpiritMinion.cs b/Projectiles/Summon/VengefulSunSpiritMinion.cs index 40196cf2ad..65da03e6ce 100644 --- a/Projectiles/Summon/VengefulSunSpiritMinion.cs +++ b/Projectiles/Summon/VengefulSunSpiritMinion.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Summon Main.spriteBatch.Draw(whiteTex, Projectile.Center - Main.screenPosition, null, Color.Black * completion, Main.GlobalTimeWrappedHourly, spTex.Size() * 0.5f, 0.75f, SpriteEffects.None, 0); using (Main.spriteBatch.Scope()) { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); color = Color.Lerp(Color.Yellow, Color.OrangeRed, completion); if (completion >= 1) color = Color.LightBlue;