having a look at this perf stuff...
This commit is contained in:
@@ -477,5 +477,10 @@ namespace OpenRA
|
||||
{
|
||||
quit = true;
|
||||
}
|
||||
|
||||
public static void Debug(string s)
|
||||
{
|
||||
chat.AddLine(Color.White, "Debug", s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenRA.Orders
|
||||
|
||||
string ChooseCursor(World world, MouseInput mi)
|
||||
{
|
||||
using (new PerfSample("cursor"))
|
||||
//using (new PerfSample("cursor"))
|
||||
{
|
||||
var p = Game.controller.MousePosition;
|
||||
var c = Order(world, p.ToInt2(), mi)
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace OpenRA
|
||||
{
|
||||
using (new PerfSample("find_unit_path"))
|
||||
{
|
||||
Game.Debug("FindUnitPath {0} -> {1}".F(from, target));
|
||||
|
||||
var pb = FindBidiPath(
|
||||
PathSearch.FromPoint(world, target, from, umt, false).WithCustomBlocker(AvoidUnitsNear(from, 4)),
|
||||
PathSearch.FromPoint(world, from, target, umt, false).WithCustomBlocker(AvoidUnitsNear(from, 4)));
|
||||
@@ -61,7 +63,7 @@ namespace OpenRA
|
||||
|
||||
public List<int2> FindUnitPathToRange( int2 src, int2 target, UnitMovementType umt, int range )
|
||||
{
|
||||
using( new PerfSample( "find_unit_path_multiple_src" ) )
|
||||
//using( new PerfSample( "find_unit_path_multiple_src" ) )
|
||||
{
|
||||
var tilesInRange = world.FindTilesInCircle(target, range)
|
||||
.Where( t => world.IsPathableCell( t, umt ) );
|
||||
@@ -82,7 +84,7 @@ namespace OpenRA
|
||||
|
||||
public List<int2> FindPath( PathSearch search )
|
||||
{
|
||||
using (new PerfSample("find_path_inner"))
|
||||
//using (new PerfSample("find_path_inner"))
|
||||
{
|
||||
while (!search.queue.Empty)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ using OpenRA.FileFormats;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Support;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
@@ -111,6 +112,8 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
public void Explore(World w, int2 center, int range)
|
||||
{
|
||||
using (new PerfSample("explore"))
|
||||
{
|
||||
if (range == 0)
|
||||
return;
|
||||
@@ -126,6 +129,7 @@ namespace OpenRA
|
||||
}
|
||||
dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Explore(Actor a)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,11 @@ namespace OpenRA.Support
|
||||
{
|
||||
static class PerfHistory
|
||||
{
|
||||
static readonly Color[] colors = { Color.Red, Color.Green, Color.Blue, Color.Yellow, Color.Orange, Color.Fuchsia, Color.Lime, Color.LightBlue, Color.White, Color.Black };
|
||||
static readonly Color[] colors = { Color.Red, Color.Green,
|
||||
Color.Blue, Color.Yellow,
|
||||
Color.Orange, Color.Fuchsia,
|
||||
Color.Lime, Color.LightBlue,
|
||||
Color.White, Color.Teal };
|
||||
static int nextColor;
|
||||
|
||||
public static Cache<string, PerfItem> items = new Cache<string, PerfItem>(
|
||||
|
||||
@@ -64,7 +64,8 @@ namespace OpenRA.Traits.Activities
|
||||
this.getPath = (self, mobile) =>
|
||||
self.World.PathFinder.FindPath(
|
||||
PathSearch.FromPoint( self.World, self.Location, destination, mobile.GetMovementType(), false )
|
||||
.WithCustomBlocker( self.World.PathFinder.AvoidUnitsNear( self.Location, 4 )).WithIgnoredBuilding( ignoreBuilding ));
|
||||
.WithCustomBlocker( self.World.PathFinder.AvoidUnitsNear( self.Location, 4 ))
|
||||
.WithIgnoredBuilding( ignoreBuilding ));
|
||||
|
||||
this.destination = destination;
|
||||
this.nearEnough = 0;
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace OpenRA
|
||||
|
||||
public int SyncHash()
|
||||
{
|
||||
using (new PerfSample("synchash"))
|
||||
//using (new PerfSample("synchash"))
|
||||
{
|
||||
int ret = 0;
|
||||
foreach (var a in Actors)
|
||||
|
||||
Reference in New Issue
Block a user