diff options
author | Adam Frisby | 2007-07-24 05:22:33 +0000 |
---|---|---|
committer | Adam Frisby | 2007-07-24 05:22:33 +0000 |
commit | d8997b59d30b63218f594d840d924a10287ce509 (patch) | |
tree | f96960b2605c8da0d6b0a0d9a905db28a62fca67 /OpenSim/Region/Environment/Scenes | |
parent | * Terrain Fracture Generator now produces more appropriate results. (diff) | |
download | opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.zip opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.tar.gz opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.tar.bz2 opensim-SC_OLD-d8997b59d30b63218f594d840d924a10287ce509.tar.xz |
* Terrain should now send just updated patches.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneBase.cs | 4 |
2 files changed, 33 insertions, 16 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 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index fb7624a..76a8439 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -90,9 +90,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
90 | /// <param name="px">Patch coordinate (x) 0..16</param> | 90 | /// <param name="px">Patch coordinate (x) 0..16</param> |
91 | /// <param name="py">Patch coordinate (y) 0..16</param> | 91 | /// <param name="py">Patch coordinate (y) 0..16</param> |
92 | /// <param name="RemoteClient">The client to send to</param> | 92 | /// <param name="RemoteClient">The client to send to</param> |
93 | public virtual void SendLayerData(int px, int py, IClientAPI RemoteClient) | 93 | public virtual void SendLayerData(int px, int py, IClientAPI RemoteClient, float[] terrain) |
94 | { | 94 | { |
95 | RemoteClient.SendLayerData(px, py, Terrain.GetHeights1D()); | 95 | RemoteClient.SendLayerData(px, py, terrain); |
96 | } | 96 | } |
97 | 97 | ||
98 | #endregion | 98 | #endregion |