aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs
index b147004..c0173c0 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/File.cs
@@ -57,13 +57,16 @@ namespace libTerrain
57 57
58 public void SaveImage(string filename) 58 public void SaveImage(string filename)
59 { 59 {
60 Channel outmap = this.Copy();
61 outmap.Normalise();
62
60 Bitmap bit = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format24bppRgb); 63 Bitmap bit = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
61 int x, y; 64 int x, y;
62 for (x = 0; x < w; x++) 65 for (x = 0; x < w; x++)
63 { 66 {
64 for (y = 0; y < h; y++) 67 for (y = 0; y < h; y++)
65 { 68 {
66 int val = Math.Min(255, (int)(map[x,y] * 255)); 69 int val = Math.Min(255, (int)(outmap.map[x,y] * 255));
67 Color col = Color.FromArgb(val,val,val); 70 Color col = Color.FromArgb(val,val,val);
68 bit.SetPixel(x, y, col); 71 bit.SetPixel(x, y, col);
69 } 72 }