diff options
author | Garmin Kawaguichi | 2012-04-19 15:47:56 +0200 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-20 03:26:02 +0100 |
commit | 63cda3a6d0910b74680cd343ab7bc07a6651f1cb (patch) | |
tree | caf1566a6f0afcf84715e0ef79d59d9e43650007 | |
parent | Add more exception detail to Exception and IOException throws in BaseHttpServ... (diff) | |
download | opensim-SC_OLD-63cda3a6d0910b74680cd343ab7bc07a6651f1cb.zip opensim-SC_OLD-63cda3a6d0910b74680cd343ab7bc07a6651f1cb.tar.gz opensim-SC_OLD-63cda3a6d0910b74680cd343ab7bc07a6651f1cb.tar.bz2 opensim-SC_OLD-63cda3a6d0910b74680cd343ab7bc07a6651f1cb.tar.xz |
concerns GenericSystemDrawing.cs
in OpenSim\Region\CoreModules\World\Terrain\FileLoaders\GenericSystemDrawing.cs
Ln 67
Apply Justin's solution
Signed-off-by: Garmin Kawaguichi <garmin.kawaguichi@magalaxie.com>
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index da81dc1..cd46276 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | |||
@@ -64,18 +64,19 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
64 | 64 | ||
65 | public virtual ITerrainChannel LoadFile(string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int w, int h) | 65 | public virtual ITerrainChannel LoadFile(string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int w, int h) |
66 | { | 66 | { |
67 | Bitmap bitmap = new Bitmap(filename); | 67 | using (Bitmap bitmap = new Bitmap(filename)) |
68 | ITerrainChannel retval = new TerrainChannel(true); | ||
69 | |||
70 | for (int x = 0; x < retval.Width; x++) | ||
71 | { | 68 | { |
72 | for (int y = 0; y < retval.Height; y++) | 69 | ITerrainChannel retval = new TerrainChannel(true); |
70 | |||
71 | for (int x = 0; x < retval.Width; x++) | ||
73 | { | 72 | { |
74 | retval[x, y] = bitmap.GetPixel(offsetX * retval.Width + x, (bitmap.Height - (retval.Height * (offsetY + 1))) + retval.Height - y - 1).GetBrightness() * 128; | 73 | for (int y = 0; y < retval.Height; y++) |
74 | { | ||
75 | retval[x, y] = bitmap.GetPixel(offsetX * retval.Width + x, (bitmap.Height - (retval.Height * (offsetY + 1))) + retval.Height - y - 1).GetBrightness() * 128; | ||
76 | } | ||
75 | } | 77 | } |
78 | return retval; | ||
76 | } | 79 | } |
77 | |||
78 | return retval; | ||
79 | } | 80 | } |
80 | 81 | ||
81 | public virtual ITerrainChannel LoadStream(Stream stream) | 82 | public virtual ITerrainChannel LoadStream(Stream stream) |