directly
This commit is contained in:
1 parent
1097ed83db
commit
20d083a704
5 files changed
+14
-14
No files matched your search
@@ -869,20 +869,20 @@ namespace CalamityMod.ILEditing
|
||||
#region GeneralDrawLayer Systems Drawing
|
||||
private static void GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer drawLayer)
|
||||
{
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.End();
|
||||
GeneralParticleHandler.DrawParticleCollectionsAtSpecificLayer(drawLayer);
|
||||
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.TryBegin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
MetaballManager.DrawMetaballs(drawLayer);
|
||||
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.End();
|
||||
PrimitivePixelationSystem.DrawTargetScaled(drawLayer);
|
||||
|
||||
PixelationManager.DrawPixelatedTargets(drawLayer);
|
||||
|
||||
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.End();
|
||||
RendererManager.DrawRendererAtLayer(drawLayer);
|
||||
|
||||
}
|
||||
@@ -891,7 +891,7 @@ namespace CalamityMod.ILEditing
|
||||
{
|
||||
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.BeforeAllTiles);
|
||||
// TODO: [SAFEACTION] this is a bandaid solution, but almost assuredly the method call here does not always correct state
|
||||
Main.spriteBatch.TryBegin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
orig(self);
|
||||
}
|
||||
|
||||
@@ -932,7 +932,7 @@ namespace CalamityMod.ILEditing
|
||||
orig(self);
|
||||
GeneralDrawLayer_DrawForSupportedSystems(GeneralDrawLayer.AfterEverything);
|
||||
// TODO: [SAFEACTION] this is a bandaid solution, but almost assuredly the method call here does not always correct state
|
||||
Main.spriteBatch.TryBegin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
+1
-1
@@ -250,7 +250,7 @@ namespace CalamityMod.Skies
|
||||
Rectangle dest = new Rectangle(posOffset.X - tex.Width, posOffset.Y - tex.Height, (int)(tex.Width * repeatX), (int)(tex.Height * repeatY));
|
||||
|
||||
//We need the texture to loop, so we use a linearwrap sampler state. We draw it one extra texture size in all directions around the screen to provide buffer for the posOffset.
|
||||
spriteBatch.TryEnd();
|
||||
spriteBatch.End();
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, RasterizerState.CullCounterClockwise);
|
||||
|
||||
spriteBatch.Draw(
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem
|
||||
}
|
||||
|
||||
orig();
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.End();
|
||||
}
|
||||
|
||||
private static void DrawCollectionsToTarget(Dictionary<BlendState, ManagedRenderTarget> targetCollection, Matrix pixelationMatrix, List<PixelatedDrawer> drawerCollection)
|
||||
@@ -197,8 +197,8 @@ namespace CalamityMod.Systems.Graphic.PixelationSystem
|
||||
var targetCollection = ReturnAssociatedTargetCollection(drawLayer);
|
||||
foreach (var keyValuePair in targetCollection)
|
||||
{
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.TryBegin(default, keyValuePair.Key, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(default, keyValuePair.Key, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
|
||||
|
||||
float targetScale = 1f / PixelationResolution;
|
||||
Main.spriteBatch.Draw(keyValuePair.Value, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, targetScale, SpriteEffects.None, 0f);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Systems
|
||||
{
|
||||
BakeBlendTexture_Inner(texture);
|
||||
// TODO: [SAFEACTION] Bandaid fix
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.End();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace CalamityMod.Systems
|
||||
}
|
||||
});
|
||||
// TODO: [SAFEACTION] bandaid fix
|
||||
Main.spriteBatch.TryEnd();
|
||||
Main.spriteBatch.End();
|
||||
graphicsDevice.SetRenderTarget(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace CalamityMod
|
||||
return;
|
||||
|
||||
spriteBatch.GetParameters(out var parameters);
|
||||
spriteBatch.TryEnd();
|
||||
spriteBatch.End();
|
||||
|
||||
spriteBatch.Begin(sortMode, settings.blendState, settings.samplerState, settings.depthStencilState, settings.rasterizerState ?? Main.Rasterizer, effect, transformMatrix);
|
||||
batchCallback?.Invoke();
|
||||
|
||||
Reference in new issue
Block a user