FPS counter can be enabled separately from DebugDraw

This commit is contained in:
juanjp600
2017-12-15 11:28:46 -03:00
parent 5e62371a09
commit c203ece2cb
2 changed files with 8 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -427,12 +427,15 @@ namespace Barotrauma
ScreenOverlayColor, true);
}
if (GameMain.DebugDraw)
if (GameMain.ShowFPS || GameMain.DebugDraw)
{
DrawString(spriteBatch, new Vector2(10, 10),
DrawString(spriteBatch, new Vector2(10, 10),
"FPS: " + (int)GameMain.FrameCounter.AverageFramesPerSecond,
Color.White, Color.Black * 0.5f, 0, SmallFont);
}
if (GameMain.DebugDraw)
{
DrawString(spriteBatch, new Vector2(10, 25),
"Physics: " + GameMain.World.UpdateTime,
Color.White, Color.Black * 0.5f, 0, SmallFont);

View File

@@ -1,4 +1,4 @@
using Barotrauma.Networking;
using Barotrauma.Networking;
using Barotrauma.Particles;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
@@ -14,6 +14,7 @@ namespace Barotrauma
{
class GameMain : Game
{
public static bool ShowFPS = true;
public static bool DebugDraw;
public static FrameCounter FrameCounter;