ore timing too

This commit is contained in:
Chris Forbes
2009-11-04 20:44:05 +13:00
parent db89136adf
commit 0d2b7eb855
2 changed files with 7 additions and 3 deletions

View File

@@ -143,6 +143,7 @@ namespace OpenRa.Game
public static int RenderFrame = 0; public static int RenderFrame = 0;
public static double RenderTime = 0.0; public static double RenderTime = 0.0;
public static double TickTime = 0.0; public static double TickTime = 0.0;
public static double OreTime = 0.0;
public static Stopwatch sw; public static Stopwatch sw;
@@ -162,7 +163,9 @@ namespace OpenRa.Game
if (--oreTicks == 0) if (--oreTicks == 0)
{ {
map.GrowOre(p => IsCellBuildable(p, UnitMovementType.Wheel), SharedRandom); var oresw = new Stopwatch();
map.GrowOre(p => IsCellBuildable(p, UnitMovementType.Wheel), SharedRandom);
OreTime = oresw.ElapsedTime();
oreTicks = oreFrequency; oreTicks = oreFrequency;
} }
world.Tick(); world.Tick();

View File

@@ -99,10 +99,11 @@ namespace OpenRa.Game.Graphics
lineRenderer.Flush(); lineRenderer.Flush();
renderer.DrawText(string.Format("RenderFrame {0} ({2:F1} ms) Tick {1} ({3:F1} ms)", renderer.DrawText(string.Format("RenderFrame {0} ({2:F1} ms) Tick {1} ({3:F1} ms) Ore ({4:F1} ms)",
Game.RenderFrame, Game.orderManager.FrameNumber, Game.RenderFrame, Game.orderManager.FrameNumber,
Game.RenderTime * 1000, Game.RenderTime * 1000,
Game.TickTime * 1000), new int2(5, 5), Color.White); Game.TickTime * 1000,
Game.OreTime * 1000), new int2(5, 5), Color.White);
} }
const float conditionYellow = 0.5f; /* todo: get these from gamerules */ const float conditionYellow = 0.5f; /* todo: get these from gamerules */