From 33b4077c2c6631d17655e084e7a8af67cac33f6e Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 21 Sep 2015 00:44:53 +0100
Subject:  revert my change to the range of greyscale image maps, setting it
 back to 0 - 127.5 so not to break loading of old files. There isnt a range
 that fits all needs anyway

---
 .../World/Terrain/FileLoaders/GenericSystemDrawing.cs         | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index c0b276a..e8c719a 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -213,8 +213,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
         /// <returns>A System.Drawing.Bitmap containing a grayscale image</returns>
         protected static Bitmap CreateGrayscaleBitmapFromMap(ITerrainChannel map)
         {
+            //            Bitmap bmp = new Bitmap(map.Width, map.Height, PixelFormat.Format24bppRgb);
             Bitmap bmp = new Bitmap(map.Width, map.Height);
 
+
             const int pallete = 256;
 
             Color[] grays = new Color[pallete];
@@ -227,9 +229,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
             {
                 for (int x = 0; x < map.Width; x++)
                 {
-                    int colorindex = (int)map[x, y];  // one to one conversion as seems apparent on sl docs
-                    // or 0-511 range?
-                    // int colorindex = (int)map[x, y]/2;  // 0-511
+                    // to change this, loading also needs change
+
+                    // int colorindex = (int)map[x, y];  // one to one conversion 0 - 255m range
+                    // int colorindex = (int)map[x, y] / 2;  // 0 - 510 range
+
+                    int colorindex = (int)map[x, y] * 2; // the original  0 - 127.5 range
 
                     // clamp it not adding the red warning
                     if (colorindex < 0)
-- 
cgit v1.1