aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.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/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.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/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
index 0d6d0fc..5715c70 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Common.cs
@@ -51,8 +51,31 @@ namespace libTerrain
51 return x; 51 return x;
52 } 52 }
53 53
54 public void SetDiff()
55 {
56 SetDiff(1);
57 }
58
59 public void SetDiff(int val)
60 {
61 for (int x = 0; x < w / 16; x++)
62 {
63 for (int y = 0; y < h / 16; y++)
64 {
65 diff[x, y] = val;
66 }
67 }
68 }
69
70 public void SetDiff(int x, int y)
71 {
72 diff[x / 16, y / 16]++;
73 }
74
54 public void Set(int x, int y, double val) 75 public void Set(int x, int y, double val)
55 { 76 {
77 SetDiff(x, y);
78
56 if (x >= w) 79 if (x >= w)
57 throw new Exception("Bounds error while setting pixel (width)"); 80 throw new Exception("Bounds error while setting pixel (width)");
58 if (y >= h) 81 if (y >= h)
@@ -67,6 +90,8 @@ namespace libTerrain
67 90
68 public void SetClip(int x, int y, double val) 91 public void SetClip(int x, int y, double val)
69 { 92 {
93 SetDiff(x, y);
94
70 if (x >= w) 95 if (x >= w)
71 throw new Exception("Bounds error while setting pixel (width)"); 96 throw new Exception("Bounds error while setting pixel (width)");
72 if (y >= h) 97 if (y >= h)
@@ -129,11 +154,15 @@ namespace libTerrain
129 154
130 public void SetWrap(int x, int y, double val) 155 public void SetWrap(int x, int y, double val)
131 { 156 {
157 SetDiff(x, y);
158
132 map[x % w, y % h] = val; 159 map[x % w, y % h] = val;
133 } 160 }
134 161
135 public void SetWrapClip(int x, int y, double val) 162 public void SetWrapClip(int x, int y, double val)
136 { 163 {
164 SetDiff(x, y);
165
137 if (val > 1.0) 166 if (val > 1.0)
138 val = 1.0; 167 val = 1.0;
139 if (val < 0.0) 168 if (val < 0.0)
@@ -144,6 +173,8 @@ namespace libTerrain
144 173
145 public void Fill(double val) 174 public void Fill(double val)
146 { 175 {
176 SetDiff();
177
147 int x, y; 178 int x, y;
148 for (x = 0; x < w; x++) 179 for (x = 0; x < w; x++)
149 { 180 {
@@ -156,6 +187,8 @@ namespace libTerrain
156 187
157 public void Fill(double min, double max, double val) 188 public void Fill(double min, double max, double val)
158 { 189 {
190 SetDiff();
191
159 int x, y; 192 int x, y;
160 for (x = 0; x < w; x++) 193 for (x = 0; x < w; x++)
161 { 194 {