aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs33
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs9
3 files changed, 7 insertions, 39 deletions
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs
index 8b9e0d3..622b16c 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs
@@ -161,7 +161,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
161 if(detailTexture[i].PixelFormat != PixelFormat.Format24bppRgb || 161 if(detailTexture[i].PixelFormat != PixelFormat.Format24bppRgb ||
162 detailTexture[i].Width != 16 || detailTexture[i].Height != 16) 162 detailTexture[i].Width != 16 || detailTexture[i].Height != 16)
163 using(Bitmap origBitmap = detailTexture[i]) 163 using(Bitmap origBitmap = detailTexture[i])
164 detailTexture[i] = ImageUtils.ResizeImageSolid(origBitmap, 16, 16); 164 detailTexture[i] = Util.ResizeImageSolid(origBitmap, 16, 16);
165 165
166 // Save the decoded and resized texture to the cache 166 // Save the decoded and resized texture to the cache
167 byte[] data; 167 byte[] data;
@@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
260 if(detailTexture[i].Width != 16 || detailTexture[i].Height != 16) 260 if(detailTexture[i].Width != 16 || detailTexture[i].Height != 16)
261 { 261 {
262 using(Bitmap origBitmap = detailTexture[i]) 262 using(Bitmap origBitmap = detailTexture[i])
263 detailTexture[i] = ImageUtils.ResizeImageSolid(origBitmap, 16, 16); 263 detailTexture[i] = Util.ResizeImageSolid(origBitmap, 16, 16);
264 } 264 }
265 } 265 }
266 } 266 }
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
index ca95b67..eefd0af 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
@@ -296,8 +296,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
296 int npointsx = (int)(regionsx / diff); 296 int npointsx = (int)(regionsx / diff);
297 int npointsy = (int)(regionsy / diff); 297 int npointsy = (int)(regionsy / diff);
298 298
299 float invsx = 1.0f / (npointsx); 299 float invsx = 1.0f / (npointsx * diff);
300 float invsy = 1.0f / (npointsy); 300 float invsy = 1.0f / (npointsy * diff);
301 301
302 npointsx++; 302 npointsx++;
303 npointsy++; 303 npointsy++;
@@ -387,9 +387,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
387 texture = new warp_Texture(image); 387 texture = new warp_Texture(image);
388 388
389 warp_Material material = new warp_Material(texture); 389 warp_Material material = new warp_Material(texture);
390// material.setReflectivity(50);
391 renderer.Scene.addMaterial("TerrainColor", material); 390 renderer.Scene.addMaterial("TerrainColor", material);
392// renderer.Scene.material("TerrainColor").setReflectivity(0); // reduces tile seams a bit thanks lkalif
393 renderer.SetObjectMaterial("Terrain", "TerrainColor"); 391 renderer.SetObjectMaterial("Terrain", "TerrainColor");
394 } 392 }
395 393
@@ -775,32 +773,5 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
775 { 773 {
776 return Utils.Lerp(Utils.Lerp(v00, v01, xPercent), Utils.Lerp(v10, v11, xPercent), yPercent); 774 return Utils.Lerp(Utils.Lerp(v00, v01, xPercent), Utils.Lerp(v10, v11, xPercent), yPercent);
777 } 775 }
778
779 /// <summary>
780 /// Performs a high quality image resize
781 /// </summary>
782 /// <param name="image">Image to resize</param>
783 /// <param name="width">New width</param>
784 /// <param name="height">New height</param>
785 /// <returns>Resized image</returns>
786 public static Bitmap ResizeImageSolid(Image image, int width, int height)
787 {
788 Bitmap result = new Bitmap(width, height, PixelFormat.Format24bppRgb);
789
790 using (ImageAttributes atrib = new ImageAttributes())
791 using (Graphics graphics = Graphics.FromImage(result))
792 {
793 atrib.SetWrapMode(System.Drawing.Drawing2D.WrapMode.TileFlipXY);
794 graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
795 graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
796 graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
797 graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.None;
798
799 graphics.DrawImage(image,new Rectangle(0,0, result.Width, result.Height),
800 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, atrib);
801 }
802
803 return result;
804 }
805 } 776 }
806} 777}
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 4b14c71..e899343 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1427,8 +1427,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1427 1427
1428 Bitmap mapTexture = new Bitmap(spanX, spanY); 1428 Bitmap mapTexture = new Bitmap(spanX, spanY);
1429 ImageAttributes gatrib = new ImageAttributes(); 1429 ImageAttributes gatrib = new ImageAttributes();
1430 Graphics g = Graphics.FromImage(mapTexture);
1431 gatrib.SetWrapMode(System.Drawing.Drawing2D.WrapMode.TileFlipXY); 1430 gatrib.SetWrapMode(System.Drawing.Drawing2D.WrapMode.TileFlipXY);
1431
1432 Graphics g = Graphics.FromImage(mapTexture);
1432 g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; 1433 g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
1433 g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; 1434 g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
1434 g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; 1435 g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
@@ -1687,11 +1688,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1687 if(mb > Constants.RegionSize && mb > 0) 1688 if(mb > Constants.RegionSize && mb > 0)
1688 { 1689 {
1689 float scale = (float)Constants.RegionSize/(float)mb; 1690 float scale = (float)Constants.RegionSize/(float)mb;
1690 Size newsize = new Size(); 1691 using(Bitmap scaledbmp = Util.ResizeImageSolid(mapbmp, (int)(bx * scale), (int)(by * scale)))
1691 newsize.Width = (int)(bx * scale);
1692 newsize.Height = (int)(by * scale);
1693
1694 using(Bitmap scaledbmp = new Bitmap(mapbmp,newsize))
1695 data = OpenJPEG.EncodeFromImage(scaledbmp, false); 1692 data = OpenJPEG.EncodeFromImage(scaledbmp, false);
1696 } 1693 }
1697 else 1694 else