aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World
diff options
context:
space:
mode:
authorJeff Ames2008-08-28 14:41:54 +0000
committerJeff Ames2008-08-28 14:41:54 +0000
commit3bf88587277b83c0b6f058fabba7d46a3b5a6a00 (patch)
treeed4ad9dc27e649a6f52661665fb681984251f480 /OpenSim/Region/Environment/Modules/World
parentThannk you, Ralphos, for a patch the corrects an improper cast in (diff)
downloadopensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.zip
opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.gz
opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.bz2
opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.xz
Update svn properties, formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs32
6 files changed, 26 insertions, 30 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
index 5e22e57..0b68c5f 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
59 /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. 59 /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out.
60 /// </summary> 60 /// </summary>
61 public static readonly string TERRAINS_PATH = "terrains/"; 61 public static readonly string TERRAINS_PATH = "terrains/";
62 62
63 /// <summary> 63 /// <summary>
64 /// The character the separates the uuid from extension information in an archived asset filename 64 /// The character the separates the uuid from extension information in an archived asset filename
65 /// </summary> 65 /// </summary>
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 201986e..89f5fd7 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -212,16 +212,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
212 // Right now we're nastily obtaining the lluuid from the filename 212 // Right now we're nastily obtaining the lluuid from the filename
213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); 213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
214 int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); 214 int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR);
215 215
216 if (i == -1) 216 if (i == -1)
217 { 217 {
218 m_log.ErrorFormat( 218 m_log.ErrorFormat(
219 "[ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping", 219 "[ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping",
220 assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR); 220 assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR);
221 221
222 return false; 222 return false;
223 } 223 }
224 224
225 string extension = filename.Substring(i); 225 string extension = filename.Substring(i);
226 string uuid = filename.Remove(filename.Length - extension.Length); 226 string uuid = filename.Remove(filename.Length - extension.Length);
227 227
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 2d27b11..c1f5566 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -315,13 +315,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
315 public event RegionHandleRequest OnRegionHandleRequest; 315 public event RegionHandleRequest OnRegionHandleRequest;
316 public event ParcelInfoRequest OnParcelInfoRequest; 316 public event ParcelInfoRequest OnParcelInfoRequest;
317 317
318 public event ActivateGesture OnActivateGesture; 318 public event ActivateGesture OnActivateGesture;
319 public event DeactivateGesture OnDeactivateGesture; 319 public event DeactivateGesture OnDeactivateGesture;
320 320
321#pragma warning restore 67 321#pragma warning restore 67
322 322
323 #endregion 323 #endregion
324 324
325 public void ActivateGesture(LLUUID assetId, LLUUID gestureId) 325 public void ActivateGesture(LLUUID assetId, LLUUID gestureId)
326 { 326 {
327 } 327 }
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
index 2ae4174..bfb5016 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
103 103
104 Bitmap mapbmp = new Bitmap(256, 256); 104 Bitmap mapbmp = new Bitmap(256, 256);
105 //long t = System.Environment.TickCount; 105 //long t = System.Environment.TickCount;
106 //for(int i = 0; i < 10; ++i) { 106 //for (int i = 0; i < 10; ++i) {
107 terrainRenderer.TerrainToBitmap(mapbmp); 107 terrainRenderer.TerrainToBitmap(mapbmp);
108 //} 108 //}
109 //t = System.Environment.TickCount - t; 109 //t = System.Environment.TickCount - t;
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs
index 253a7f5..1ee86ba 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs
@@ -97,8 +97,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
97 // No, that doesn't scale it: 97 // No, that doesn't scale it:
98 // heightvalue = low + mid * (heightvalue - low) / mid; => low + (heightvalue - low) * mid / mid = low + (heightvalue - low) * 1 = low + heightvalue - low = heightvalue 98 // heightvalue = low + mid * (heightvalue - low) / mid; => low + (heightvalue - low) * mid / mid = low + (heightvalue - low) * 1 = low + heightvalue - low = heightvalue
99 99
100
101
102 if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) 100 if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
103 heightvalue = 0; 101 heightvalue = 0;
104 else if (heightvalue > 255f) 102 else if (heightvalue > 255f)
@@ -136,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
136 int hfdiffi = 0; 134 int hfdiffi = 0;
137 int hfdiffihighlight = 0; 135 int hfdiffihighlight = 0;
138 float highlightfactor = 0.18f; 136 float highlightfactor = 0.18f;
139 137
140 try 138 try
141 { 139 {
142 // hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1; 140 // hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1;
@@ -146,7 +144,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
146 // hfdiffi = hfdiffi + Math.Abs((int)(((hfdiff % 1) * 0.5f) * 10f) - 1); 144 // hfdiffi = hfdiffi + Math.Abs((int)(((hfdiff % 1) * 0.5f) * 10f) - 1);
147 hfdiffi = hfdiffi + Math.Abs((int)((hfdiff % 1f) * 5f) - 1); 145 hfdiffi = hfdiffi + Math.Abs((int)((hfdiff % 1f) * 5f) - 1);
148 } 146 }
149 147
150 hfdiffihighlight = Math.Abs((int)((hfdiff * highlightfactor) * 4.5f)) + 1; 148 hfdiffihighlight = Math.Abs((int)((hfdiff * highlightfactor) * 4.5f)) + 1;
151 if (hfdiff % 1f != 0) 149 if (hfdiff % 1f != 0)
152 { 150 {
@@ -195,10 +193,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
195 color = Color.FromArgb((r - hfdiffi > 0) ? r - hfdiffi : 0, 193 color = Color.FromArgb((r - hfdiffi > 0) ? r - hfdiffi : 0,
196 (g - hfdiffi > 0) ? g - hfdiffi : 0, 194 (g - hfdiffi > 0) ? g - hfdiffi : 0,
197 (b - hfdiffi > 0) ? b - hfdiffi : 0); 195 (b - hfdiffi > 0) ? b - hfdiffi : 0);
198 196
199 mapbmp.SetPixel(x-1, yr+1, color); 197 mapbmp.SetPixel(x-1, yr+1, color);
200 } 198 }
201
202 } 199 }
203 } 200 }
204 } 201 }
@@ -213,7 +210,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
213 color = Color.Black; 210 color = Color.Black;
214 mapbmp.SetPixel(x, yr, color); 211 mapbmp.SetPixel(x, yr, color);
215 } 212 }
216
217 } 213 }
218 else 214 else
219 { 215 {
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs
index 957a1df..615befc 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs
@@ -82,10 +82,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
82 // (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV) 82 // (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV)
83 public Color toColor() 83 public Color toColor()
84 { 84 {
85 if(s < 0f) Console.WriteLine("S < 0: " + s); 85 if (s < 0f) Console.WriteLine("S < 0: " + s);
86 else if(s > 1f) Console.WriteLine("S > 1: " + s); 86 else if (s > 1f) Console.WriteLine("S > 1: " + s);
87 if(v < 0f) Console.WriteLine("V < 0: " + v); 87 if (v < 0f) Console.WriteLine("V < 0: " + v);
88 else if(v > 1f) Console.WriteLine("V > 1: " + v); 88 else if (v > 1f) Console.WriteLine("V > 1: " + v);
89 89
90 float f = h / 60f; 90 float f = h / 60f;
91 int sector = (int)f % 6; 91 int sector = (int)f % 6;
@@ -95,7 +95,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
95 int ti = (int)(v * (1f - (1f - f) * s) * 255f); 95 int ti = (int)(v * (1f - (1f - f) * s) * 255f);
96 int vi = (int)(v * 255f); 96 int vi = (int)(v * 255f);
97 97
98 switch(sector) 98 switch (sector)
99 { 99 {
100 case 0: 100 case 0:
101 return Color.FromArgb(vi, ti, pi); 101 return Color.FromArgb(vi, ti, pi);
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
168 { 168 {
169 AssetBase asset = m_scene.AssetCache.GetAsset(id, true); 169 AssetBase asset = m_scene.AssetCache.GetAsset(id, true);
170 m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null); 170 m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null);
171 if(asset == null) return null; 171 if (asset == null) return null;
172 return new Bitmap(OpenJPEG.DecodeToImage(asset.Data)); 172 return new Bitmap(OpenJPEG.DecodeToImage(asset.Data));
173 } 173 }
174 174
@@ -179,9 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
179 // color-channel, so 2^24 is the maximum value we can get, adding everything. 179 // color-channel, so 2^24 is the maximum value we can get, adding everything.
180 // int is be big enough for that. 180 // int is be big enough for that.
181 int r = 0, g = 0, b = 0; 181 int r = 0, g = 0, b = 0;
182 for(int y = 0; y < bmp.Height; ++y) 182 for (int y = 0; y < bmp.Height; ++y)
183 { 183 {
184 for(int x = 0; x < bmp.Width; ++x) 184 for (int x = 0; x < bmp.Width; ++x)
185 { 185 {
186 Color c = bmp.GetPixel(x, y); 186 Color c = bmp.GetPixel(x, y);
187 r += (int)c.R & 0xff; 187 r += (int)c.R & 0xff;
@@ -218,14 +218,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
218 218
219 // interpolate two colors in HSV space and return the resulting color 219 // interpolate two colors in HSV space and return the resulting color
220 private HSV interpolateHSV(ref HSV c1, ref HSV c2, float ratio) { 220 private HSV interpolateHSV(ref HSV c1, ref HSV c2, float ratio) {
221 if(ratio <= 0f) return c1; 221 if (ratio <= 0f) return c1;
222 if(ratio >= 1f) return c2; 222 if (ratio >= 1f) return c2;
223 223
224 // make sure we are on the same side on the hue-circle for interpolation 224 // make sure we are on the same side on the hue-circle for interpolation
225 // We change the hue of the parameters here, but we don't change the color 225 // We change the hue of the parameters here, but we don't change the color
226 // represented by that value 226 // represented by that value
227 if(c1.h - c2.h > 180f) c1.h -= 360f; 227 if (c1.h - c2.h > 180f) c1.h -= 360f;
228 else if(c2.h - c1.h > 180f) c1.h += 360f; 228 else if (c2.h - c1.h > 180f) c1.h += 360f;
229 229
230 return new HSV(c1.h * (1f - ratio) + c2.h * ratio, 230 return new HSV(c1.h * (1f - ratio) + c2.h * ratio,
231 c1.s * (1f - ratio) + c2.s * ratio, 231 c1.s * (1f - ratio) + c2.s * ratio,
@@ -321,16 +321,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
321 } 321 }
322 322
323 HSV hsv; 323 HSV hsv;
324 if(hmod <= low) hsv = hsv1; // too low 324 if (hmod <= low) hsv = hsv1; // too low
325 else if(hmod >= high) hsv = hsv4; // too high 325 else if (hmod >= high) hsv = hsv4; // too high
326 else 326 else
327 { 327 {
328 // HSV-interpolate along the colors 328 // HSV-interpolate along the colors
329 // first, rescale h to 0.0 - 1.0 329 // first, rescale h to 0.0 - 1.0
330 hmod = (hmod - low) / (high - low); 330 hmod = (hmod - low) / (high - low);
331 // now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4 331 // now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4
332 if(hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f); 332 if (hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f);
333 else if(hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f); 333 else if (hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f);
334 else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f); 334 else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f);
335 } 335 }
336 336