From 48a9297a57e51d5e092108bff78143c8afbf3f94 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sat, 15 Feb 2020 15:49:04 -0500 Subject: [PATCH] draw Debug stuff on top of everything (after lighting) GitOrigin-RevId: e07fbc6b27af23912de1344a1bc3788ef69fd9c5 --- Shared/SneakGame.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index 592c5d7..ca648ef 100644 --- a/Shared/SneakGame.cs +++ b/Shared/SneakGame.cs @@ -183,10 +183,6 @@ namespace SemiColinGames { // Draw foreground tiles. world.Draw(spriteBatch); - // Draw debug rects & lines. - lightingEffect.Projection = camera.Projection; - Debug.Draw(spriteBatch, GraphicsDevice, lightingEffect); - // Aaaaand we're done. spriteBatch.End(); @@ -196,6 +192,12 @@ namespace SemiColinGames { lightingEffect.Projection = camera.Projection; linesOfSight.Draw(player, world.CollisionTargets, GraphicsDevice, lightingEffect); + // Draw debug rects & lines on top. + spriteBatch.Begin( + SpriteSortMode.Deferred, null, SamplerState.LinearWrap, null, null, null, transform); + Debug.Draw(spriteBatch, GraphicsDevice, lightingEffect); + spriteBatch.End(); + // Draw sceneTarget to screen. GraphicsDevice.SetRenderTarget(null); GraphicsDevice.Clear(Color.CornflowerBlue);