removing a no-time-at-all timer; logging long-running trait Tick()
This commit is contained in:
@@ -139,18 +139,20 @@ namespace OpenRA.Graphics
|
|||||||
lastConnectionState = state;
|
lastConnectionState = state;
|
||||||
|
|
||||||
}
|
}
|
||||||
Timer.Time( "checking connections: {0}" );
|
|
||||||
|
|
||||||
Game.chrome.DrawWidgets(world);
|
Game.chrome.DrawWidgets(world);
|
||||||
Timer.Time( "widgets: {0}" );
|
Timer.Time( "widgets: {0}" );
|
||||||
|
|
||||||
var cursorName = Game.chrome.HitTest(mousePos) ? "default" : Game.controller.ChooseCursor( world );
|
var cursorName = Game.chrome.HitTest(mousePos) ? "default" : Game.controller.ChooseCursor( world );
|
||||||
var c = new Cursor(cursorName);
|
var c = new Cursor(cursorName);
|
||||||
cursorRenderer.DrawSprite(c.GetSprite((int)cursorFrame), mousePos + Location - c.GetHotspot(), "cursor");
|
cursorRenderer.DrawSprite(c.GetSprite((int)cursorFrame), mousePos + Location - c.GetHotspot(), "cursor");
|
||||||
cursorRenderer.Flush();
|
|
||||||
Timer.Time( "cursors: {0}" );
|
Timer.Time( "cursors: {0}" );
|
||||||
|
|
||||||
|
renderer.RgbaSpriteRenderer.Flush();
|
||||||
|
renderer.SpriteRenderer.Flush();
|
||||||
|
renderer.WorldSpriteRenderer.Flush();
|
||||||
|
|
||||||
renderer.EndFrame();
|
renderer.EndFrame();
|
||||||
|
Timer.Time( "endFrame: {0}" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick()
|
public void Tick()
|
||||||
|
|||||||
@@ -144,8 +144,18 @@ namespace OpenRA
|
|||||||
|
|
||||||
public void Tick()
|
public void Tick()
|
||||||
{
|
{
|
||||||
|
var sw = new Stopwatch();
|
||||||
|
|
||||||
foreach (var a in actors) a.Tick();
|
foreach (var a in actors) a.Tick();
|
||||||
Queries.WithTraitMultiple<ITick>().Do( x => x.Trait.Tick( x.Actor ) );
|
|
||||||
|
Queries.WithTraitMultiple<ITick>().Do( x =>
|
||||||
|
{
|
||||||
|
var t = sw.ElapsedTime();
|
||||||
|
x.Trait.Tick( x.Actor );
|
||||||
|
var dt = sw.ElapsedTime() - t;
|
||||||
|
if( dt > 0.001 )
|
||||||
|
Log.Write( "expensive tick: {0}->{1}", x.Actor.Info.Name, x.Trait.GetType() );
|
||||||
|
} );
|
||||||
|
|
||||||
foreach (var e in effects) e.Tick( this );
|
foreach (var e in effects) e.Tick( this );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user