aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Terrain
diff options
context:
space:
mode:
authorUbitUmarov2015-09-21 00:44:53 +0100
committerUbitUmarov2015-09-21 00:44:53 +0100
commit33b4077c2c6631d17655e084e7a8af67cac33f6e (patch)
tree1d92aadb1e06f2a251d863ca7925f23007ef2ef3 /OpenSim/Region/CoreModules/World/Terrain
parent fix terrain save greyscale mapping to 1:1 suporting standard 0-255m range an... (diff)
downloadopensim-SC_OLD-33b4077c2c6631d17655e084e7a8af67cac33f6e.zip
opensim-SC_OLD-33b4077c2c6631d17655e084e7a8af67cac33f6e.tar.gz
opensim-SC_OLD-33b4077c2c6631d17655e084e7a8af67cac33f6e.tar.bz2
opensim-SC_OLD-33b4077c2c6631d17655e084e7a8af67cac33f6e.tar.xz
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
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain')
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs11
1 files 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
213 /// <returns>A System.Drawing.Bitmap containing a grayscale image</returns> 213 /// <returns>A System.Drawing.Bitmap containing a grayscale image</returns>
214 protected static Bitmap CreateGrayscaleBitmapFromMap(ITerrainChannel map) 214 protected static Bitmap CreateGrayscaleBitmapFromMap(ITerrainChannel map)
215 { 215 {
216 // Bitmap bmp = new Bitmap(map.Width, map.Height, PixelFormat.Format24bppRgb);
216 Bitmap bmp = new Bitmap(map.Width, map.Height); 217 Bitmap bmp = new Bitmap(map.Width, map.Height);
217 218
219
218 const int pallete = 256; 220 const int pallete = 256;
219 221
220 Color[] grays = new Color[pallete]; 222 Color[] grays = new Color[pallete];
@@ -227,9 +229,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
227 { 229 {
228 for (int x = 0; x < map.Width; x++) 230 for (int x = 0; x < map.Width; x++)
229 { 231 {
230 int colorindex = (int)map[x, y]; // one to one conversion as seems apparent on sl docs 232 // to change this, loading also needs change
231 // or 0-511 range? 233
232 // int colorindex = (int)map[x, y]/2; // 0-511 234 // int colorindex = (int)map[x, y]; // one to one conversion 0 - 255m range
235 // int colorindex = (int)map[x, y] / 2; // 0 - 510 range
236
237 int colorindex = (int)map[x, y] * 2; // the original 0 - 127.5 range
233 238
234 // clamp it not adding the red warning 239 // clamp it not adding the red warning
235 if (colorindex < 0) 240 if (colorindex < 0)