aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
diff options
context:
space:
mode:
authorBrian McBee2008-02-05 18:27:40 +0000
committerBrian McBee2008-02-05 18:27:40 +0000
commit7a61bcff8698b2b1698fa47a9793108baefe2783 (patch)
tree90801af50d435f40f810499386cd57bc3cbe4645 /OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
parentAdded explicit Quaternion->string and list->string conversions. (diff)
downloadopensim-SC-7a61bcff8698b2b1698fa47a9793108baefe2783.zip
opensim-SC-7a61bcff8698b2b1698fa47a9793108baefe2783.tar.gz
opensim-SC-7a61bcff8698b2b1698fa47a9793108baefe2783.tar.bz2
opensim-SC-7a61bcff8698b2b1698fa47a9793108baefe2783.tar.xz
Cut down on the number of packets sent during terraforming. Terraforming should be much more responsive.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs22
1 files changed, 15 insertions, 7 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
index 280ca0d..f722f12 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -89,6 +89,8 @@ namespace OpenSim.Region.Terrain
89 public DateTime lastEdit = DateTime.Now; 89 public DateTime lastEdit = DateTime.Now;
90 90
91 91
92 private int counter = 0;
93
92 /// <summary> 94 /// <summary>
93 /// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine. 95 /// Whether or not the terrain has been modified since it was last saved and sent to the Physics engine.
94 /// Counts the number of modifications since the last save. (0 = Untainted) 96 /// Counts the number of modifications since the last save. (0 = Untainted)
@@ -206,7 +208,7 @@ namespace OpenSim.Region.Terrain
206 { 208 {
207 FlattenTerrain(y, x, size, (double) seconds/5.0); 209 FlattenTerrain(y, x, size, (double) seconds/5.0);
208 lastEdit = DateTime.Now; 210 lastEdit = DateTime.Now;
209 remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D()); 211 //remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
210 212
211 } 213 }
212 } 214 }
@@ -219,7 +221,7 @@ namespace OpenSim.Region.Terrain
219 { 221 {
220 RaiseTerrain(y, x, size, (double) seconds/5.0); 222 RaiseTerrain(y, x, size, (double) seconds/5.0);
221 lastEdit = DateTime.Now; 223 lastEdit = DateTime.Now;
222 remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D()); 224 //remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
223 } 225 }
224 } 226 }
225 break; 227 break;
@@ -231,7 +233,7 @@ namespace OpenSim.Region.Terrain
231 { 233 {
232 LowerTerrain(y, x, size, (double) seconds/5.0); 234 LowerTerrain(y, x, size, (double) seconds/5.0);
233 lastEdit = DateTime.Now; 235 lastEdit = DateTime.Now;
234 remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D()); 236 //remoteUser.SendLayerData((int)(x / 16), (int)(x / 16), GetHeights1D());
235 } 237 }
236 } 238 }
237 break; 239 break;
@@ -288,17 +290,23 @@ namespace OpenSim.Region.Terrain
288 break; 290 break;
289 } 291 }
290 292
291 for (int x = 0; x < 16; x++) 293 counter++;
294 if(counter==3)
292 { 295 {
293 for (int y = 0; y < 16; y++) 296 counter=0;
297 for (int x = 0; x < 16; x++)
294 { 298 {
295 if (IsTainted(x*16, y*16)) 299 for (int y = 0; y < 16; y++)
296 { 300 {
297 remoteUser.SendLayerData(x, y, GetHeights1D()); 301 if (IsTainted(x*16, y*16))
302 {
303 remoteUser.SendLayerData(x, y, GetHeights1D());
304 }
298 } 305 }
299 } 306 }
300 } 307 }
301 308
309
302 lastEdit = DateTime.Now; 310 lastEdit = DateTime.Now;
303 311
304 return; 312 return;