aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-20 23:12:21 +0000
committerJustin Clark-Casey (justincc)2012-03-20 23:12:21 +0000
commit30b2a8c778d02926e038bc62977c4a4c9dbec5ee (patch)
tree0b35af969e4ac337cf4521d07b1f25765a5b3273 /OpenSim/Framework
parentreduce avatar verticle jump from the absurd 5 meter jump to a less (diff)
downloadopensim-SC_OLD-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.zip
opensim-SC_OLD-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.tar.gz
opensim-SC_OLD-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.tar.bz2
opensim-SC_OLD-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.tar.xz
Move frame loop entirely within Scene.Update() for better future performance analysis and stat accuracy.
Update() now accepts a frames parameter which can control the number of frames updated. -1 will update until shutdown. The watchdog updating moves above the maintc recalculation for any required sleep since it should be accounted for within the frame.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Util.cs17
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 9e0f138..b2e5c7b 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1758,13 +1758,26 @@ namespace OpenSim.Framework
1758 /// and negative every 24.9 days. Subtracts the passed value (previously fetched by 1758 /// and negative every 24.9 days. Subtracts the passed value (previously fetched by
1759 /// 'EnvironmentTickCount()') and accounts for any wrapping. 1759 /// 'EnvironmentTickCount()') and accounts for any wrapping.
1760 /// </summary> 1760 /// </summary>
1761 /// <param name="newValue"></param>
1762 /// <param name="prevValue"></param>
1761 /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> 1763 /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
1762 public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) 1764 public static Int32 EnvironmentTickCountSubtract(Int32 newValue, Int32 prevValue)
1763 { 1765 {
1764 Int32 diff = EnvironmentTickCount() - prevValue; 1766 Int32 diff = newValue - prevValue;
1765 return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); 1767 return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1);
1766 } 1768 }
1767 1769
1770 /// <summary>
1771 /// Environment.TickCount is an int but it counts all 32 bits so it goes positive
1772 /// and negative every 24.9 days. Subtracts the passed value (previously fetched by
1773 /// 'EnvironmentTickCount()') and accounts for any wrapping.
1774 /// </summary>
1775 /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
1776 public static Int32 EnvironmentTickCountSubtract(Int32 prevValue)
1777 {
1778 return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue);
1779 }
1780
1768 // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount 1781 // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount
1769 // Assumes both tcA and tcB came from previous calls to Util.EnvironmentTickCount(). 1782 // Assumes both tcA and tcB came from previous calls to Util.EnvironmentTickCount().
1770 // A positive return value indicates A occured later than B 1783 // A positive return value indicates A occured later than B