diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 25 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 15 |
2 files changed, 33 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index ace8313..f97b0a9 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -53,6 +53,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
53 | 53 | ||
54 | public event ClientMovement OnClientMovement; | 54 | public event ClientMovement OnClientMovement; |
55 | 55 | ||
56 | public delegate void OnTerrainTaintedDelegate(); | ||
57 | |||
58 | public event OnTerrainTaintedDelegate OnTerrainTainted; | ||
59 | |||
56 | public delegate void OnTerrainTickDelegate(); | 60 | public delegate void OnTerrainTickDelegate(); |
57 | 61 | ||
58 | public event OnTerrainTickDelegate OnTerrainTick; | 62 | public event OnTerrainTickDelegate OnTerrainTick; |
@@ -914,6 +918,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
914 | } | 918 | } |
915 | } | 919 | } |
916 | 920 | ||
921 | public void TriggerTerrainTainted() | ||
922 | { | ||
923 | OnTerrainTaintedDelegate handlerTerrainTainted = OnTerrainTainted; | ||
924 | if (handlerTerrainTainted != null) | ||
925 | { | ||
926 | foreach (OnTerrainTickDelegate d in handlerTerrainTainted.GetInvocationList()) | ||
927 | { | ||
928 | try | ||
929 | { | ||
930 | d(); | ||
931 | } | ||
932 | catch (Exception e) | ||
933 | { | ||
934 | m_log.ErrorFormat( | ||
935 | "[EVENT MANAGER]: Delegate for TriggerTerrainTainted failed - continuing. {0} {1}", | ||
936 | e.Message, e.StackTrace); | ||
937 | } | ||
938 | } | ||
939 | } | ||
940 | } | ||
941 | |||
917 | public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) | 942 | public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) |
918 | { | 943 | { |
919 | OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd; | 944 | OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4d0aa6f..3d2213a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1353,6 +1353,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1353 | 1353 | ||
1354 | try | 1354 | try |
1355 | { | 1355 | { |
1356 | // Apply taints in terrain module to terrain in physics scene | ||
1357 | if (Frame % m_update_terrain == 0) | ||
1358 | { | ||
1359 | terMS = Util.EnvironmentTickCount(); | ||
1360 | UpdateTerrain(); | ||
1361 | terrainMS = Util.EnvironmentTickCountSubtract(terMS); | ||
1362 | } | ||
1363 | |||
1356 | tmpPhysicsMS2 = Util.EnvironmentTickCount(); | 1364 | tmpPhysicsMS2 = Util.EnvironmentTickCount(); |
1357 | if ((Frame % m_update_physics == 0) && m_physics_enabled) | 1365 | if ((Frame % m_update_physics == 0) && m_physics_enabled) |
1358 | m_sceneGraph.UpdatePreparePhysics(); | 1366 | m_sceneGraph.UpdatePreparePhysics(); |
@@ -1417,13 +1425,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1417 | backupMS = Util.EnvironmentTickCountSubtract(backMS); | 1425 | backupMS = Util.EnvironmentTickCountSubtract(backMS); |
1418 | } | 1426 | } |
1419 | 1427 | ||
1420 | if (Frame % m_update_terrain == 0) | ||
1421 | { | ||
1422 | terMS = Util.EnvironmentTickCount(); | ||
1423 | UpdateTerrain(); | ||
1424 | terrainMS = Util.EnvironmentTickCountSubtract(terMS); | ||
1425 | } | ||
1426 | |||
1427 | //if (Frame % m_update_land == 0) | 1428 | //if (Frame % m_update_land == 0) |
1428 | //{ | 1429 | //{ |
1429 | // int ldMS = Util.EnvironmentTickCount(); | 1430 | // int ldMS = Util.EnvironmentTickCount(); |