aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-16 13:17:31 +0000
committerJustin Clarke Casey2008-10-16 13:17:31 +0000
commit67892343350a8af916ec4c16d341ad843550d54e (patch)
treec3dca2238934cda8f890942568c5882a04a06258 /OpenSim/Region
parent* Releases the inter-region thread synchronization between physics in ODE on ... (diff)
downloadopensim-SC_OLD-67892343350a8af916ec4c16d341ad843550d54e.zip
opensim-SC_OLD-67892343350a8af916ec4c16d341ad843550d54e.tar.gz
opensim-SC_OLD-67892343350a8af916ec4c16d341ad843550d54e.tar.bz2
opensim-SC_OLD-67892343350a8af916ec4c16d341ad843550d54e.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2405
* Implement llGetRegionFPS() * Thanks idb
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
3 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e95b1d7..299d0da 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -196,6 +196,14 @@ namespace OpenSim.Region.Environment.Scenes
196 get { return m_timedilation; } 196 get { return m_timedilation; }
197 } 197 }
198 198
199 /// <summary>
200 /// This is for llGetRegionFPS
201 /// </summary>
202 public float SimulatorFPS
203 {
204 get { return m_statsReporter.getLastReportedSimFPS(); }
205 }
206
199 public int TimePhase 207 public int TimePhase
200 { 208 {
201 get { return m_timePhase; } 209 get { return m_timePhase; }
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index 4c9c59d..70287fc 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -73,6 +73,8 @@ namespace OpenSim.Region.Environment.Scenes
73 private float statsUpdateFactor = 0; 73 private float statsUpdateFactor = 0;
74 private float m_timeDilation = 0; 74 private float m_timeDilation = 0;
75 private int m_fps = 0; 75 private int m_fps = 0;
76 // saved last reported value so there is something available for llGetRegionFPS
77 private float lastReportedSimFPS = 0;
76 private float m_pfps = 0; 78 private float m_pfps = 0;
77 private int m_agentUpdates = 0; 79 private int m_agentUpdates = 0;
78 80
@@ -155,6 +157,8 @@ namespace OpenSim.Region.Environment.Scenes
155 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there 157 // Our FPS is actually 10fps, so multiplying by 5 to get the amount that people expect there
156 // 0-50 is pretty close to 0-45 158 // 0-50 is pretty close to 0-45
157 float simfps = (int) ((m_fps * 5)); 159 float simfps = (int) ((m_fps * 5));
160 // save the reported value so there is something available for llGetRegionFPS
161 lastReportedSimFPS = (float)simfps / statsUpdateFactor;
158 162
159 //if (simfps > 45) 163 //if (simfps > 45)
160 //simfps = simfps - (simfps - 45); 164 //simfps = simfps - (simfps - 45);
@@ -397,6 +401,14 @@ namespace OpenSim.Region.Environment.Scenes
397 objectCapacity = objects; 401 objectCapacity = objects;
398 } 402 }
399 403
404 /// <summary>
405 /// This is for llGetRegionFPS
406 /// </summary>
407 public float getLastReportedSimFPS()
408 {
409 return lastReportedSimFPS;
410 }
411
400 #endregion 412 #endregion
401 } 413 }
402} 414}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 7d3badb..9df318c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4842,11 +4842,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4842 return (double)World.TimeDilation; 4842 return (double)World.TimeDilation;
4843 } 4843 }
4844 4844
4845 /// <summary>
4846 /// Returns the value reported in the client Statistics window
4847 /// </summary>
4845 public LSL_Float llGetRegionFPS() 4848 public LSL_Float llGetRegionFPS()
4846 { 4849 {
4847 m_host.AddScriptLPS(1); 4850 m_host.AddScriptLPS(1);
4848 //TODO: return actual FPS 4851 return World.SimulatorFPS;
4849 return 10.0f;
4850 } 4852 }
4851 4853
4852 /* particle system rules should be coming into this routine as doubles, that is 4854 /* particle system rules should be coming into this routine as doubles, that is