Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

0.7.4.1
Justin Clark-Casey (justincc) 2012-05-10 23:43:38 +01:00
commit abc029d1f4
3 changed files with 34 additions and 7 deletions

View File

@ -722,6 +722,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
} }
if (shouldTaint) if (shouldTaint)
{ {
m_scene.EventManager.TriggerTerrainTainted();
m_tainted = true; m_tainted = true;
} }
} }

View File

@ -53,6 +53,10 @@ namespace OpenSim.Region.Framework.Scenes
public event ClientMovement OnClientMovement; public event ClientMovement OnClientMovement;
public delegate void OnTerrainTaintedDelegate();
public event OnTerrainTaintedDelegate OnTerrainTainted;
public delegate void OnTerrainTickDelegate(); public delegate void OnTerrainTickDelegate();
public event OnTerrainTickDelegate OnTerrainTick; public event OnTerrainTickDelegate OnTerrainTick;
@ -914,6 +918,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerTerrainTainted()
{
OnTerrainTaintedDelegate handlerTerrainTainted = OnTerrainTainted;
if (handlerTerrainTainted != null)
{
foreach (OnTerrainTickDelegate d in handlerTerrainTainted.GetInvocationList())
{
try
{
d();
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerTerrainTainted failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
{ {
OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd; OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd;

View File

@ -1353,6 +1353,14 @@ namespace OpenSim.Region.Framework.Scenes
try try
{ {
// Apply taints in terrain module to terrain in physics scene
if (Frame % m_update_terrain == 0)
{
terMS = Util.EnvironmentTickCount();
UpdateTerrain();
terrainMS = Util.EnvironmentTickCountSubtract(terMS);
}
tmpPhysicsMS2 = Util.EnvironmentTickCount(); tmpPhysicsMS2 = Util.EnvironmentTickCount();
if ((Frame % m_update_physics == 0) && m_physics_enabled) if ((Frame % m_update_physics == 0) && m_physics_enabled)
m_sceneGraph.UpdatePreparePhysics(); m_sceneGraph.UpdatePreparePhysics();
@ -1417,13 +1425,6 @@ namespace OpenSim.Region.Framework.Scenes
backupMS = Util.EnvironmentTickCountSubtract(backMS); backupMS = Util.EnvironmentTickCountSubtract(backMS);
} }
if (Frame % m_update_terrain == 0)
{
terMS = Util.EnvironmentTickCount();
UpdateTerrain();
terrainMS = Util.EnvironmentTickCountSubtract(terMS);
}
//if (Frame % m_update_land == 0) //if (Frame % m_update_land == 0)
//{ //{
// int ldMS = Util.EnvironmentTickCount(); // int ldMS = Util.EnvironmentTickCount();