Hidden debug parameter for perf tick logging

This commit is contained in:
Paul Chote
2010-09-17 22:28:57 +12:00
committed by Chris Forbes
parent 22861fca5a
commit 0d2e1d7de5
3 changed files with 4 additions and 3 deletions

View File

@@ -79,7 +79,7 @@ namespace OpenRA
var sw = new Stopwatch(); var sw = new Stopwatch();
currentActivity = a.Tick(this) ?? new Idle(); currentActivity = a.Tick(this) ?? new Idle();
var dt = sw.ElapsedTime(); var dt = sw.ElapsedTime();
if( dt > 0.001 ) if(dt > Game.Settings.Debug.LongTickThreshold)
Log.Write("perf", "[{2}] Activity: {0} ({1:0.000} ms)", a, dt * 1000, Game.LocalTick); Log.Write("perf", "[{2}] Activity: {0} ({1:0.000} ms)", a, dt * 1000, Game.LocalTick);
if (a == currentActivity) break; if (a == currentActivity) break;

View File

@@ -33,6 +33,7 @@ namespace OpenRA.GameRules
public bool PerfGraph = false; public bool PerfGraph = false;
public bool RecordSyncReports = true; public bool RecordSyncReports = true;
public bool ShowCollisions = false; public bool ShowCollisions = false;
public float LongTickThreshold = 0.001f;
} }
public class GraphicSettings public class GraphicSettings

View File

@@ -150,9 +150,9 @@ namespace OpenRA
Queries.WithTraitMultiple<ITick>().DoTimed( x => Queries.WithTraitMultiple<ITick>().DoTimed( x =>
{ {
x.Trait.Tick( x.Actor ); x.Trait.Tick( x.Actor );
}, "[{2}] Trait: {0} ({1:0.000} ms)", 0.001 ); }, "[{2}] Trait: {0} ({1:0.000} ms)", Game.Settings.Debug.LongTickThreshold );
effects.DoTimed( e => e.Tick( this ), "[{2}] Effect: {0} ({1:0.000} ms)", 0.001 ); effects.DoTimed( e => e.Tick( this ), "[{2}] Effect: {0} ({1:0.000} ms)", Game.Settings.Debug.LongTickThreshold );
Game.viewport.Tick(); Game.viewport.Tick();
while (frameEndActions.Count != 0) while (frameEndActions.Count != 0)
frameEndActions.Dequeue()(this); frameEndActions.Dequeue()(this);