add more perf diagnostics for removing this fail with units selected..

This commit is contained in:
Chris Forbes
2010-03-22 18:06:36 +13:00
parent c8cb683373
commit 2ed7cc5cc2
2 changed files with 15 additions and 9 deletions

View File

@@ -19,6 +19,7 @@
#endregion #endregion
using System; using System;
using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -31,7 +32,6 @@ using OpenRA.Network;
using OpenRA.Support; using OpenRA.Support;
using OpenRA.Traits; using OpenRA.Traits;
using Timer = OpenRA.Support.Timer; using Timer = OpenRA.Support.Timer;
using System.Collections.Generic;
namespace OpenRA namespace OpenRA
{ {
@@ -144,6 +144,7 @@ namespace OpenRA
PerfHistory.items["render"].hasNormalTick = false; PerfHistory.items["render"].hasNormalTick = false;
PerfHistory.items["batches"].hasNormalTick = false; PerfHistory.items["batches"].hasNormalTick = false;
PerfHistory.items["text"].hasNormalTick = false; PerfHistory.items["text"].hasNormalTick = false;
PerfHistory.items["cursor"].hasNormalTick = false;
Game.controller = controller; Game.controller = controller;
ChangeMap(mapName); ChangeMap(mapName);
@@ -223,6 +224,7 @@ namespace OpenRA
PerfHistory.items["render"].Tick(); PerfHistory.items["render"].Tick();
PerfHistory.items["batches"].Tick(); PerfHistory.items["batches"].Tick();
PerfHistory.items["text"].Tick(); PerfHistory.items["text"].Tick();
PerfHistory.items["cursor"].Tick();
} }
public static void SyncLobbyInfo(string data) public static void SyncLobbyInfo(string data)

View File

@@ -22,6 +22,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Support;
namespace OpenRA.Orders namespace OpenRA.Orders
{ {
@@ -51,6 +52,8 @@ namespace OpenRA.Orders
} }
string ChooseCursor( World world, MouseInput mi ) string ChooseCursor( World world, MouseInput mi )
{
using (new PerfSample("cursor"))
{ {
var p = Game.controller.MousePosition; var p = Game.controller.MousePosition;
var c = Order(world, p.ToInt2(), mi) var c = Order(world, p.ToInt2(), mi)
@@ -62,6 +65,7 @@ namespace OpenRA.Orders
Game.CellSize * p).Any() Game.CellSize * p).Any()
? "select" : "default"); ? "select" : "default");
} }
}
string CursorForOrderString(string s, Actor a, int2 location) string CursorForOrderString(string s, Actor a, int2 location)
{ {