From 570da6961bb48050c494fa36aeb40fe42eaec8f9 Mon Sep 17 00:00:00 2001 From: fryzahh Date: Mon, 17 Nov 2025 21:31:58 -0400 Subject: [PATCH] Fixed pixelated assets being offset by camera movements * Pixelated assets are now drawn to render targets during Main.CheckMonoliths instead of Main.PreDraw. The latter drew them to early and caused them to be offset incorrectly whenever the camera moved --- Systems/Graphic/PixelationSystem/PixelationManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Systems/Graphic/PixelationSystem/PixelationManager.cs b/Systems/Graphic/PixelationSystem/PixelationManager.cs index 8758c40444..24b243a8dd 100644 --- a/Systems/Graphic/PixelationSystem/PixelationManager.cs +++ b/Systems/Graphic/PixelationSystem/PixelationManager.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem ActivePixelatedDrawers_AfterDusts = []; ActivePixelatedDrawers_AfterEverything = []; - RenderTargetManager.RenderTargetUpdateLoopEvent += PrepareTargets; + On_Main.CheckMonoliths += PrepareTargets; } public override void Unload() @@ -148,7 +148,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem ReturnAssociatedDrawerCollection(drawLayer).Add(drawer); } - private static void PrepareTargets() + private static void PrepareTargets(On_Main.orig_CheckMonoliths orig) { if (!Main.gameMenu && !Main.dedServ) { @@ -165,6 +165,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem Main.graphics.GraphicsDevice.SetRenderTarget(null); } + + orig(); } private static void DrawCollectionsToTarget(Dictionary targetCollection, Matrix pixelationMatrix, List drawerCollection)