added cmd to slowdown framerate - good for debugging

stable0711
Jon Cundill 2011-07-09 13:38:04 +01:00
parent f0176ce13f
commit 0f3b9ef3dc
1 changed files with 11 additions and 0 deletions

View File

@ -171,6 +171,8 @@ namespace Flocking
HandleShowStatsCmd ("flock", args); HandleShowStatsCmd ("flock", args);
} else if (cmd.StartsWith ("prim")) { } else if (cmd.StartsWith ("prim")) {
HandleSetPrimCmd ("flock", args); HandleSetPrimCmd ("flock", args);
} else if (cmd.StartsWith ("framerate")) {
HandleSetFrameRateCmd ("flock", args);
} }
} }
@ -195,6 +197,7 @@ namespace Flocking
AddCommand ("size", "num", "Adjust the size of the flock ", HandleSetSizeCmd); AddCommand ("size", "num", "Adjust the size of the flock ", HandleSetSizeCmd);
AddCommand ("stats", "", "show flocking stats", HandleShowStatsCmd); AddCommand ("stats", "", "show flocking stats", HandleShowStatsCmd);
AddCommand ("prim", "name", "set the prim used for each boid to that passed in", HandleSetPrimCmd); AddCommand ("prim", "name", "set the prim used for each boid to that passed in", HandleSetPrimCmd);
AddCommand ("framerate", "num", "[debugging] only update boids every <num> frames", HandleSetFrameRateCmd);
} }
private bool ShouldHandleCmd () private bool ShouldHandleCmd ()
@ -233,6 +236,14 @@ namespace Flocking
} }
} }
void HandleSetFrameRateCmd (string module, string[] args)
{
if (ShouldHandleCmd ()) {
int frameRate = Convert.ToInt32( args[1] );
m_frameUpdateRate = frameRate;
}
}
public void HandleStartCmd (string module, string[] args) public void HandleStartCmd (string module, string[] args)
{ {
if (ShouldHandleCmd ()) { if (ShouldHandleCmd ()) {