From 0f3b9ef3dc1ce1e59a2b377f9c6372c9f54b7f7e Mon Sep 17 00:00:00 2001 From: Jon Cundill Date: Sat, 9 Jul 2011 13:38:04 +0100 Subject: [PATCH] added cmd to slowdown framerate - good for debugging --- Flocking/FlockingModule.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Flocking/FlockingModule.cs b/Flocking/FlockingModule.cs index e1f67f9..f7e42ec 100644 --- a/Flocking/FlockingModule.cs +++ b/Flocking/FlockingModule.cs @@ -171,6 +171,8 @@ namespace Flocking HandleShowStatsCmd ("flock", args); } else if (cmd.StartsWith ("prim")) { 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 ("stats", "", "show flocking stats", HandleShowStatsCmd); AddCommand ("prim", "name", "set the prim used for each boid to that passed in", HandleSetPrimCmd); + AddCommand ("framerate", "num", "[debugging] only update boids every frames", HandleSetFrameRateCmd); } 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) { if (ShouldHandleCmd ()) {