aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorAdam Frisby2007-07-24 05:22:33 +0000
committerAdam Frisby2007-07-24 05:22:33 +0000
commitd8997b59d30b63218f594d840d924a10287ce509 (patch)
treef96960b2605c8da0d6b0a0d9a905db28a62fca67 /OpenSim/Region/Environment/Scenes/Scene.cs
parent* Terrain Fracture Generator now produces more appropriate results. (diff)
downloadopensim-SC-d8997b59d30b63218f594d840d924a10287ce509.zip
opensim-SC-d8997b59d30b63218f594d840d924a10287ce509.tar.gz
opensim-SC-d8997b59d30b63218f594d840d924a10287ce509.tar.bz2
opensim-SC-d8997b59d30b63218f594d840d924a10287ce509.tar.xz
* Terrain should now send just updated patches.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs45
1 files changed, 31 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 16b8b4c..564ba5f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -235,25 +235,40 @@ namespace OpenSim.Region.Environment.Scenes
235 storageCount = 0; 235 storageCount = 0;
236 } 236 }
237 237
238 if (Terrain.tainted > 0) 238 if (Terrain.Tainted())
239 { 239 {
240 lock (m_syncRoot) 240 lock (Terrain.heightmap)
241 { 241 {
242 phyScene.SetTerrain(Terrain.GetHeights1D()); 242 lock (m_syncRoot)
243 } 243 {
244 phyScene.SetTerrain(Terrain.GetHeights1D());
245 }
244 246
245 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD()); 247 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD());
246 248
247 ForEachScenePresence(delegate(ScenePresence presence) 249 float[] terData = Terrain.GetHeights1D();
248 { 250
249 SendLayerData(presence.ControllingClient); 251 ForEachScenePresence(delegate(ScenePresence presence)
250 }); 252 {
253 for (int x = 0; x < 16; x++)
254 {
255 for (int y = 0; y < 16; y++)
256 {
257 if (Terrain.Tainted(x, y))
258 {
259 SendLayerData(x, y, presence.ControllingClient, terData);
260 }
261 }
262 }
263 });
264
265 foreach (LLUUID UUID in Entities.Keys)
266 {
267 Entities[UUID].LandRenegerated();
268 }
251 269
252 foreach (LLUUID UUID in Entities.Keys) 270 Terrain.ResetTaint();
253 {
254 Entities[UUID].LandRenegerated();
255 } 271 }
256 Terrain.tainted = 0;
257 } 272 }
258 273
259 landPrimCheckCount++; 274 landPrimCheckCount++;
@@ -365,9 +380,11 @@ namespace OpenSim.Region.Environment.Scenes
365 { 380 {
366 /* Dont save here, rely on tainting system instead */ 381 /* Dont save here, rely on tainting system instead */
367 382
383 float[] terrain = Terrain.GetHeights1D();
384
368 ForEachScenePresence(delegate(ScenePresence presence) 385 ForEachScenePresence(delegate(ScenePresence presence)
369 { 386 {
370 SendLayerData(pointx, pointy, presence.ControllingClient); 387 SendLayerData(pointx, pointy, presence.ControllingClient, terrain);
371 }); 388 });
372 } 389 }
373 } 390 }