batch count vis

This commit is contained in:
Chris Forbes
2009-11-19 18:22:42 +13:00
parent db965cd22d
commit 1d60fa3343
2 changed files with 11 additions and 4 deletions

View File

@@ -96,6 +96,7 @@ namespace OpenRa.Game
skipMakeAnims = false; skipMakeAnims = false;
PerfHistory.items["render"].hasNormalTick = false; PerfHistory.items["render"].hasNormalTick = false;
PerfHistory.items["batches"].hasNormalTick = false;
chrome = new Chrome(renderer); chrome = new Chrome(renderer);
} }
@@ -203,6 +204,7 @@ namespace OpenRa.Game
} }
PerfHistory.items["render"].Tick(); PerfHistory.items["render"].Tick();
PerfHistory.items["batches"].Tick();
} }
public static bool IsCellBuildable(int2 a, UnitMovementType umt) public static bool IsCellBuildable(int2 a, UnitMovementType umt)

View File

@@ -3,6 +3,7 @@ using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using Ijw.DirectX; using Ijw.DirectX;
using OpenRa.FileFormats; using OpenRa.FileFormats;
using OpenRa.Game.Support;
namespace OpenRa.Game.Graphics namespace OpenRa.Game.Graphics
{ {
@@ -78,6 +79,8 @@ namespace OpenRa.Game.Graphics
device.DrawIndexedPrimitives(type, device.DrawIndexedPrimitives(type,
vertexRange, indexRange); vertexRange, indexRange);
PerfHistory.Increment("batches", 1);
} }
public void DrawBatch<T>(FvfVertexBuffer<T> vertices, IndexBuffer indices, public void DrawBatch<T>(FvfVertexBuffer<T> vertices, IndexBuffer indices,
@@ -92,6 +95,8 @@ namespace OpenRa.Game.Graphics
device.DrawIndexedPrimitives(type, device.DrawIndexedPrimitives(type,
vertexPool, numPrimitives); vertexPool, numPrimitives);
PerfHistory.Increment("batches", 1);
} }
public void DrawText(string text, int2 pos, Color c) public void DrawText(string text, int2 pos, Color c)