From 63aa190afe09bd88033105684618a49e1f986d49 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Thu, 23 Jan 2020 16:18:28 -0500 Subject: [PATCH] move Debug.Enabled check into DrawToasts GitOrigin-RevId: 8265b948f772443580166f89fc39d46735852da3 --- Shared/Debug.cs | 5 ++++- Shared/SneakGame.cs | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Shared/Debug.cs b/Shared/Debug.cs index 10cddf2..89a3448 100644 --- a/Shared/Debug.cs +++ b/Shared/Debug.cs @@ -71,6 +71,9 @@ namespace SemiColinGames { } public static void DrawToasts(SpriteBatch spriteBatch, SpriteFont font) { + if (!Enabled) { + return; + } int y = 10; foreach (var toast in toasts) { spriteBatch.DrawString(font, toast, new Vector2(10, y), Color.Teal); @@ -103,7 +106,7 @@ namespace SemiColinGames { Point[] points = Line.Rasterize(line.Start, line.End); foreach (var point in points) { spriteBatch.Draw( - whiteTexture, new Rectangle(point.X, point.Y, 1, 1), line.Color); + whiteTexture, new Rectangle(point.X, point.Y, 1, 1), line.Color); } } } diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index 05a85c2..83168a4 100644 --- a/Shared/SneakGame.cs +++ b/Shared/SneakGame.cs @@ -133,9 +133,8 @@ namespace SemiColinGames { 0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); spriteBatch.Draw(renderTarget, drawRect, Color.White); - if (Debug.Enabled) { - Debug.DrawToasts(spriteBatch, font); - } + // Draw debug toasts. + Debug.DrawToasts(spriteBatch, font); spriteBatch.End();